Adding New Nodes to the Cluster
In this example, ceph4 and ceph5 are added to the cluster.
- Install the ZooKeeper software package based on Installing ZooKeeper.
- Configure myid for the new nodes (4 for ceph4 and 5 for ceph5 in this example).
ceph4:
1 2
mkdir /opt/apache-zookeeper-3.6.3-bin-bcm/zkData echo 4 > /opt/apache-zookeeper-3.6.3-bin-bcm/zkData/myid
ceph5:
1 2
mkdir /opt/apache-zookeeper-3.6.3-bin-bcm/zkData echo 5 > /opt/apache-zookeeper-3.6.3-bin-bcm/zkData/myid
- Configure the /opt/apache-zookeeper-3.6.3-bin-bcm/conf/zoo.cfg file of the new nodes.
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 40 41
# 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.80=ceph1:2889:3889;2182 server.90=ceph2:2889:3889;2182 server.100=ceph3:2889:3889;2182 server.4=ceph4:2889:3889;2182 server.5=ceph5:2889:3889;2182 4lw.commands.whitelist=*
- Start the ZooKeeper service on the new nodes.
1/opt/apache-zookeeper-3.6.3-bin-bcm/bin/zkServer.sh start - Query the ZooKeeper service status on the new nodes.
1 2 3 4 5 6 7 8 9 10
[root@ceph4 bin]# /opt/apache-zookeeper-3.6.3-bin-bcm/bin/zkServer.sh status ZooKeeper JMX enabled by default Using config: /opt/apache-zookeeper-3.6.3-bin-bcm/bin/../conf/zoo.cfg Client port found: 2182. Client address: localhost. Client SSL: false. Mode: follower [root@ceph5 bin]# /opt/apache-zookeeper-3.6.3-bin-bcm/bin/zkServer.sh status ZooKeeper JMX enabled by default Using config: /opt/apache-zookeeper-3.6.3-bin/bin-bcm/../conf/zoo.cfg Client port found: 2182. Client address: localhost. Client SSL: false. Mode: follower
Parent topic: Capacity Expansion Operations