Failed to contact the endpoint at http://controller:9292 for discovery. Fallback

72 阅读1分钟

在使用openstack执行openstack image list时报错,如下是完整的错误消息: [root@controller ~]# openstack image list Failed to contact the endpoint at http://controller:9292 for discovery. Fallback to using that endpoint as the base url. Failed to contact the endpoint at http://controller:9292 for discovery. Fallback to using that endpoint as the base url. The image service for : exists but does not have any supported versions.

排查: 1.执行 net-state -ntlp 或 netstat -antp命令。在列表中找到9292端口的记录行,查看9292端口所监听的ip,例如下图

# net-state -ntlp
tcp        0      0 0.0.0.0:9292          0.0.0.0:*               LISTEN      292411/python3

问题在于 glance 配置为侦听所有接口,而不仅仅是绑定到环回接口。 使 glance-api 服务侦听环回接口 (127.0.0.1)。明确地,必须适当地设置bind_host。 步骤1: 打开文件 /etc/glance /glance-api.conf

# vim /etc/glance/glance-api.conf

步骤2: 搜索以下行

bind_host = 0.0.0.0

步骤3: 替换为

bind_host = 127.0.0.1

步骤4: 重新启动 glance 服务

# systemctl restart openstack-glance-api

步骤5: 现在,服务应侦听环回 IP,如下所示:

# net-state -ntlp
tcp        0      0 127.0.0.1:9292          0.0.0.0:*               LISTEN 

温馨提示: 如果改完后依旧报该错误,可以尝试把bind_host更改为具体的ip,如192.168.xxx.xxx,然后重启 glance 服务后在试。

bind_host = 192.168.xxx.xxx

参考:[OpenStack Glance]: Failed to contact the endpoint at https://localhost:9292 for discovery. - Techglimpse