2

I have built the ceph source code and make it installed with the following commands:

apt-get install a series of dependency packages
./autogen.sh
./configure
make
make install

All these processes went well. When I type:

which ceph

Console shows:

/usr/local/bin/ceph

So I think I have install ceph successfully. But when I try to start the ceph-mon daemon, console tells me:

start: unknown job: ceph-mon

And I have checked my service list by typing:

initctl list | grep ceph

And the output is blank.

Somebody could tell me why?

reto
  • 9,995
  • 5
  • 53
  • 52
Yoyoslx
  • 33
  • 1
  • 3

3 Answers3

1

can you run cepn-mon -i <your-mon-id>, I solve this by :

(I am at the same situation as yours, I am based on firefly & I compile & make install from the cource code.)

#!/bin/bash                                                                     
fsid=`uuidgen`                                                                  
host="your-mon-host"                                                                  
ipaddr="your-mon-ip-addr"                                                              

echo "[global]" > ./ceph.sample.conf                                            
echo "fsid = ${fsid}" >> ./ceph.sample.conf                                     
echo "mon initial members=${host}" >> ./ceph.sample.conf                        
echo "mon host = ${ipaddr}" >> ./ceph.sample.conf                               
cat ./popular_settings.txt >> ./ceph.sample.conf                                
cp ./ceph.sample.conf /etc/ceph/ceph.conf                                       

rm -rf /var/lib/ceph/mon/ceph-${host}/done                                      

sudo ceph-authtool --create-keyring /var/lib/ceph/tmp/ceph-${host}.mon.keyring --gen-key -n mon. --cap mon 'allow *'
sudo ceph-authtool --create-keyring /etc/ceph/ceph.client.admin.keyring --gen-key -n client.admin --set-uid=0 --cap mon 'allow *' --cap osd 'a    llow *' --cap mds 'allow'

sudo chmod +r /var/lib/ceph/tmp/ceph-${host}.mon.keyring                        
sudo chmod +r /etc/ceph/ceph.client.admin.keyring                               

sudo ceph-authtool /var/lib/ceph/tmp/ceph-${host}.mon.keyring --import-keyring /etc/ceph/ceph.client.admin.keyring


monmaptool --create --add ${host} ${ipaddr} --fsid ${fsid} /tmp/monmap --clobber


#rm -rf /var/lib/ceph/mon/ceph-${host}                                          
sudo ceph-mon --mkfs -i ${host} --monmap /tmp/monmap --keyring /var/lib/ceph/tmp/ceph-${host}.mon.keyring 

touch /var/lib/ceph/mon/ceph-${host}/done                                       
touch /var/lib/ceph/mon/ceph-${host}/upstart  
ps aux | grep "ceph-mon"    #there should be no ceph-mon                                  
ceph-mon -i ${host} 
ps aux | grep "ceph-mon"    #there we've got a ceph-mon running                           

ceph osd tree
  • In my case, manual deployment with the make, it creates and runs the mon but still the "ceph osd tree" doesn't return any output! At the end of this step, I expect to have ceph id on hard disks (the output of "lsblk" would disply that) but I don't! Any ideas? – Fatemeh khodaparast Oct 06 '20 at 14:26
0

You can try to touch the file sysvinit. For example, assume the host name of monitor node is node1 and the cluster name is by default, use this command touch /var/lib/ceph/mon/ceph-node1/sysvinit before starting the monitor process. This solve my problem when getting the unknown error.

user1802604
  • 396
  • 3
  • 14
0

The make install target of Ceph does not install the upstart script. The best option is to install packages with apt-get install ceph. If you need to run from modified sources, you can with ceph-mon -i a, assuming the monitor data already exists.

Loic Dachary
  • 1,034
  • 1
  • 10
  • 24