問題說明
在部署open stack的NOVA組件時,注冊API端口到placement的service中,出現如下錯誤
1 [root@ct ~]# openstack endpoint create --region RegionOne placement public http://ct:8778
2 Failed to discover available identity versions when contacting http://ct:5000/v3. Attempti ng to parse version from URL.
3 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,查看報錯返回的地址
1 [root@ct ~]# curl http://ct:5000/v3
2 curl: (7) Failed connect to ct:5000; 拒絕連接
監聽5000端口,發現並沒有返回信息,原來是之前重啟ct導致apache沒有開啟(但我記得之前設置了開機自啟的)
1 [root@ct ~]# netstat -anpt | grep 5000
重啟apache服務即可解決
1 [root@ct ~]# systemctl start httpd 2 [root@ct ~]# systemctl status httpd 3 ● httpd.service - The Apache HTTP Server 4 Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) 5 Active: active (running) since 一 2020-12-28 14:55:25 CST; 2s ago 6 Docs: man:httpd(8) 7 man:apachectl(8) 8 Main PID: 5797 (httpd) 9 Status: "Processing requests..."
10 CGroup: /system.slice/httpd.service 11 ├─5797 /usr/sbin/httpd -DFOREGROUND 12 ├─5804 /usr/sbin/httpd -DFOREGROUND 13 ├─5805 /usr/sbin/httpd -DFOREGROUND 14 ├─5806 /usr/sbin/httpd -DFOREGROUND 15 ├─5807 (wsgi:keystone- -DFOREGROUND 16 ├─5808 (wsgi:keystone- -DFOREGROUND 17 ├─5809 (wsgi:keystone- -DFOREGROUND 18 ├─5810 (wsgi:keystone- -DFOREGROUND 19 ├─5811 (wsgi:keystone- -DFOREGROUND 20 ├─5812 /usr/sbin/httpd -DFOREGROUND 21 ├─5813 /usr/sbin/httpd -DFOREGROUND 22 ├─5814 /usr/sbin/httpd -DFOREGROUND 23 ├─5815 /usr/sbin/httpd -DFOREGROUND 24 └─5816 /usr/sbin/httpd -DFOREGROUND 25
26 12月 28 14:55:25 ct systemd[1]: Starting The Apache HTTP Server... 27 12月 28 14:55:25 ct systemd[1]: Started The Apache HTTP Server. 28 [root@ct ~]# curl http://ct:5000/v3
29 {"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"}]}}