无法从DNS SRV获取具有服务名称的监视器信息:ceph-mon

问题描述 投票:1回答:1

当我运行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

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

ceph
1个回答
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
© www.soinside.com 2019 - 2024. All rights reserved.