在扩容前,请先确认原集群配置。后文将以3节点BCM ZooKeeper集群扩容到5节点为例,介绍ZooKeeper集群扩容操作。此处以部署ZooKeeper集群部署的BCM ZooKeeper集群配置文件为例,查询并确认与原集群配置。
使用vim编辑器查询配置文件详细信息。
1 | vim /opt/apache-zookeeper-3.6.3-bin-bcm/conf/zoo.cfg
|
获取原集群配置信息如下。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | # The number of milliseconds of each tick tickTime=1000 # 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=2 # the directory where the snapshot is stored. # do not use /tmp for storage, /tmp here is just # example sakes. dataDir=/opt/apache-zookeeper-3.6.3-bin-bcm/zkData # the port at which the clients will connect clientPort=2182 # the maximum number of client connections. # increase this if you need to handle more clients maxClientCnxns=333 # # 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=3 ## Metrics Providers # # https://prometheus.io Metrics Exporter #metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider #metricsProvider.httpPort=7000 #metricsProvider.exportJvmInfo=true server.1=ceph1:2889:3889;2182 server.2=ceph2:2889:3889;2182 server.3=ceph3:2889:3889;2182 4lw.commands.whitelist=* |