大数据(四)-----zookeeper安装

阅读更多

1.安装规划

  见大数据(一)-----HADOOP安装

2.zookeeper安装

  • 下载并解压ZooKeeper-3.4.6.tar.gz,安装目录为:/home/hadoop/zookeeper-3.3.6,zookeeper集群安装需为奇数台(重要)
tar -zxvf zookeeper-3.4.6.tar.gz
  • 配置环境变量
vi /etc/profile
export ZOOKEEPER_HOME=/home/hadoop/zookeeper-3.4.6
source /etc/profil
 
  • 在conf目录下修改zoo.cfg,配置好dataDir和dataLogDir两个目录
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# the port at which the clients will connect
clientPort=2181
dataDir=/home/hadoop/zookeeper-3.3.6/dataDir
dataLogDir=/home/hadoop/zookeeper-3.3.6/logs
server.1=10.112.171.49:2888:3888
server.2=10.112.171.50:2888:3888
server.3=10.112.171.51:2888:3888
  •  将安装好的zookeeper拷贝到集群其他机器的同样目录下,配置相同的环境变量
  • 在三台机器的dataDir目录下,分别新建文件myid,在10.112.171.49写入1,10.112.171.50写入2,10.112.171.51写入3,标识三台机器
  • 在每台机器上启动zookeeper,并检查状态
./zkServer.sh start
./zkServer.sh status
./zkServer.sh stop
 

你可能感兴趣的:(大数据(四)-----zookeeper安装)