参考贴:
https://www.cnblogs.com/lsdb/p/7297731.html
https://blog.youkuaiyun.com/shatelang/article/details/7596007
安装步骤:
1.下载zookeeper 书P185 3.4.6(hadoop2.4.1 openjdk version "1.8.0_151")
2.解压到 /usr/local 重命名为zookeeper
4.修改配置文件conf目录下的zoo_sampel.cfg 改名为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.
dataDir=/usr/local/zookeeper/data
# the port at which the clients will connect
clientPort=2181
#set maxClientCnxns
#maxClientCnxns=1(此处和下面注释掉的几处,单机不写也行)
#set minSessionTimeout
#minSessionTimeout=2000
#set maxSessionTImeout
#maxSessionTimeout=20000
#the location of the log file
dataLogDir=/usr/local/zookeeper/log(重要,别写错位置啦,不然会一直连接不上,当然,也有可能是前面配置的问题,把用不上的注释掉)
还有好几处配置 按照需求修改
server.0=node:2288:3388(这里是node)
开始测试
1.开启相关命令(先跑到bin下面)
./zkServer.sh start
./zkServer.sh stop
./zkServer.sh restart
./zkServer.sh status
2.连接到
zkCli.sh -server node:2181(和前面配置文件一致)
3.测试
zk mydata(中间有空格 后面也是)
https://www.cnblogs.com/lsdb/p/7297731.html
https://blog.youkuaiyun.com/shatelang/article/details/7596007
安装步骤:
1.下载zookeeper 书P185 3.4.6(hadoop2.4.1 openjdk version "1.8.0_151")
2.解压到 /usr/local 重命名为zookeeper
3.在zookeeper中创建文件夹 data log (很重要)
创建文件myid:写0(因为没有做多个节点,这步可能可以不做,没有实验过,不过我是做了)
4.修改配置文件conf目录下的zoo_sampel.cfg 改名为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.
dataDir=/usr/local/zookeeper/data
# the port at which the clients will connect
clientPort=2181
#set maxClientCnxns
#maxClientCnxns=1(此处和下面注释掉的几处,单机不写也行)
#set minSessionTimeout
#minSessionTimeout=2000
#set maxSessionTImeout
#maxSessionTimeout=20000
#the location of the log file
dataLogDir=/usr/local/zookeeper/log(重要,别写错位置啦,不然会一直连接不上,当然,也有可能是前面配置的问题,把用不上的注释掉)
还有好几处配置 按照需求修改
server.0=node:2288:3388(这里是node)
开始测试
1.开启相关命令(先跑到bin下面)
./zkServer.sh start
./zkServer.sh stop
./zkServer.sh restart
./zkServer.sh status
2.连接到
zkCli.sh -server node:2181(和前面配置文件一致)
3.测试
zk mydata(中间有空格 后面也是)