keystone-manage bootstrap设置错误后,如何修改各URL

重新温故openstack,时偷懒直接照着文档操作,结果忘了修改里面的hostname

keystone-manage bootstrap --bootstrap-password 000000 \
--bootstrap-admin-url http://controller:5000/v3/ \
--bootstrap-internal-url http://controller:5000/v3/ \
--bootstrap-public-url http://controller:5000/v3/ \
--bootstrap-region-id RegionOne

我的hostname是cloud,之后的命令就一直会报错了

[root@cloud ~]# openstack user list

Unable to establish connection to http://controller:5000/v3/users?: HTTPConnectionPool(host='controller', port=5000): Max retries exceeded with url: /v3/users (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fb3e5ae5050>: Failed to establish a new connection: [Errno -2] Name or service not known',))

重新执行一遍修改为cloud也没有用
google了很多也找不到一个可行的方法
最后灵机一动,直接去修改keystone数据库
果然,直接连上mysql db 后use keystone database
表对应的endpoint, 可以select看一下
直接一句SQL更新即可

update endpoint set url="http://cloud:5000/v3/";
[root@cloud etc]# openstack user list                    
+----------------------------------+-------+
| ID                               | Name  |
+----------------------------------+-------+
| 08cd9f1addd04fafb82550336e50dfba | admin |
+----------------------------------+-------+
[root@cloud etc]#