3

I can not run ceph -s when I run ceph -s,the error display:

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

my 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

my /etc/hosts:

192.168.43.5 ceph-mon-1

But it didn't work. What should I do?

yanzhiluo
  • 133
  • 1
  • 1
  • 5
  • which method are you using for deployment? If your using ceph-deploy method - did you try 'ceph-deploy mon create-initial' then copy over the all the required keys to '/etc/ceph/' folder. after initialising you should change file permissions to 'chmod +r or 644' in /etc/ceph/ceph.* then try 'ceph -s' – Shaze Feb 21 '19 at 13:43

1 Answers1

0

You will need to follow Ceph documentation properly step-by-step with appropriate version.

Check to see if there's monitor process pid running - $ ps -ef | grep ceph

You should see something like this -

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

If you see something similar output above that means your binary is running, you will need to check if you have tried to create a cluster ceph-mon-1 & then initialise it?

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

Example (/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

After initialising you will see generated keyrings on your current working directory, copy them over to /etc/ceph/ folder.

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

then run -

$ ceph -s
Shaze
  • 792
  • 1
  • 9
  • 14