zookeeper环境搭建与启动-创新互联
解压
[root@localhost zookeeper-3.4.6]# tar zxvf zookeeper-3.4.6.tar.gz
[root@localhost zookeeper-3.4.6]# pwd
/home/zookeeper/zookeeper-3.4.6
[root@localhost zookeeper-3.4.6]#
新建目录:
[root@localhost zookeeper-3.4.6]# mkdir data
进入目录:cd conf
/home/zookeeper/zookeeper-3.4.6/conf
修改名字
[root@localhost conf]# mv zoo_sample.cfg zoo.cfg
编辑文件
vim zoo.cfg
----------------------------------------------
1 # The number of milliseconds of each tick
2 tickTime=2000
3 # The number of ticks that the initial
4 # synchronization phase can take
5 initLimit=10
6 # The number of ticks that can pass between
7 # sending a request and getting an acknowledgement
8 syncLimit=5
9 # the directory where the snapshot is stored.
10 # do not use /tmp for storage, /tmp here is just
11 # example sakes.
12 dataDir=/home/zookeeper/zookeeper-3.4.6/data
13 # the port at which the clients will connect
14 clientPort=2181
15 # the maximum number of client connections.
16 # increase this if you need to handle more clients
17 #maxClientCnxns=60
18 #
19 # Be sure to read the maintenance section of the
20 # administrator guide before turning on autopurge.
21 #
22 # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
23 #
24 # The number of snapshots to retain in dataDir
25 #autopurge.snapRetainCount=3
26 # Purge task interval in hours
27 # Set to "0" to disable auto purge feature
28 #autopurge.purgeInterval=1
~
启动
[root@localhost bin]# ./zkServer.sh start =========(启动方式)
JMX enabled by default
Using config: /home/zookeeper/zookeeper-3.4.6/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED ============(显示成功)
[root@localhost bin]# ./zkServer.sh status =======(查看状态方式)
JMX enabled by default
Using config: /home/zookeeper/zookeeper-3.4.6/bin/../conf/zoo.cfg
Mode: standalone (单独的 -- 解释问单利模式) ===========(查看状态 )
[root@localhost bin]#
关闭
[root@localhost bin]# ./zkServer.sh stop =====(关闭)
JMX enabled by default
Using config: /home/zookeeper/zookeeper-3.4.6/bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED
[root@localhost bin]#
[root@localhost bin]# ./zkServer.sh status ====(关闭状态)
JMX enabled by default
Using config: /home/zookeeper/zookeeper-3.4.6/bin/../conf/zoo.cfg
Error contacting service. It is probably not running.
(错误联系服务。它可能不会运行。)
[root@localhost bin]#
创新互联www.cdcxhl.cn,专业提供香港、美国云服务器,动态BGP最优骨干路由自动选择,持续稳定高效的网络助力业务部署。公司持有工信部办法的idc、isp许可证, 机房独有T级流量清洗系统配攻击溯源,准确进行流量调度,确保服务器高可用性。佳节活动现已开启,新人活动云服务器买多久送多久。
创新互联公司专注于企业营销型网站建设、网站重做改版、宜都网站定制设计、自适应品牌网站建设、H5开发、商城网站制作、集团公司官网建设、成都外贸网站制作、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为宜都等各大城市提供网站开发制作服务。分享题目:zookeeper环境搭建与启动-创新互联
分享网址:http://cdiso.cn/article/ccccii.html