---
title: 新节点加入集群
description: "以ceph4，ceph5作为新节点为例，加入新集群。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/2200SPC5/sds/kunpengglobalcache_06_0141.html
sourcePath: /source/zh/kunpengboostkithistory/2200SPC5/sds/kunpengglobalcache_06_0141.html
indexId: a03437382663c8044c216343d7faab568a462fe3b24f433c51c61572e0e1dce178
---
# 新节点加入集群

以ceph4，ceph5作为新节点为例，加入新集群。

1. 参考安装ZooKeeper安装zookeeper软件包。
2. 配置新节点的myid，ceph4 myid（4），ceph5 myid（5）
  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

3. 配置新节点的配置文件/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 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=*

4. 启动新节点zookeeper服务
  1 /opt/apache-zookeeper-3.6.3-bin-bcm/bin/zkServer.sh start

5. 查询新节点的zookeeper服务状态
  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
