问题
在部署open stack的NOVA组件时,注册API端口到placement的service中,出现如下错误
[root@ct ~]# openstack endpoint create --region RegionOne placement public http://ct:8778
Failed to discover available identity versions when contacting http://ct:5000/v3. Attempti ng to parse version from URL.
Unable to establish connection to http://ct:5000/v3/auth/tokens: HTTPConnectionPool(host=' ct', port=5000): Max retries exceeded with url: /v3/auth/tokens (Caused by NewConnectionEr ror('<urllib3.connection.HTTPConnection object at 0x7fa784987c10>: Failed to establish a n ew connection: [Errno 111] \xe6\x8b\x92\xe7\xbb\x9d\xe8\xbf\x9e\xe6\x8e\xa5',))
解决方案
使用curl,查看报错返回的地址
[root@ct ~]# curl http://ct:5000/v3
curl: (7) Failed connect to ct:5000; 拒绝连接
监听5000端口,发现并没有返回信息,原来是之前重启ct导致apache没有开启(但我记得之前设置了开机自启的)
[root@ct ~]# netstat -anpt | grep 5000
重启apache服务即可解决
[root@ct ~]# systemctl start httpd
[root@ct ~]# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since 一 2020-12-28 14:55:25 CST; 2s ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 5797 (httpd)
Status: "Processing requests..."
CGroup: /system.slice/httpd.service
├─5797 /usr/sbin/httpd -DFOREGROUND
├─5804 /usr/sbin/httpd -DFOREGROUND
├─5805 /usr/sbin/httpd -DFOREGROUND
├─5806 /usr/sbin/httpd -DFOREGROUND
├─5807 (wsgi:keystone- -DFOREGROUND
├─5808 (wsgi:keystone- -DFOREGROUND
├─5809 (wsgi:keystone- -DFOREGROUND
├─5810 (wsgi:keystone- -DFOREGROUND
├─5811 (wsgi:keystone- -DFOREGROUND
├─5812 /usr/sbin/httpd -DFOREGROUND
├─5813 /usr/sbin/httpd -DFOREGROUND
├─5814 /usr/sbin/httpd -DFOREGROUND
├─5815 /usr/sbin/httpd -DFOREGROUND
└─5816 /usr/sbin/httpd -DFOREGROUND
12月 28 14:55:25 ct systemd[1]: Starting The Apache HTTP Server...
12月 28 14:55:25 ct systemd[1]: Started The Apache HTTP Server.
[root@ct ~]# curl http://ct:5000/v3
{"version": {"status": "stable", "updated": "2019-07-19T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.13", "links": [{"href": "http://ct:5000/v3/", "rel": "self"}]}}