首页 > 解决方案 > ceph orch host 添加主机问题 (env: centos8, ceph:12.2.5)

问题描述

信息:主机名:cat /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 172.16.49.41 ceph-gw-one 172.16.49.42 ceph-gw-two

shell: ceph orch host add 172.16.49.42

错误 EINVAL: 新主机 172.16.49.42 (172.16.49.42) 检查失败: ['INFO:cephadm:podman|docker (/bin/docker) is present', 'INFO:cephadm:systemctl is present', 'INFO:cephadm: lvcreate is present', 'INFO:cephadm:Unit chronyd.service is enabled and running', 'INFO:cephadm:Hostname "172.16.49.42" 与预期匹配。', 'ERROR: hostname "ceph-gw-two" 确实不匹配预期的主机名“172.16.49.42”']

shell: orch 主机添加 ceph-gw-two

错误 EINVAL:无法连接到 ceph-gw-two (ceph-gw-two)。检查主机是否可达并接受使用 cephadm SSH 密钥的连接

你可能想运行:

ceph cephadm get-ssh-config > ssh_config ceph config-key get mgr/cephadm/ssh_identity_key > key ssh -F ssh_config -i key root@ceph-gw-two

我已经通过 ip 或主机名检查了 ssh 登录是否成功;

标签: cephcentos8

解决方案


我看了adm源码脚本:</p>

 out, err, code = self._run_cephadm(spec.hostname, cephadmNoImage, 'check-host',
                                       ['--expect-hostname', spec.hostname],
                                       addr=spec.addr,
                                       error_ok=True, no_fsid=True)
    if code:
        raise OrchestratorError('New host %s (%s) failed check: %s' % (
            spec.hostname, spec.addr, err))

所以,我将 cmd 更改为:

ceph orch 主机添加 ceph-gw-two 172.16.49.42;

完成,效果很好;


推荐阅读