我不能运行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
我的头孢会议:
[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/主机:
192.168.43.5 ceph-mon-1
但它没有用。我该怎么办?
您需要使用适当的版本逐步正确遵循 Ceph 文档。
检查是否有监视器进程 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