데브스택 IP 변경

(데브스택 IP 변경 후 Unable to establish connection to keystone endpoint.에서 넘어옴)
데브스택 IP 변경 후 키스톤 엔드포인트 문제
DevStack - Unable to establish connection to keystone endpoint.

1 문제상황[ | ]

  • IP변경 후, horizon 로그인시 키스톤 엔드포인트에 접속하지 못하는 오류 발생

 

2 키스톤 DB 변경[ | ]

stack@ubuntu16:~/devstack$ mysql -uroot -psecret keystone -e "SELECT url FROM endpoint LIMIT 3"
mysql: [Warning] Using a password on the command line interface can be insecure.
+----------------------------------------------+
| url                                          |
+----------------------------------------------+
| http://192.168.43.181:9292                   |
| http://192.168.43.181:8776/v2/$(project_id)s |
| http://192.168.43.181/identity_v2_admin      |
+----------------------------------------------+
stack@ubuntu16:~/devstack$ OLD_IP=192.168.43.181
stack@ubuntu16:~/devstack$ NEW_IP=192.168.56.101
stack@ubuntu16:~/devstack$ mysql -uroot -psecret keystone -e "UPDATE endpoint SET url=REPLACE(url,'$OLD_IP','$NEW_IP');"
mysql: [Warning] Using a password on the command line interface can be insecure.
stack@ubuntu16:~/devstack$ mysql -uroot -psecret keystone -e "SELECT url FROM endpoint LIMIT 3"
mysql: [Warning] Using a password on the command line interface can be insecure.
+----------------------------------------------+
| url                                          |
+----------------------------------------------+
| http://192.168.56.101:9292                   |
| http://192.168.56.101:8776/v2/$(project_id)s |
| http://192.168.56.101/identity_v2_admin      |
+----------------------------------------------+

3 설정파일 변경[ | ]

  • /etc/ 변경
stack@ubuntu16:~/devstack$ grep -rl "$OLD_IP" /etc/ 2>/dev/null
/etc/cinder/cinder.conf
/etc/openstack/clouds.yaml
/etc/nova/nova-dhcpbridge.conf
... (생략)
stack@ubuntu16:~/devstack$ grep -rl "$OLD_IP" /etc/ 2>/dev/null | xargs sed -i "s/$OLD_IP/$NEW_IP/g"
stack@ubuntu16:~/devstack$ grep -rl "$OLD_IP" /etc/ 2>/dev/null
stack@ubuntu16:~/devstack$ grep -rl "$NEW_IP" /etc/ 2>/dev/null
/etc/cinder/cinder.conf
/etc/openstack/clouds.yaml
/etc/nova/nova-dhcpbridge.conf
... (생략)
  • /opt/stack/ 변경
stack@ubuntu16:~/devstack$ grep -rl "$OLD_IP" /opt/stack/ 2>/dev/null
/opt/stack/devstack/userrc_early
/opt/stack/devstack/accrc/demo/demo
/opt/stack/devstack/accrc/demo/admin
... (생략)
stack@ubuntu16:~/devstack$ grep -rl "$OLD_IP" /opt/stack/ 2>/dev/null | xargs sed -i "s/$OLD_IP/$NEW_IP/g"
stack@ubuntu16:~/devstack$ grep -rl "$OLD_IP" /opt/stack/ 2>/dev/null
stack@ubuntu16:~/devstack$ grep -rl "$NEW_IP" /opt/stack/ 2>/dev/null
/opt/stack/devstack/userrc_early
/opt/stack/devstack/accrc/demo/demo
/opt/stack/devstack/accrc/demo/admin
... (생략)

4 스태킹[ | ]

stack@ubuntu16:~/devstack$ ./stack.sh 
... (생략)

5 요약정리[ | ]

OLD_IP=192.168.43.181
NEW_IP=192.168.56.101
mysql -uroot -psecret keystone -e "UPDATE endpoint SET url=REPLACE(url,'$OLD_IP','$NEW_IP');"
grep -rl "$OLD_IP" /etc/ 2>/dev/null | xargs sed -i "s/$OLD_IP/$NEW_IP/g"
grep -rl "$OLD_IP" /opt/stack/ 2>/dev/null | xargs sed -i "s/$OLD_IP/$NEW_IP/g"
#sudo route add default gw 192.168.122.2 virbr0
./stack.sh

6 같이 보기[ | ]

7 참고[ | ]

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