首先搭建兩套一樣的OpenStack環境
更改前:
node1: 192.168.200.100 RegionOne
node2: 192.168.200.200 RegionOne
預期結果:
node1: 192.168.200.100 RegionOne keystone(共用)
node2: 192.168.200.200 RegionTwo
一、更改 node2 元件配置檔案
[keystone_authtoken] auth_uri = http://192.168.200.200:5000 auth_url = http://192.168.200.200:35357 auth_type = password project_domain_id = default user_domain_id = default project_name = service username = neutron password = openstack memcache_security_strategy = ENCRYPT memcache_secret_key = LSX38kDupTueYjpIjB03zXjhpuWgGU2SdvwkfpMN memcached_servers = 10.95.42.23:11211 os_region_name = RegionOne
2. 元件配置檔案os_region_name原先是RegionOne全部改成RegionTwo1. 元件配置檔案5000和35357對應的IP全部改成node1的keystone IP
二、更改 node2 keystone資料庫
1.匯出資料庫:
mysqldump -ukeystone -pkeystone keystone > keystone.sql
2.把keystone.sql檔案中所有的RegionOne改成RegionTwo
3.把修改後的keystone.sql檔案匯入資料庫:
mysql -ukeystone -pkeystone keystone < keystone.sql
三、node1 建立 node2 所有元件 endpoint
1.建立RegionTwo認證
keystone-manage bootstrap --bootstrap-password openstack \
--bootstrap-admin-url http://192.168.200.100:35357/v3/ \
--bootstrap-internal-url http://192.168.200.100r:5000/v3/ \
--bootstrap-public-url http://192.168.200.100:5000/v3/ \
--bootstrap-region-id RegionTwo
2.建立 node2 元件 endpoint
glance:
openstack endpoint create --region RegionTwo image public http://192.168.200.200:9292
openstack endpoint create --region RegionTwo image internal http://192.168.200.200:9292
openstack endpoint create --region RegionTwo image admin http://192.168.200.200:9292
neutron:
openstack endpoint create --region RegionTwo network public http://192.168.200.200:9696
openstack endpoint create --region RegionTwo network internal http://192.168.200.200:9696
openstack endpoint create --region RegionTwo network admin http://192.168.200.200:9696