팩스택 IP 변경

1 개요[ | ]

팩스택 IP 변경
  • 팩스택 설치 이후 IP를 변경하는 경우

2 br-ex 변경·적용[ | ]

  • ※ 주의. 네트워크 재시작시 접속이 끊어질 수 있음
[root@controller ~]# ifconfig br-ex | head -2
br-ex: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.43.233  netmask 255.255.255.0  broadcast 192.168.43.255
[root@controller ~]# vi /etc/sysconfig/network-scripts/ifcfg-br-ex
#IPADDR=192.168.43.233
IPADDR=192.168.43.200
NETMASK=255.255.255.0
GATEWAY=192.168.43.1
ONBOOT=yes
DEVICE=br-ex
NAME=br-ex
DEVICETYPE=ovs
OVSBOOTPROTO=static
TYPE=OVSBridge
OVS_EXTRA="set bridge br-ex fail_mode=standalone"
[root@controller ~]# vi /etc/sysconfig/network-scripts/ifcfg-br-ex
[root@controller ~]# ifconfig br-ex | head -2
br-ex: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.43.200  netmask 255.255.255.0  broadcast 192.168.43.255

3 변수 설정[ | ]

[root@controller ~]# OLD_IP=192.168.43.233
[root@controller ~]# NEW_IP=192.168.43.200
[root@controller ~]# echo OLD_IP=[$OLD_IP], NEW_IP=[$NEW_IP]
OLD_IP=[192.168.43.233], NEW_IP=[192.168.43.200]

4 키스톤 DB 변경[ | ]

[root@controller ~]# cat answer.txt | grep CONFIG_MARIADB_PW
CONFIG_MARIADB_PW=72d656fa10c54719
[root@controller ~]# CONFIG_MARIADB_PW=72d656fa10c54719
[root@controller ~]# mysql -uroot -p$CONFIG_MARIADB_PW keystone -e "SELECT url FROM endpoint"
+--------------------------------------------------+
| url                                              |
+--------------------------------------------------+
| http://192.168.43.233:9292                       |
| http://192.168.43.233:8080/v1/AUTH_%(tenant_id)s |
| http://192.168.43.233:8777                       |
... (생략)
| http://192.168.43.233:8774/v2.1/%(tenant_id)s    |
| http://192.168.43.233:8041                       |
| http://192.168.43.233:5000/v3                    |
+--------------------------------------------------+
[root@controller ~]# mysql -uroot -p$CONFIG_MARIADB_PW keystone -e "UPDATE endpoint SET url=REPLACE(url,'$OLD_IP','$NEW_IP');"
[root@controller ~]# mysql -uroot -p$CONFIG_MARIADB_PW keystone -e "SELECT url FROM endpoint"
+--------------------------------------------------+
| url                                              |
+--------------------------------------------------+
| http://192.168.43.200:9292                       |
| http://192.168.43.200:8080/v1/AUTH_%(tenant_id)s |
| http://192.168.43.200:8777                       |
... (생략)
| http://192.168.43.200:8774/v2.1/%(tenant_id)s    |
| http://192.168.43.200:8041                       |
| http://192.168.43.200:5000/v3                    |
+--------------------------------------------------+

5 설정파일 변경[ | ]

[root@controller ~]# grep -rl "$OLD_IP" /etc/ 2>/dev/null
/etc/hosts
/etc/sysconfig/network-scripts/ifcfg-br-ex
/etc/sysconfig/iptables.save
/etc/sysconfig/iptables
/etc/xinetd.d/rsync
/etc/aodh/aodh.conf
/etc/nova/nova.conf
/etc/ssh/ssh_known_hosts
/etc/rsyncd.conf
/etc/keystone/keystone.conf
/etc/glance/glance-api.conf
/etc/glance/glance-registry.conf
/etc/cinder/cinder.conf
/etc/neutron/neutron.conf
/etc/neutron/plugins/ml2/openvswitch_agent.ini
/etc/neutron/metadata_agent.ini
/etc/swift/proxy-server.conf
/etc/swift/account-server.conf
/etc/swift/container-server.conf
/etc/swift/object-server.conf
/etc/swift/backups/1505179785.object.builder
/etc/swift/backups/1505179791.account.builder
/etc/swift/backups/1505179796.container.builder
/etc/swift/object.builder
/etc/swift/account.builder
/etc/swift/container.builder
/etc/gnocchi/gnocchi.conf
/etc/mongod.conf
/etc/ceilometer/ceilometer.conf
/etc/redis.conf
/etc/redis.conf.puppet
/etc/httpd/conf.d/horizon.conf
[root@controller ~]# grep -rl "$OLD_IP" /etc/ 2>/dev/null | xargs sed -i "s/$OLD_IP/$NEW_IP/g"
[root@controller ~]# grep -rl "$OLD_IP" /etc/ 2>/dev/null
[root@controller ~]# grep -rl "$NEW_IP" /etc/ 2>/dev/null
/etc/hosts
/etc/sysconfig/network-scripts/ifcfg-br-ex
/etc/sysconfig/iptables.save
/etc/sysconfig/iptables
/etc/xinetd.d/rsync
/etc/aodh/aodh.conf
/etc/nova/nova.conf
/etc/ssh/ssh_known_hosts
/etc/rsyncd.conf
/etc/keystone/keystone.conf
/etc/glance/glance-api.conf
/etc/glance/glance-registry.conf
/etc/cinder/cinder.conf
/etc/neutron/neutron.conf
/etc/neutron/plugins/ml2/openvswitch_agent.ini
/etc/neutron/metadata_agent.ini
/etc/swift/proxy-server.conf
/etc/swift/account-server.conf
/etc/swift/container-server.conf
/etc/swift/object-server.conf
/etc/swift/backups/1505179785.object.builder
/etc/swift/backups/1505179791.account.builder
/etc/swift/backups/1505179796.container.builder
/etc/swift/object.builder
/etc/swift/account.builder
/etc/swift/container.builder
/etc/gnocchi/gnocchi.conf
/etc/mongod.conf
/etc/ceilometer/ceilometer.conf
/etc/redis.conf
/etc/redis.conf.puppet
/etc/httpd/conf.d/horizon.conf

6 재부팅[ | ]

[root@controller ~]# reboot

7 같이 보기[ | ]

8 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}