技术流ken

运维拯救世界

ceph创建监视器报错解决方案–技术流ken

 

 

报错问题

 

在创建ceph集群中的监视器的时候报如下的错误

[root@ken ceph]# ceph-deploy mon create-initial

 

[ceph_deploy.mon][DEBUG ] detecting platform for host ken2 …
[ken2][DEBUG ] connected to host: ken2
[ken2][DEBUG ] detect platform information from remote host
[ken2][DEBUG ] detect machine type
[ken2][DEBUG ] find the location of an executable
[ceph_deploy.mon][INFO ] distro info: CentOS Linux 7.5.1804 Core
[ken2][DEBUG ] determining if provided host has same hostname in remote
[ken2][DEBUG ] get remote short hostname
[ken2][DEBUG ] deploying mon to ken2
[ken2][DEBUG ] get remote short hostname
[ken2][DEBUG ] remote hostname: ken2
[ken2][DEBUG ] write cluster configuration to /etc/ceph/{cluster}.conf
[ken2][DEBUG ] create the mon path if it does not exist
[ken2][DEBUG ] checking for done path: /var/lib/ceph/mon/ceph-ken2/done
[ken2][DEBUG ] create a done file to avoid re-doing the mon deployment
[ken2][DEBUG ] create the init path if it does not exist
[ken2][INFO ] Running command: systemctl enable ceph.target
[ken2][INFO ] Running command: systemctl enable ceph-mon@ken2
[ken2][INFO ] Running command: systemctl start ceph-mon@ken2
[ken2][INFO ] Running command: ceph –cluster=ceph –admin-daemon /var/run/ceph/ceph-mon.ken2.asok mon_status
[ken2][ERROR ] admin_socket: exception getting command descriptions: [Errno 2] No such file or directory
[ken2][WARNIN] monitor: mon.ken2, might not be running yet
[ken2][INFO ] Running command: ceph –cluster=ceph –admin-daemon /var/run/ceph/ceph-mon.ken2.asok mon_status
[ken2][ERROR ] admin_socket: exception getting command descriptions: [Errno 2] No such file or directory
[ken2][WARNIN] monitor ken2 does not exist in monmap
[ceph_deploy.mon][INFO ] processing monitor mon.ken
[ken][DEBUG ] connected to host: ken
[ken][DEBUG ] detect platform information from remote host
[ken][DEBUG ] detect machine type
[ken][DEBUG ] find the location of an executable
[ken][INFO ] Running command: ceph –cluster=ceph –admin-daemon /var/run/ceph/ceph-mon.ken.asok mon_status
[ken][ERROR ] admin_socket: exception getting command descriptions: [Errno 2] No such file or directory
[ceph_deploy.mon][WARNIN] mon.ken monitor is not yet in quorum, tries left: 5
[ceph_deploy.mon][WARNIN] waiting 5 seconds before retrying
^C[ceph_deploy][ERROR ] KeyboardInterrupt

 

 

解决方案:

是因为在该文件中一开始写的用户是ceph,但是接下的配置都是使用root用户配置的,所以这里修改为root用户清空配置即可

ceph-deploy purge ken ken1 ken2
ceph-deploy purgedata ken ken1 ken2
ceph-deploy forgetkeys
rm -rf ceph*

 

 

2:报如下的错误

[root@ken ceph]# ceph-deploy mon create-initial
[ceph_deploy.conf][DEBUG ] found configuration file at: /root/.cephdeploy.conf
[ceph_deploy.cli][INFO ] Invoked (1.5.38): /usr/bin/ceph-deploy mon create-initial
[ceph_deploy.cli][INFO ] ceph-deploy options:
[ceph_deploy.cli][INFO ] username : None
[ceph_deploy.cli][INFO ] verbose : False
[ceph_deploy.cli][INFO ] overwrite_conf : False
[ceph_deploy.cli][INFO ] subcommand : create-initial
[ceph_deploy.cli][INFO ] quiet : False
[ceph_deploy.cli][INFO ] cd_conf : <ceph_deploy.conf.cephdeploy.Conf instance at 0x7f9db16f31b8>
[ceph_deploy.cli][INFO ] cluster : ceph
[ceph_deploy.cli][INFO ] func : <function mon at 0x7f9db16ce758>
[ceph_deploy.cli][INFO ] ceph_conf : None
[ceph_deploy.cli][INFO ] default_release : False
[ceph_deploy.cli][INFO ] keyrings : None
[ceph_deploy.mon][DEBUG ] Deploying mon, cluster ceph hosts ken ken1 ken2
[ceph_deploy.mon][DEBUG ] detecting platform for host ken …
[ken][DEBUG ] connected to host: ken
[ken][DEBUG ] detect platform information from remote host
[ken][DEBUG ] detect machine type
[ken][DEBUG ] find the location of an executable
[ceph_deploy.mon][INFO ] distro info: CentOS Linux 7.5.1804 Core
[ken][DEBUG ] determining if provided host has same hostname in remote
[ken][DEBUG ] get remote short hostname
[ken][DEBUG ] deploying mon to ken
[ken][DEBUG ] get remote short hostname
[ken][DEBUG ] remote hostname: ken
[ken][DEBUG ] write cluster configuration to /etc/ceph/{cluster}.conf
[ceph_deploy.mon][ERROR ] RuntimeError: config file /etc/ceph/ceph.conf exists with different content; use –overwrite-conf to overwrite
[ceph_deploy.mon][DEBUG ] detecting platform for host ken1 …
[ken1][DEBUG ] connected to host: ken1
[ken1][DEBUG ] detect platform information from remote host
[ken1][DEBUG ] detect machine type
[ken1][DEBUG ] find the location of an executable
[ceph_deploy.mon][INFO ] distro info: CentOS Linux 7.5.1804 Core
[ken1][DEBUG ] determining if provided host has same hostname in remote
[ken1][DEBUG ] get remote short hostname
[ken1][DEBUG ] deploying mon to ken1
[ken1][DEBUG ] get remote short hostname
[ken1][DEBUG ] remote hostname: ken1
[ken1][DEBUG ] write cluster configuration to /etc/ceph/{cluster}.conf
[ceph_deploy.mon][ERROR ] RuntimeError: config file /etc/ceph/ceph.conf exists with different content; use –overwrite-conf to overwrite
[ceph_deploy.mon][DEBUG ] detecting platform for host ken2 …
[ken2][DEBUG ] connected to host: ken2
[ken2][DEBUG ] detect platform information from remote host
[ken2][DEBUG ] detect machine type
[ken2][DEBUG ] find the location of an executable
[ceph_deploy.mon][INFO ] distro info: CentOS Linux 7.5.1804 Core
[ken2][DEBUG ] determining if provided host has same hostname in remote
[ken2][DEBUG ] get remote short hostname
[ken2][DEBUG ] deploying mon to ken2
[ken2][DEBUG ] get remote short hostname
[ken2][DEBUG ] remote hostname: ken2
[ken2][DEBUG ] write cluster configuration to /etc/ceph/{cluster}.conf
[ceph_deploy.mon][ERROR ] RuntimeError: config file /etc/ceph/ceph.conf exists with different content; use –overwrite-conf to overwrite
[ceph_deploy][ERROR ] GenericError: Failed to create 3 monitors

 

解决方法:

[root@ken ceph]# ceph-deploy –overwrite-conf config push ken ken1 ken2

 

 

 

 

###################################################

重启系统之后需要检查几步才能确保ceph集群正常运行

  1. 检查各个节点的时间是否一致
  2. 检查各个节点的ceph目录是否挂载
  3. 需要执行如下的命令来激活ceph集群
ceph-deploy  osd activate ken1:/data ken2:/data ken3:/data

注意:上面的命令需要在之前创建的ceph工作目录之下执行

发表评论

电子邮件地址不会被公开。