三个主机就不提了,直接点
#####安装jdk######
[root@Zk-1 ~]# rpm -ivh jdk-7u76-linux-x64.rpm[root@Zk-1 ~]# vi /etc/profile...export ZOO_HOME=/usr/local/zookeeperexport PATH=$PATH:$ZOO_HOME/binexport JAVA_HOME=/usr/java/jdk1.7.0_76export PATH=$JAVA_HOME/bin:$PATHexport CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar...
[root@Zk-1 ~]# cd /usr/local[root@Zk-1 ~]# tar -zxf zookeeper-3.4.6-product.tar.gz[root@Zk-1 ~]# rm -f zookeeper-3.4.6-product.tar.gz[root@Zk-1 ~]# mv zookeeper-3.4.6 zookeeper[root@Zk-1 ~]# mkdir /data[root@Zk-1 ~]# source /etc/profile
######配置zookeeper环境####
[root@Zk-1 ~]# vim /usr/local/zookeeper/conf/zoo.cfg...# The number of milliseconds of each ticktickTime=2000# The number of ticks that the initial # synchronization phase can takeinitLimit=10# The number of ticks that can pass between # sending a request and getting an acknowledgementsyncLimit=5# the directory where the snapshot is stored.# do not use /tmp for storage, /tmp here is just # example sakes.dataDir=/data/# the port at which the clients will connectclientPort=2181# the maximum number of client connections.# increase this if you need to handle more clients#maxClientCnxns=60## 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 dataDirautopurge.snapRetainCount=500# Purge task interval in hours# Set to "0" to disable auto purge featureautopurge.purgeInterval=168server.1=10.0.76.108:2888:3888server.2=10.0.76.109:2888:3888server.3=10.0.76.110:2888:3888...[root@Zk-1 ~]# vim /data/myid...1 #看主机而改...
#########启动zookeeper########
[root@Zk-1 ~]# zkServer.sh start[root@Zk-1 ~]# zkServer.sh status...JMX enabled by defaultUsing config: /usr/local/zookeeper/zookeeper-3.4.6/bin/../conf/zoo.cfgMode: follower #或者leader[root@Zk-1 ~]# jps6213 Jps1932 QuorumPeerMain