zookeerper集群安装

zookeerper集群安装

  • 将安装包上传到虚拟机
  • 解压
  • 修改配置文件
  • 创建目录
  • 设置myid
  • 分发到其他主机

将安装包上传到虚拟机

解压

修改配置文件

[hadoop@hadoop6 ~]$ cat app/zookeeper/conf/zoo.cfg 
# 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.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/home/hadoop/data/zookeeper
# the port at which the clients will connect
clientPort=2181
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
server.1=hadoop7:2888:3888
server.2=hadoop6:2888:3888
server.3=hadoop5:2888:3888

创建目录

mkdir -p /home/hadoop/data/zookeeper

设置myid

 在/home/hadoop/data/zookeeper目录中
 echo 1 > myid

分发到其他主机

注意修改 myid 的值

你可能感兴趣的:(大数据,大数据之路)