1、下载kudu依赖: yum -y install cyrus-sasl-plain ntp
2、下载kudu rpm包:
3、kudu安装部署分布:
4、进入目录:/etc/kudu/conf
修改master.gflagfile文件如下:
# Do not modify these two lines. If you wish to change these variables, # modify them in /etc/default/kudu-master. ## Comma-separated list of the RPC addresses belonging to all Masters in this cluster. ## NOTE: if not specified, configures a non-replicated Master. --fromenv=rpc_bind_addresses --fromenv=log_dir --fs_wal_dir=/var/lib/kudu/master --fs_data_dirs=/var/lib/kudu/master --master_addresses=cdh02:7051,cdh03:7051 ## You can avoid the dependency on ntpd by running Kudu with --use-hybrid-clock=false ## This is not recommended for production environment. ## NOTE: If you run without hybrid time the tablet history GC will not work. ## Therefore when you delete or update a row the history of that data will be kept ## forever. Eventually you may run out of disk space. #--use_hybrid_clock=false
修改tserver.gflagfile文件如下:
# Do not modify these two lines. If you wish to change these variables, # modify them in /etc/default/kudu-tserver. --fromenv=rpc_bind_addresses --fromenv=log_dir --fs_wal_dir=/var/lib/kudu/tserver --fs_data_dirs=/var/lib/kudu/tserver --tserver_master_addrs=node02:7051,node03:7051
5、上面两个文件修改好之后分发到上述三台机器
启动方式:进入/etc/init.d目录:
service kudu-master restart
service kudu-tserver restart
6、启动后在/var/log/kudu目录进行日志的查看
启动成功在后台查看端口:
master:8051
tserver:8050
进入浏览器进行IP:端口 验证kudu服务是否正常
kudu常见报错,摘自:
整理如下:
第一种报错:
Log file created at: 2018/04/02 10:40:33 Running on machine: mrj001 Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg F0402 10:40:33.091943 51977 master_options.cc:46] At least 2 masters are required for a distributed config, but master_addresses flag ('192.168.137.6') only specifies 1 masters.
报错分析:
至少需要配置两个master,但是只配置了一个
报错处理:
kudu-master支持多master备份机制,所以配置时需注意; vi /etc/kudu/kudu-master 注释掉--master-addresses 该参数配置为master节点以及ip列表,不指定默认为单master节点;如果指定了该配置,但是只有一个master节点就会报错;
第二种报错:
Log file created at: 2018/04/02 10:46:39
Running on machine: mrj001
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
F0402 10:46:39.101296 52137 tablet_server_main.cc:72] Check failed: _s.ok() Bad status: IO error: Failed to load FS layout: Could not lock /soft/kudu/data/data/block_manager_instance: Could not lock /soft/kudu/data/data/block_manager_instance: lock /soft/kudu/data/data/block_manager_instance: Resource temporarily unavailable (error 11)
报错分析:
kudu-tserver启动报错,对目录/soft/kudu/data/data/block_manager_instance不能够进行锁定
第三种报错:
Log file created at: 2018/04/06 16:13:39
Running on machine: mrj001
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
F0406 16:13:39.828665 2572 master_main.cc:68] Check failed: _s.ok() Bad status: Service unavailable: Cannot initialize clock: Error reading clock. Clock considered unsynchronized
报错分析:
kudu在启动之前必须保证各个服务器ntp一致,当各个table server不一致时会导致此报错;
解决办法:
查看ntpd服务是否开启:service ntpd status
查看ntpd服务是否已经同步:ntpstat
如果没有安装ntp服务,请参照本人所写博客:https://blog.csdn.net/m0_38003171/article/details/79789557
第四种报错:
Log file created at: 2018/04/07 13:24:52
Running on machine: mrj001
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
F0407 13:24:52.627974 5771 master_main.cc:68] Check failed: _s.ok() Bad status: IO error: Could not create new FS layout: Unable to write instance metadata: Call to mkstemp() failed on name template /soft/kudu/master/data/instance.kudutmp.XXXXXX: Permission denied (error 13)
报错分析:
经过分析报错可以得出:/soft/kudu/master/data/目录下没有创建文件的权限,同时kudu在启动的时候默认是使用kudu用户进行创建,所以要确定kudu用户能够对该文件夹下面的所有目录进行管理
报错处理:
在没有权限的目录下面执行:chown -R kudu:kudu ./*,改变用户组和用户为kudu即可解决
第五种报错:
Log file created at: 2018/04/07 13:37:05
Running on machine: mrj001
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
F0407 13:37:05.960657 5931 tablet_server_main.cc:72] Check failed: _s.ok() Bad status: IO error: Failed to load FS layout: Filesystem root /soft/kudu/tserver/wal contains illegal whitespace
报错分析:
/soft/kudu/tserver/wal包含不符合规则的空白
报错处理:
这个报错是因为tserver配置文件中没有指定master地址造成的; 检查/etc/kudu/conf/tserver.gflagfile配置文件,在该配置文件中添加:--tserver_master_addrs=mrj001:7051 注意:mrj001为主机名