注:本安装指南使用rpm的方式安装kudu,因为在测试过程中,发现源码编译安装kudu后部分命令无法使用,故放弃这种方式。
环境:
操作系统:centos 6.6
kudu版本:kudu-1.7.0 cdh5.16.1
一、依赖安装
代码语言:javascript复制sudo yum install autoconf automake cyrus-sasl-devel cyrus-sasl-gssapi
cyrus-sasl-plain flex gcc gcc-c gdb git java-1.8.0-openjdk-devel
krb5-server krb5-workstation libtool make openssl-devel patch
pkgconfig redhat-lsb-core rsync unzip vim-common which
二、下载并安装kudu
下载地址:https://archive.cloudera.com/cdh5/redhat/6/x86_64/cdh/5/RPMS/x86_64/。依次下载:
代码语言:javascript复制kudu-1.7.0 cdh5.16.1 0-1.cdh5.16.1.p0.3.el6.x86_64.rpm
kudu-client-devel-1.7.0 cdh5.16.1 0-1.cdh5.16.1.p0.3.el6.x86_64.rpm
kudu-client0-1.7.0 cdh5.16.1 0-1.cdh5.16.1.p0.3.el6.x86_64.rpm
kudu-debuginfo-1.7.0 cdh5.16.1 0-1.cdh5.16.1.p0.3.el6.x86_64.rpm
kudu-master-1.7.0 cdh5.16.1 0-1.cdh5.16.1.p0.3.el6.x86_64.rpm
kudu-tserver-1.7.0 cdh5.16.1 0-1.cdh5.16.1.p0.3.el6.x86_64.rpm
这里假设rpm文件的保存目录为/data/kudu/rpm,文件下载好后,执行如下命令进行安装:
代码语言:javascript复制rpm -ivh --nodeps *
然后执行以下命令创建kudu的数据目录和日志目录:
代码语言:javascript复制# master元数据目录:删除、创建并授权
rm -rf /data/kudu/kudu_master_data
mkdir -p /data/kudu/kudu_master_data
chown -R kudu:kudu /data/kudu/kudu_master_data
# table数据目录:删除、创建并授权
rm -rf /data/kudu/kudu_tserver_data
mkdir -p /data/kudu/kudu_tserver_data
chown -R kudu:kudu /data/kudu/kudu_tserver_data
# 创建日志目录并授权
rm -rf /data/log/kudu
mkdir -p /data/log/kudu
chown -R kudu:kudu /data/log/kudu
修改配置文件:
kudu的配置文件位于/etc/default/目录下。
1、kudu-master服务配置
(1)/etc/default/kudu-master:
代码语言:javascript复制export FLAGS_log_dir=/data/log/kudu //日志目录
export FLAGS_rpc_bind_addresses=0.0.0.0:7051 //或hostname:7051
(2)/etc/kudu/conf/master.gflagfile:
代码语言:javascript复制# Do not modify these two lines. If you wish to change these variables,
# modify them in /etc/default/kudu-master.
--fromenv=rpc_bind_addresses
--fromenv=log_dir
--fs_wal_dir=/data/kudu/kudu_master_data
--fs_data_dirs=/data/kudu/kudu_master_data
--master_addresses=hadoop21-test1-rgtj5-tj1:7051,hadoop20-test1-rgtj5-tj1:7051,hadoop22-test1-rgtj5-tj1:7051
2、kudu-tserver服务配置
(1)/etc/default/kudu-tserver:
代码语言:javascript复制export FLAGS_log_dir=/data/log/kudu //日志目录
export FLAGS_rpc_bind_addresses=0.0.0.0:7050 //或hostname:7050
(2)/etc/kudu/conf/tserver.gflagfile:
代码语言:javascript复制# 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=/data/kudu/kudu_tserver_data
--fs_data_dirs=/data/kudu/kudu_tserver_data
--tserver_master_addrs=hadoop21-test1-rgtj5-tj1:7051,hadoop20-test1-rgtj5-tj1:7051,hadoop22-test1-rgtj5-tj1:7051
三、启动kudu
1、检查NTP服务
kudu的启动依赖NTP时钟管理服务,因此在启动kudu之前,需要验证NTP服务是否安装以及启动。如果未安装NTP服务的话,启动kudu会报如下错误:
代码语言:javascript复制F0924 20:24:36.336809 14550 hybrid_clock.cc:191 Couldn't get the current time: Clock unsynchronized. Status: Service unavailable: Error reading clock. Clock considered unsynchronized.
安装和启动NTP服务的命令如下:
代码语言:javascript复制# 安装
sudo yum install ntp
# 启动
sudo /etc/init.d/ntpd restart
2、启动、重启、停止kudu
代码语言:javascript复制## 启动
/etc/init.d/kudu-master start
/etc/init.d/kudu-tserver start
## 重启
/etc/init.d/kudu-master restart
/etc/init.d/kudu-tserver restart
## 停止
/etc/init.d/kudu-master stop
/etc/init.d/kudu-tserver stop
3、kudu管理界面
启动成功后,可以访问kudu的master和tablet server管理界面,访问地址如下:
代码语言:javascript复制# master管理界面
http://ip:8051/masters
# tablet server管理界面
http://ip:8050/