MIGRATE OPENSTACK KEYSTONE TO A DIFFERENT IP ADDRESS

本文介绍如何在OpenStack Keystone中更改服务端点的IP地址。当主机IP地址发生变化时,需要手动更新数据库中的端点URL。文章还提供了具体的MySQL操作步骤及配置文件修改指南。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://manku.thimma.org/2013/09/migrate-openstack-keystone-to-a-different-ip-address/

MIGRATE OPENSTACK KEYSTONE TO A DIFFERENT IP ADDRESS
SEPTEMBER 20, 2013 SHASHI     LEAVE A COMMENT
This hack describes how to change openstack service end-points after there is a change in the host IP address.

When you initially install and provision OpenStack, Keystone (the identity service) creates a set of end-points for all the services. You can get the list of service end-points by typing

# keystone endpoint-list

Particularly of interest are the “publicurl”s. A typical publicurl of a service end-point would look like

http://10.0.0.25:8774/v2/$(tenant_id)s


If the IP address of the host changes, the end-points aren’t migrated automatically. This may cause quite a lot of dependent services to stop working.

One such service is “Horizon” which is the web interface and dashboard for OpenStack. Once the IP address is changed, you won’t be able to login to the admin dashboard as well.

To fix this, the service end-points needs to be updated. Unfortunately, the keystone tool supports only creation of end-points at this time. You’ll have to manually update the end-point URLs in the database.

In this example, I’m using mysql as the database and I have changed the host IP from 10.0.0.25 to 10.0.0.100.

Login to mysql (probably as root), select the keystone database and query the URLs.

# mysql -u root -p keystone
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
...
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select id, url from endpoint where interface='public';
+----------------------------------+--------------------------------------------+
| id | url |
+----------------------------------+--------------------------------------------+
| 384ee4e74ad19a71bc56bff55e18e25c | http://10.0.0.25:8774/v2/$(tenant_id)s |
| 675affbfacf34c0899a994d72eea7d57 | http://10.0.0.25:9292/v2 |
| 34818b5b99394e4d9894e932403696cf | http://10.0.0.25:9696/ |
| 8b363857ce294150567571dfc476a83 | http://10.0.0.25:8776/v1/$(tenant_id)s |
| b4041634dc614f8876baa119769e784e | http://10.0.0.25:5000/v2.0 |
| c6edf51290e34b84995bccacbc2a2454 | http://10.0.0.25:8773/services/Cloud |
+----------------------------------+--------------------------------------------+
6 rows in set (0.00 sec)

Now that we know what to change, update the URLs (as suggested below)

mysql> update endpoint set url='http://10.0.0.100:8773/services/Cloud' where id='c6edf51290e34b84995bccacbc2a2454';

Now doing a keystone endpoint-list should show your new URL.

To change the IP address in the configurations do the following;

# cd /etc/
# find {keystone,nova,cinder,quantum,glance} -type f -exec grep -nH 10.0.0.25 {} \;
# find {keystone,nova,cinder,quantum,glance} -type f -exec sed -i s/10.0.0.25/10.0.0.100/g {} \;

Restart apache2, memcached and try logging into Horizon.
Of course, YMMV!


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值