linux的zookeeper,linux中zookeeper的安装与配置

1.

1.1创建四台虚拟机并启动:

bc9ec2affe2ae7dd240e181ccd1294e3.png

1.2在shell中建立一个centos7的文件夹里边放四个会话,分别note1,note2,note3,note4

f4f55e8c5df0bb2096e2afc991bfe0ed.png

1.3成功建立

1a1551dff630cbab80a4c64f207b31e2.png

2.开始配置

2.1:修改主机名:hostnamectl set-hostname 主机名 --static (永久性的)

重启:reboot

查看主机名:hostname

f6ac630e962470fe45230e1c5f1078a0.png

2.2防火墙的关闭

输入service iptables stop 时,出现下面的错误:

4a4f03af395cee337cae0131785b6391.png

这时就需要安装一个iptables-service:

systemctl stop firewalld

systemctl mask firewalld

yum install iptables-services(安装)

systemctl stop iptables(开机关闭)

service iptables save(保存)

2.3:设置同步按钮

71d2f158f56e2959c6fb6dc4462d694d.png

66c71b33131f5dfc0170d6321cb40ed3.png

2.4创建zookeeper文件夹

c0d1dd3099c4d335ba1df4729dcb535d.png

77fc643db37172b532ba8386695034f3.png

2.5点击xftp6,打开想传的zookeeper-bin文件,

2.6 zookeeper下载地址:

https://mirrors.cloud.tencent.com/apache/zookeeper/zookeeper-3.5.7/

2.7note1,note2,note3,都用此方法上传

95a8c1479661ece6964f8072a5c0c63b.png

82b7824f18f7ec2a0b79e24833020d98.png

2.8:解压:tar -zxvf apache-zookeeper-3.5.7-bin.tar.gz

9519adf111318d566cb6ad11993104e9.png

2.9改名:

mv apache-zookeeper-3.5.7-bin apache-zookeeper

cc74e9b866e89c90632fbaf09203e2b0.png

删除tar包

082abd9e51ab0a964afb91747efd626a.png

进入data,创建并进入myid,修改里边内容

8710ca840cc044a546b5651e35259156.png

myid里分别写0,1,2。i,修改;esc退出 :wq!强制保存退出

b11b2b7897bffecb8d39b5ff886d7b54.png

进入apache-zookeeper

332a96479449837434dc8af2dc7b6354.png

3.修改zookeeper配置文件:

3.1:进入conf``[root@note1 apache-zookeeper]# cd conf/```

复制zoo_sample.cfg,给zoo.cfg。[root@note1 conf]# cp zoo_sample.cfg zoo.cfg

修改配置文件zoo.cfg 。 [root@note1 conf]# vim zoo.cfg

zoo.cfg配置文件:

dataDir=/data/zookeeper/data

server.0=note1:2888:3888

server.1=note2:2888:3888

server.2=note3:2888:3888

# 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=/data/zookeeper/data

# 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

#

# The 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

server.0=note1:2888:3888

server.1=note2:2888:3888

server.2=note3:2888:3888

3.2:启动zookeeper[root@note1 apache-zookeeper]# bin/zkServer.sh start

4489299f630636d897f7d1ac78370cdc.png

查看状态:[root@note1 apache-zookeeper]# bin/zkServer.sh status

jps启动:jps

9ee0790e5d2c786c148581535356f401.png

3.3在浏览器上(火狐)访问note1:8080

18f9ccc3eb7a922e33757fbcea86cf4b.png

3.4

f06f70c6b6af1979a0e786778be2f5b8.png

完成zookeeper的配置

3.4 :

查看日志vim logs/zookeeper-root-server-note1.out

分发文件:scp -r apache-zookeeper/root@note2$pwd scp -r apache-zookeeper/root@note3$pwd

标签:cfg,note1,root,zookeeper,zoo,linux,apache,安装

来源: https://blog.csdn.net/XIAOMO__/article/details/104802404

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值