基于Hadoop集群的HBase集群的配置 1.准备工作 a.已经完成安装的Hadoop集群环境 b.所需要的软件包
zookeeper-3.4.4.tar.gz下载地址:
hbase-0.94.6.1tar.gz下载地址:
2.单独安装的ZooKeeper集群,不基于Hbase集群管理 a.在Master节点上解压zookeeperl ##建议使用hduser权限,避免之后出现SSH错误
hduser@master:/usr/local$sudo tar -zxvfzookeeper-3.4.4.tar.gz
l ##server后面的数字是zooKeeper识别时后的Id,需要与后面的设置保持一致
hduser@master:/usr/local$tvi /zookeeper/conf/zoo.cfg
tickTime=2000
initLimit=5
syncLimit=2
dataDir=/data/zookeeper
clientPort=2181
server.1=master:2888:3888
server.2=slave1:2888:3888
server.3=slave2:2888:3888
root@master:/usr/local# chown -Rhduser:hadoop zookeeper
3.将zookeeper复制到其他机器hduser@master:/usr/local$scp -r zookeeper-3.4.5hduser@slave1:/home/hduser
hduser@master:/usr/local$ scp -rzookeeper-3.4.5 hduser@slave2:/home/hduser
hduser@slave1:~#sudomv zookeeper-3.4.5/ /usr/local/zookeeper-3.4.5
hduser@slave2:~$sudomv zookeeper-3.4.5/ /usr/local/zookeeper-3.4.5
4.在每台机器配置的dataDir目录下面,创建myid文件标志当前主机Master: $touch /data/zookeeper/myid
$echo "1" >/data/zookeeper/myid
Slave1: $mkdir -p /data/zookeeper
$touch /data/zookeeper/myid
$echo "3" > /data/zookeeper/myid
Slave2: $mkdir -p/data/zookeeper
$touch /data/zookeeper/myid
$echo "5" > /data/zookeeper/myid
5. 启动zookeeper集群hduser@master:/usr/local/zookeeper/bin$./zkServer.sh start
JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
【问题1】Starting zookeeper ... ./zkServer.sh: line 113:/data/zookeeper/zookeeper_server.pid: Permission denied
FAILED TO WRITE PID
原因是刚才/data/zookeeper是root权限,而不是hduser的,修改权限之~
【问题1解决】root@master:/# chown -Rhduser:hadoop /data
其他两个slave节点也一样~
然后问题解决:
hduser@master:/usr/local/zookeeper$ cd bin
hduser@master:/usr/local/zookeeper/bin$ ./zkServer.sh start
JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
其他节点也同样启动zookeeper~
hduser@master:/usr/local/zookeeper/bin$
hduser@slave1:/usr/local/zookeeper/bin$./zkServer.sh status
JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg