-
下载zookeeper(其中有不带bin的压缩包,但是最后没有成功,下载带bin的成功)
下载地址:http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-3.5.8/apache-zookeeper-3.5.8-bin.tar.gz
-
将文件解压到
/usr/local
目录下,并重命名为apache-zookeeper
mv apache-zookeeper-3.5.8-bin apache-zookeeper
-
进入
apache-zookeeper
目录,创建data
和logs
目录mkdir data
mkdir logs
-
进入
conf
目录,拷贝文件zoo_sample.cfg
,命名为zoo_cfg
,只能是zoo_cfg
cp zoo_sample.cfg zoo.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. #do not use /tmp for storage, /tmp here is just #example sakes. dataDir=/use/local/apache-zookeeper/data dataLogDir=/use/local/apache-zookeeper/logs #the port at which the clients will connect clientPort=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 # #he 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
-
输入命令
vi /erc/profile
配置环境变量,在文件末尾加上export ZOOKEEPER_HOME=/usr/local/apache-zookeeper export PATH=$PATH:$ZOOKEEPER_HOME/bin
输入命令
source /etc/profile
让环境变量生效进入 apache-zookeeper/bin目录下,输入命令
./zkServer.sh start
启动zk,./zkServer.sh stop
停止服务,./zkServer.sh status
查看状态
Linux部署zookeeper
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...