Zookeeper单机版

[root@mihaoyu151 ~]# cd /opt/install/
[root@mihaoyu151 install]# ll
total 773684
-rw-r--r--. 1 root root 433895552 Oct 25 17:59 hadoop-2.6.0-cdh5.14.2.tar.gz
-rw-r--r--. 1 root root 128523051 Oct 25 17:59 hive-1.1.0-cdh5.14.2.tar.gz
-rw-r--r--. 1 root root 195094741 Oct 20 22:25 jdk-8u221-linux-x64.tar.gz
-rw-r--r--. 1 root root  34731946 Nov  3 19:09 zookeeper-3.4.5-cdh5.14.2.tar.gz

# 解压
[root@mihaoyu151 install]# tar -zxvf zookeeper-3.4.5-cdh5.14.2.tar.gz -C /opt/soft/

# 重命名
[root@mihaoyu151 install]# mv ../soft/zookeeper-3.4.5-cdh5.14.2 ../soft/zookeeper345

[root@mihaoyu151 install]# cd ../soft
[root@mihaoyu151 soft]# ll
total 4
drwxr-xr-x. 16 1106 4001  270 Oct 25 20:32 hadoop260
drwxr-xr-x.  7   10  143  245 Jul  4  2019 jdk180
drwxr-xr-x. 15 root root 4096 Nov  3 19:11 zookeeper345

[root@mihaoyu151 soft]# cd zookeeper345/conf/
[root@mihaoyu151 conf]# ll
total 24
-rw-rw-r--. 1 root root  535 Mar 28  2018 configuration.xsl
-rw-rw-r--. 1 root root 2693 Mar 28  2018 log4j.properties
-rw-rw-r--. 1 root root  922 Mar 28  2018 zoo_sample.cfg

# 拷贝
[root@mihaoyu151 conf]# cp zoo_sample.cfg zoo.cfg

# 修改dataDir目录,追加server.1
[root@mihaoyu151 conf]# vi zoo.cfg
12 dataDir=/opt/soft/zookeeper345/datatmp
30 server.1=192.168.133.151:2888:3888

# 创建目录
[root@mihaoyu151 conf]# cd ..
[root@mihaoyu151 zookeeper345]# mkdir datatmp

[root@mihaoyu151 zookeeper345]# cd datatmp/

#创建文件myid,内容与zoo.cfg中server.1对应
[root@mihaoyu151 datatmp]# vi myid
1

# 添加系统变量
[root@mihaoyu151 datatmp]# vi /etc/profile
#zookeeper
export ZOOKEEPER_HOME=/opt/soft/zookeeper345
export PATH=$PATH:$ZOOKEEPER_HOME/bin

# 编译环境
[root@mihaoyu151 datatmp]# source /etc/profile

# 开启zk
[root@mihaoyu151 datatmp]# zkServer.sh start
JMX enabled by default
Using config: /opt/soft/zookeeper345/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

# 查看zk状态
[root@mihaoyu151 datatmp]# zkServer.sh status
JMX enabled by default
Using config: /opt/soft/zookeeper345/bin/../conf/zoo.cfg
Mode: standalone

# 关闭zk
[root@mihaoyu151 datatmp]# zkServer.sh stop
JMX enabled by default
Using config: /opt/soft/zookeeper345/bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

honconM

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值