[关闭]
@dyj2017 2017-10-19T15:21:18.000000Z 字数 1319 阅读 7773

ceph-deploy add mon失败

ceph-deploy 运维


问题描述:

现有集群只有一个mon,需要通过ceph-deploy mon add添加两个mon。在admin节点执行命令:

  1. # ceph-deploy mon add node2

提示如下error:

  1. [node2][ERROR ] admin_socket: exception getting command descriptions: [Errno 2] No such file or directory
  2. [node2][WARNIN] node2 is not defined in `mon initial members`
  3. [node2][WARNIN] monitor node2 does not exist in monmap
  4. [node2][WARNIN] neither `public_addr` nor `public_network` keys are defined for monitors
  5. [node2][WARNIN] monitors may not be able to form quorum
  6. [node2][INFO ] Running command: sudo ceph --cluster=ceph --admin-daemon /var/run/ceph/ceph-mon.node2.asok mon_status

解决方法:

通过上面日志可知ceph.conf配置文件中缺少public network的配置,在admin节点中,my-cluster目录下的ceph.conf的[global]下添加对应的网址:

  1. [global]
  2. fsid = b8b4aa68-d825-43e9-a60a-781c92fec20e
  3. mon_initial_members = node1
  4. mon_host = 192.168.197.154
  5. auth_cluster_required = cephx
  6. auth_service_required = cephx
  7. auth_client_required = cephx
  8. public network =192.168.197.0/24

之后通过执行下面的命令把修改推送至每个节点,否则提示error:

  1. # ceph-deploy --overwrite-conf config push node1 node2 node3

执行命令为cluster添加mon:

  1. # ceph-deploy mon add node2
  2. # ceph-deploy mon add node3

通过ceph -s查看集群状态:

  1. # ceph -s
  2. cluster:
  3. id: b8b4aa68-d825-43e9-a60a-781c92fec20e
  4. health: HEALTH_WARN
  5. clock skew detected on mon.node2, mon.node3
  6. services:
  7. mon: 3 daemons, quorum node1,node2,node3
  8. mgr: node1(active)
  9. osd: 6 osds: 6 up, 6 in
  10. data:
  11. pools: 0 pools, 0 pgs
  12. objects: 0 objects, 0 bytes
  13. usage: 6346 MB used, 55093 MB / 61440 MB avail
  14. pgs:

可以看到成功添加了两个mon:node2 node3。

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注