无法在 Ubuntu 中向 Ceph 添加初始监视器

无法在 Ubuntu 中向 Ceph 添加初始监视器

我正在尝试设置 Ceph 集群。我有 4 个节点 - 1 个管理节点、1 个监视器和 2 个对象存储设备。我使用的安装指南位于以下位置:http://ceph.com/docs/master/start/quick-ceph-deploy/

当我尝试添加初始监视器(指南中的第 5 步)时,出现以下错误:

[ceph_deploy.conf][DEBUG ] found configuration file at: /home/cloud-user/.cephdeploy.conf
[ceph_deploy.cli][INFO  ] Invoked (1.5.21): /usr/bin/ceph-deploy mon create-initial
[ceph_deploy.mon][DEBUG ] Deploying mon, cluster ceph hosts worker-1-full
[ceph_deploy.mon][DEBUG ] detecting platform for host worker-1-full ...
[worker-1-full][DEBUG ] connection detected need for sudo
[worker-1-full][DEBUG ] connected to host: worker-1-full 
[worker-1-full][DEBUG ] detect platform information from remote host
[worker-1-full][DEBUG ] detect machine type
[ceph_deploy.mon][INFO  ] distro info: Ubuntu 14.04 trusty
[worker-1-full][DEBUG ] determining if provided host has same hostname in remote
[worker-1-full][DEBUG ] get remote short hostname
[worker-1-full][DEBUG ] deploying mon to worker-1-full
[worker-1-full][DEBUG ] get remote short hostname
[worker-1-full][DEBUG ] remote hostname: worker-1-full
[worker-1-full][DEBUG ] write cluster configuration to /etc/ceph/{cluster}.conf
[worker-1-full][DEBUG ] create the mon path if it does not exist
[worker-1-full][DEBUG ] checking for done path: /var/lib/ceph/mon/ceph-worker-1-full/done
[worker-1-full][DEBUG ] create a done file to avoid re-doing the mon deployment
[worker-1-full][DEBUG ] create the init path if it does not exist
[worker-1-full][DEBUG ] locating the `service` executable...
[worker-1-full][INFO  ] Running command: sudo initctl emit ceph-mon cluster=ceph id=worker-1-full
[worker-1-full][INFO  ] Running command: sudo ceph --cluster=ceph --admin-daemon /var/run/ceph/ceph-mon.worker-1-full.asok mon_status
[worker-1-full][ERROR ] admin_socket: exception getting command descriptions: [Errno 2] No such file or directory
[worker-1-full][WARNIN] monitor: mon.worker-1-full, might not be running yet
[worker-1-full][INFO  ] Running command: sudo ceph --cluster=ceph --admin-daemon /var/run/ceph/ceph-mon.worker-1-full.asok mon_status
[worker-1-full][ERROR ] admin_socket: exception getting command descriptions: [Errno 2] No such file or directory
[worker-1-full][WARNIN] monitor worker-1-full does not exist in monmap
[worker-1-full][WARNIN] neither `public_addr` nor `public_network` keys are defined for monitors
[worker-1-full][WARNIN] monitors may not be able to form quorum
[ceph_deploy.mon][INFO  ] processing monitor mon.worker-1-full
[worker-1-full][DEBUG ] connection detected need for sudo
[worker-1-full][DEBUG ] connected to host: worker-1-full 
[worker-1-full][INFO  ] Running command: sudo ceph --cluster=ceph --admin-daemon /var/run/ceph/ceph-mon.worker-1-full.asok mon_status
[worker-1-full][ERROR ] admin_socket: exception getting command descriptions: [Errno 2] No such file or directory
[ceph_deploy.mon][WARNIN] mon.worker-1-full monitor is not yet in quorum, tries left: 5
[ceph_deploy.mon][WARNIN] waiting 5 seconds before retrying
[worker-1-full][INFO  ] Running command: sudo ceph --cluster=ceph --admin-daemon /var/run/ceph/ceph-mon.worker-1-full.asok mon_status
[worker-1-full][ERROR ] admin_socket: exception getting command descriptions: [Errno 2] No such file or directory
[ceph_deploy.mon][WARNIN] mon.worker-1-full monitor is not yet in quorum, tries left: 4
[ceph_deploy.mon][WARNIN] waiting 10 seconds before retrying
[worker-1-full][INFO  ] Running command: sudo ceph --cluster=ceph --admin-daemon /var/run/ceph/ceph-mon.worker-1-full.asok mon_status
[worker-1-full][ERROR ] admin_socket: exception getting command descriptions: [Errno 2] No such file or directory
[ceph_deploy.mon][WARNIN] mon.worker-1-full monitor is not yet in quorum, tries left: 3
[ceph_deploy.mon][WARNIN] waiting 10 seconds before retrying
[worker-1-full][INFO  ] Running command: sudo ceph --cluster=ceph --admin-daemon /var/run/ceph/ceph-mon.worker-1-full.asok mon_status
[worker-1-full][ERROR ] admin_socket: exception getting command descriptions: [Errno 2] No such file or directory
[ceph_deploy.mon][WARNIN] mon.worker-1-full monitor is not yet in quorum, tries left: 2
[ceph_deploy.mon][WARNIN] waiting 15 seconds before retrying
[worker-1-full][INFO  ] Running command: sudo ceph --cluster=ceph --admin-daemon /var/run/ceph/ceph-mon.worker-1-full.asok mon_status
[worker-1-full][ERROR ] admin_socket: exception getting command descriptions: [Errno 2] No such file or directory
[ceph_deploy.mon][WARNIN] mon.worker-1-full monitor is not yet in quorum, tries left: 1
[ceph_deploy.mon][WARNIN] waiting 20 seconds before retrying
[ceph_deploy.mon][ERROR ] Some monitors have still not reached quorum:
[ceph_deploy.mon][ERROR ] worker-1-full

“worker-1-full” 是我尝试设置为监视器的节点。我使用的命令是:

“ceph-deploy mon create-initial”。请帮忙。提前致谢!

答案1

我遇到了同样的错误,通过添加其他 ceph 节点解决了该问题主机名和 IpAdrress 并添加“public_network =”

我调整过的部分ceph.conf是:

mon_initial_members =
mon_host =
public_network =

猫/etc/ceph/ceph.conf

[global]
fsid = 33cb5c76-a685-469e-8cdd-fee7c98c3f4d
mon_initial_members = ceph1,ceph2
mon_host = 192.168.61.39,192.168.61.40
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
filestore_xattr_use_omap = true
public_network = 192.168.61.0/24

并运行命令:

$ ceph-deploy --overwrite-conf mon create <ceph-node>

答案2

看来您的节点名称与其实际主机名不同,因此该文件/var/run/ceph/ceph-mon.worker-1-full.asok的名称不正确。我已更改主机名,这对我有用。

答案3

/var/run/ceph 目录是否存在?如果不存在,Ceph 可能无法创建 .asok(管理套接字)文件。

答案4

就我而言,这是由于前一个命令失败引起的,脚本没有检测到该命令:

# ceph-deploy mon create-initial
...
[ceph-server-1][DEBUG ] create the init path if it does not exist
[ceph-server-1][INFO  ] Running command: systemctl enable ceph.target
[ceph-server-1][INFO  ] Running command: systemctl enable ceph-mon@ceph-server-1
[ceph-server-1][INFO  ] Running command: systemctl start ceph-mon@ceph-server-1
[ceph-server-1][INFO  ] Running command: ceph --cluster=ceph --admin-daemon /var/run/ceph/ceph-mon.ceph-server-1.asok mon_status
[ceph-server-1][ERROR ] admin_socket: exception getting command descriptions: [Errno 2] No such file or directory

journalctl -xe发现:

Jul 05 12:12:29 ceph-server-1.novalocal ceph-mon[27403]: 2019-07-05 12:12:29.389 7f7b5aed7180 -1 rocksdb: IO error: while open a file for lock: /var/lib/ceph/mon/ceph-ceph-server-1/store.db/LOCK: Permission denied

解决:

# chown -R ceph:ceph /var/lib/ceph/mon/ceph-ceph-server-1/store.db/
# chown    ceph:ceph /var/lib/ceph/mon/ceph-ceph-server-1/keyring

现在我有一个快乐的 Ceph。

相关内容