rabbitmq:在预检查阶段,检查每个rabbit主机名是否唯一地解析为正确的IP地址

kupeojn6  于 2022-11-08  发布在  RabbitMQ
关注(0)|答案(2)|浏览(287)

我尝试通过执行this link在运行CentOS 8.3.2011的虚拟机上部署OpenStack,但在运行该命令时,在预检查阶段出现错误:

kolla-ansible -i ./all-in-one prechecks

错误消息为:

TASK [rabbitmq : Check if each rabbit hostname resolves uniquely to the proper IP address]*****************************failed: [localhost] (item=[{'cmd': ['getent', 'ahostsv4', 'localhost'], 'stdout': '127.0.0.1       STREAM localhost\n127.0.0.1       DGRAM  \n127.0.0.1       RAW    \n127.0.0.1       STREAM \n127.0.0.1       DGRAM  \n127.0.0.1       RAW    \n192.168.56.103  STREAM \n192.168.56.103  DGRAM  \n192.168.56.103  RAW    ', 'stderr': '', 'rc': 0, 'start': '2021-05-28 07:48:12.453408', 'end': '2021-05-28 07:48:12.455955', 'delta': '0:00:00.002547', 'changed': False, 'invocation': {'module_args': {'_raw_params': 'getent ahostsv4 localhost', 'warn': True, '_uses_shell': False, 'stdin_add_newline': True, 'strip_empty_ends': True, 'argv': None, 'chdir': None, 'executable': None, 'creates': None, 'removes': None, 'stdin': None}}, 'stderr_lines': [], 'failed': False, 'item': 'localhost', 'ansible_loop_var': 'item'}, '127.0.0.1       STREAM localhost']) => {"ansible_loop_var": "item", "changed": false, "item": [{"ansible_loop_var": "item", "changed": false, "cmd": ["getent", "ahostsv4", "localhost"], "delta": "0:00:00.002547", "end": "2021-05-28 07:48:12.455955", "failed": false, "invocation": {"module_args": {"_raw_params": "getent ahostsv4 localhost", "_uses_shell": false, "argv": null, "chdir": null, "creates": null, "executable": null, "removes": null, "stdin": null, "stdin_add_newline": true, "strip_empty_ends": true, "warn": true}}, "item": "localhost", "rc": 0, "start": "2021-05-28 07:48:12.453408", "stderr": "", "stderr_lines": [], "stdout": "127.0.0.1       STREAM localhost\n127.0.0.1       DGRAM  \n127.0.0.1       RAW    \n127.0.0.1       STREAM \n127.0.0.1       DGRAM  \n127.0.0.1       RAW    \n192.168.56.103  STREAM \n192.168.56.103  DGRAM  \n192.168.56.103  RAW    "}, "127.0.0.1       STREAM localhost"], "msg": "Hostname has to resolve uniquely to the IP address of api_interface"}

我该如何解决这个问题?

c6ubokkw

c6ubokkw1#

我最近在我的控制节点中遇到了这个问题,在那里预检查结束时显示对我的计算节点的失败状态。我去看了它的/etc/hosts文件,其中有两个条目对应一个主机名(在我的例子中是ubuntu)。


# BEGIN ANSIBLE GENERATED HOSTS

192.168.3.133 ubuntu
192.168.3.137 ubuntu

# END ANSIBLE GENERATED HOSTS

我手动编辑了该文件,使其仅包含一个条目(主接口IP与用户名ubuntu)。


# BEGIN ANSIBLE GENERATED HOSTS

192.168.3.133 ubuntu

# END ANSIBLE GENERATED HOSTS

它工作正常,预检阶段成功。

ncecgwcz

ncecgwcz2#

编辑/etc/hosts文件。注解掉以上两行,并针对localhost的ip创建一个条目

[root@localhost ~]# cat /etc/hosts

# 127.0.0.1 localhost

# ::1       localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.122.73  localhost

[root@localhost ~]#

相关问题