无法从DNS SRV获取服务名称为ceph-mon的监视信息

时间:2018-08-22 09:01:07

标签: ceph

我无法运行ceph -s 当我运行ceph -s时,错误显示:

root@ceph-mon-1:~# ceph -s
unable to get monitor info from DNS SRV with service name: ceph-mon no monitors specified to connect to.
7ff69982e700 -1 failed for service _ceph-mon-1._tcp
7ff69982e700 -1 monclient: get_monmap_and_config cannot identify monitors to contact
[errno 2] error connecting to the cluster

我的ceph.conf:

[global]
fsid = c9932f0b-b0cb-423c-a331-7f9ef8a5f4a7
public network = 192.168.222.0/24
cluster network = 192.168.43.0/24
auth cluster required = cephx
auth service required = cephx
auth client required = cephx
osd journal size = 1024
osd pool default size = 3
osd pool default min size = 2
log file = /tmp/$cluster-$name.log
mon dns srv name = ceph-mon-1

[mon]
mon host = ceph-mon-1
mon initial members = ceph-mon-1
mon data = /mon-data/mon/$cluster-$id

我的/ etc / hosts:

192.168.43.5 ceph-mon-1

但是没有用。我该怎么办?

1 个答案:

答案 0 :(得分:0)

您将需要逐步正确遵循Ceph documentation并使用适当的版本。

检查是否正在运行监视器进程pid- $ ps -ef | grep ceph

您应该看到类似这样的内容-

ceph 564589 1 0 Feb19 ? 00:26:47 /usr/bin/ceph-mon -f --cluster ceph --id ceph-mon-1 --setuser ceph --setgroup ceph

如果您在上面看到类似的输出,则表明您的二进制文件正在运行,您将需要检查是否尝试创建集群ceph-mon-1并对其进行初始化?

$ ceph-deploy new ceph-mon-1
$ ceph-deploy mon create-initial
$ ceph-deploy admin ceph-mon-1

示例/etc/ceph/ceph.conf):

[global]
fsid = 04fa0f1d-1889-4474-aeb8-d3237ea2cdd1
mon_initial_members = ceph-mon-1
mon_host = 10.10.10.1
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx


$ ls -lha
-rw-r--r--  1 root root 159K Feb 15 13:41 ceph-deploy-ceph.log
-rw-r--r--  1 root root  113 Feb 19 15:26 ceph.bootstrap-mds.keyring
-rw-r--r--  1 root root  113 Feb 19 15:26 ceph.bootstrap-mgr.keyring
-rw-r--r--  1 root root  113 Feb 19 15:26 ceph.bootstrap-osd.keyring
-rw-r--r--  1 root root  113 Feb 19 15:26 ceph.bootstrap-rgw.keyring
-rw-r--r--  1 root root  151 Feb 19 15:26 ceph.client.admin.keyring
-rw-rw-r--  1 root root  218 Feb 19 15:26 ceph.conf
-rw-r--r--  1 root root   73 Feb 19 15:26 ceph.mon.keyring

初始化后,您将在当前工作目录中看到生成的密钥环,将其复制到/etc/ceph/文件夹中。

$ sudo cp -vf ceph.* /etc/ceph/

然后运行-

$ ceph -s