zookeeper扩容
1,更改配置文件
--tdsql1
../conf/zoo.cfg
server.1=192.168.0.202:2888:3888
server.2=192.168.0.203:2888:3888
server.3=192.168.0.204:2888:3888
--tdsql1,tdsql2
../conf/zoo.cfg
server.1=192.168.0.202:2888:3888
server.2=192.168.0.203:2888:3888
server.3=192.168.0.204:2888:3888
../data/myid
2
2,启动tdsql2默认启动有如下信息
--Error contacting service. It is probably not running.
正常错误信息,集群模式只有启动多态zk状态才能正常显示。
[root@tdsql2 bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /data/application/zookeeper/bin/../conf/zoo.cfg
Error contacting service. It is probably not running.
3,检查tdsql1 zk状态
---模式显示为--standalone,需要重启zk.
[root@tdsql1 bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /data/application/zookeeper/bin/../conf/zoo.cfg
Mode: standalone
4,重启tdsql1 zk
--重启之后zk状态改变为leader
[root@tdsql1 bin]# ./zkServer.sh restart
ZooKeeper JMX enabled by default
Using config: /data/application/zookeeper/bin/../conf/zoo.cfg
ZooKeeper JMX enabled by default
Using config: /data/application/zookeeper/bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED
ZooKeeper JMX enabled by default
Using config: /data/application/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... ^[[ASTARTED
[root@tdsql1 bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /data/application/zookeeper/bin/../conf/zoo.cfg
Mode: leader
5,检查tdsql2状态
--状态改变为follower
[root@tdsql2 bin]#
[root@tdsql2 bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /data/application/zookeeper/bin/../conf/zoo.cfg
Mode: follower
- 点赞
- 收藏
- 关注作者
评论(0)