Packstack으로 오픈스택 설치 실습 (2대 구성)

(OpenStack 설치에서 넘어옴)
  다른 뜻에 대해서는 Packstack 설치 실습 (1대 구성) 문서를 참조하십시오.

1 개요[ | ]

OpenStack 설치 실습
오픈스택 설치 실습

2 호스트 전용 네트워크[ | ]

용도 네트워크명 IP 서브넷 마스크
사설 네트워크 VirtualBox Host-Only Ethernet Adpater 172.25.10.1 255.255.255.0
공중 네트워크 브리지 어댑터 · ·

3 네트워크 설정[ | ]

호스트명 어댑터1 어댑터 2
servera.pod1.example.com 호스트 전용 어댑터 브리지 어댑터
serverb.pod2.example.com 호스트 전용 어댑터 브리지 어댑터

4 IP 주소 예시[ | ]

호스트명 lo eth0 eth1
servera.pod1.example.com 127.0.0.1 172.25.10.10 192.168.0.100
serverb.pod1.example.com 127.0.0.1 172.25.10.11 192.168.0.101

5 서버 네트워크 설정[ | ]

  • servera, serverb 동일한 방식으로 설정 (단, IP주소는 다름)
  • (Optional) firewalld도 stop, disable
[root@localhost ~]# systemctl disable NetworkManager
[root@localhost ~]# systemctl stop NetworkManager
[root@localhost ~]# systemctl status NetworkManager
NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; disabled)
   Active: inactive (dead)

Nov 12 07:32:14 serverb.pod1.example.com systemd[1]: Stopped Network Manager.
[root@localhost ~]# ll /etc/sysconfig/network-scripts/ifcfg*
-rw-r--r--. 1 root root 102 Nov 12 07:19 /etc/sysconfig/network-scripts/ifcfg-eth0
-rw-r--r--. 1 root root 104 Nov 12 07:19 /etc/sysconfig/network-scripts/ifcfg-eth1
-rw-r--r--. 1 root root 254 Jan 15  2015 /etc/sysconfig/network-scripts/ifcfg-lo
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=172.25.10.10
NETMASK=255.255.255.0
GATEWAY=172.25.10.1
ONBOOT=yes
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
IPADDR=192.168.0.100
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
ONBOOT=yes
[root@localhost ~]# systemctl start network
[root@localhost ~]# systemctl status network
network.service - LSB: Bring up/down networking
   Loaded: loaded (/etc/rc.d/init.d/network)
   Active: active (exited) since Thu 2015-11-12 07:27:57 EST; 59s ago
  Process: 8080 ExecStop=/etc/rc.d/init.d/network stop (code=exited, status=0/SUCCESS)
  Process: 8378 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=0/SUCCESS)

Nov 12 07:27:51 servera.pod1.example.com systemd[1]: Starting LSB: Bring up/down networking...
Nov 12 07:27:51 servera.pod1.example.com network[8378]: Bringing up loopback interface:  [  OK  ]
Nov 12 07:27:54 servera.pod1.example.com network[8378]: Bringing up interface eth0:  [  OK  ]
Nov 12 07:27:57 servera.pod1.example.com network[8378]: Bringing up interface eth1:  [  OK  ]
Nov 12 07:27:57 servera.pod1.example.com systemd[1]: Started LSB: Bring up/down networking.
[root@servera ~]# ip addr | grep 'inet '
    inet 127.0.0.1/8 scope host lo
    inet 172.25.10.10/24 brd 172.25.10.255 scope global eth0
    inet 192.168.0.100/24 brd 192.168.0.255 scope global eth1

6 호스트명 변경 후 재부팅[ | ]

[root@localhost ~]# hostnamectl set-hostname servera.pod1.example.com
[root@localhost ~]# hostname -f
servera.pod1.example.com
[root@localhost ~]# reboot

7 서버 hosts 파일 설정[ | ]

[root@servera ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
172.25.10.10 servera.pod1.example.com servera
172.25.10.11 serverb.pod1.example.com serverb

8 서버간 통신 확인[ | ]

  • servera, serverb 둘다 동일하게 확인
ping servera -c1 | egrep 'PING|0%'
ping serverb -c1 | egrep 'PING|0%'
ping servera.pod1.example.com -c1 | egrep 'PING|0%'
ping serverb.pod1.example.com -c1 | egrep 'PING|0%'
ping 8.8.8.8 -c1 | egrep 'PING|0%'
ping time.bora.net -c1 | egrep 'PING|0%'
[root@servera ~]# ping servera -c1 | egrep 'PING|0%'
PING servera.pod1.example.com (172.25.10.10) 56(84) bytes of data.
1 packets transmitted, 1 received, 0% packet loss, time 0ms
[root@servera ~]# ping serverb -c1 | egrep 'PING|0%'
PING serverb.pod1.example.com (172.25.10.11) 56(84) bytes of data.
1 packets transmitted, 1 received, 0% packet loss, time 0ms
[root@servera ~]# ping servera.pod1.example.com -c1 | egrep 'PING|0%'
PING servera.pod1.example.com (172.25.10.10) 56(84) bytes of data.
1 packets transmitted, 1 received, 0% packet loss, time 0ms
[root@servera ~]# ping serverb.pod1.example.com -c1 | egrep 'PING|0%'
PING serverb.pod1.example.com (172.25.10.11) 56(84) bytes of data.
1 packets transmitted, 1 received, 0% packet loss, time 0ms
[root@servera ~]# ping 8.8.8.8 -c1 | egrep 'PING|0%'
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
1 packets transmitted, 1 received, 0% packet loss, time 0ms
[root@servera ~]# ping time.bora.net -c1 | egrep 'PING|0%'
PING time.bora.net (203.248.240.140) 56(84) bytes of data.
1 packets transmitted, 1 received, 0% packet loss, time 0ms

9 yum update[ | ]

  • servera, serverb 둘다 동일하게 적용
[root@servera ~]# yum repolist
... (생략)
repo id                         repo name                         status
base/7/x86_64                   CentOS-7 - Base                   8,652
extras/7/x86_64                 CentOS-7 - Extras                   275
updates/7/x86_64                CentOS-7 - Updates                1,707
repolist: 10,634
[root@servera ~]# yum update -y
... (생략)
  xz-libs.x86_64 0:5.1.2-9alpha.el7                                     
  yum.noarch 0:3.4.3-125.el7.centos                                     
  yum-plugin-fastestmirror.noarch 0:1.1.31-29.el7                       

Replaced:
  NetworkManager.x86_64 1:0.9.9.1-13.git20140326.4dba720.el7            

Complete!

10 openstack-liberty 저장소 추가[ | ]

  • 여기부터는 servera만 적용 ★★
[root@servera ~]# yum install https://www.rdoproject.org/repos/rdo-release.rpm -y
...(생략)
Installed:
  rdo-release.noarch 0:liberty-2                                        

Complete!
[root@servera ~]# yum repolist
... (생략)
repo id                        repo name                          status
base/7/x86_64                  CentOS-7 - Base                    8,652
extras/7/x86_64                CentOS-7 - Extras                    275
openstack-liberty/x86_64       OpenStack Liberty Repository         723
updates/7/x86_64               CentOS-7 - Updates                 1,707
repolist: 11,357

11 openstack-packstack 설치[ | ]

[root@servera ~]# yum install openstack-packstack -y
... (생략)
  rubygem-psych.x86_64 0:2.0.0-25.el7_1                                 
  rubygem-rdoc.noarch 0:4.0.0-25.el7_1                                  
  rubygems.noarch 0:2.0.14-25.el7_1                                     

Complete!
[root@servera ~]# packstack --version
packstack Liberty 2015.2.dev1654.gcbbf46e

12 answer 파일 생성[ | ]

  • answer.txt 파일 생성
[root@servera ~]# packstack --gen-answer-file answer.txt
Packstack changed given value  to required value /root/.ssh/id_rsa.pub
  • 사본 보존
[root@servera ~]# cp answer.txt answer.old

13 answer 파일 편집 #1[ | ]

[root@servera ~]# vi answer.txt
...
CONFIG_DEFAULT_PASSWORD=mypw
...
CONFIG_HEAT_INSTALL=y
...
CONFIG_NTP_SERVERS=time.bora.net
...
CONFIG_KEYSTONE_ADMIN_PW=mypw
...
CONFIG_HORIZON_SSL=y
...
CONFIG_HEAT_CFN_INSTALL=y
...
CONFIG_PROVISION_DEMO=n
  • 변경내용 확인
[root@servera ~]# diff answer.old answer.txt
11c11
< CONFIG_DEFAULT_PASSWORD=
---
> CONFIG_DEFAULT_PASSWORD=mypw
43c43
< CONFIG_HEAT_INSTALL=n
---
> CONFIG_HEAT_INSTALL=y
62c62
< CONFIG_NTP_SERVERS=
---
> CONFIG_NTP_SERVERS=time.bora.net
303c303
< CONFIG_KEYSTONE_ADMIN_PW=efdd3c010d89439c
---
> CONFIG_KEYSTONE_ADMIN_PW=mypw
1014c1014
< CONFIG_HORIZON_SSL=n
---
> CONFIG_HORIZON_SSL=y
1077c1077
< CONFIG_HEAT_CFN_INSTALL=n
---
> CONFIG_HEAT_CFN_INSTALL=y
1090c1090
< CONFIG_PROVISION_DEMO=y
---
> CONFIG_PROVISION_DEMO=n

14 answer 파일 편집 #2[ | ]

  • 172.25.10.10 (eth0)을 기준으로 설정되어야 하는데 192.168.0 (eth1)을 기준으로 설정되어 있음
[root@servera ~]# cat answer.txt | grep 192.168.0
CONFIG_CONTROLLER_HOST=192.168.0.100
CONFIG_COMPUTE_HOSTS=192.168.0.100
CONFIG_NETWORK_HOSTS=192.168.0.100
CONFIG_STORAGE_HOST=192.168.0.100
CONFIG_SAHARA_HOST=192.168.0.100
CONFIG_AMQP_HOST=192.168.0.100
CONFIG_MARIADB_HOST=192.168.0.100
CONFIG_KEYSTONE_LDAP_URL=ldap://192.168.0.100
CONFIG_MONGODB_HOST=192.168.0.100
CONFIG_REDIS_MASTER_HOST=192.168.0.100
  • 사본2 보존
[root@servera ~]# cp answer.txt answer.old2
  • IP 바꿔치기
[root@servera ~]# sed -i 's/192.168.0.100/172.25.10.10/g' answer.txt
[root@servera ~]# diff answer.old2 answer.txt
82c82
< CONFIG_CONTROLLER_HOST=192.168.0.100
---
> CONFIG_CONTROLLER_HOST=172.25.10.10
85c85
< CONFIG_COMPUTE_HOSTS=192.168.0.100
---
> CONFIG_COMPUTE_HOSTS=172.25.10.10
89c89
< CONFIG_NETWORK_HOSTS=192.168.0.100
---
> CONFIG_NETWORK_HOSTS=172.25.10.10
124c124
< CONFIG_STORAGE_HOST=192.168.0.100
---
> CONFIG_STORAGE_HOST=172.25.10.10
128c128
< CONFIG_SAHARA_HOST=192.168.0.100
---
> CONFIG_SAHARA_HOST=172.25.10.10
250c250
< CONFIG_AMQP_HOST=192.168.0.100
---
> CONFIG_AMQP_HOST=172.25.10.10
272c272
< CONFIG_MARIADB_HOST=192.168.0.100
---
> CONFIG_MARIADB_HOST=172.25.10.10
323c323
< CONFIG_KEYSTONE_LDAP_URL=ldap://192.168.0.100
---
> CONFIG_KEYSTONE_LDAP_URL=ldap://172.25.10.10
1148c1148
< CONFIG_MONGODB_HOST=192.168.0.100
---
> CONFIG_MONGODB_HOST=172.25.10.10
1152c1152
< CONFIG_REDIS_MASTER_HOST=192.168.0.100
---
> CONFIG_REDIS_MASTER_HOST=172.25.10.10

15 answer 파일 적용[ | ]

[root@servera ~]# packstack --answer-file answer.txt
Welcome to the Packstack setup utility

The installation log file is available at: /var/tmp/packstack/20151112-070612-eQyGc6/openstack-setup.log

Installing:
Clean Up                                             [ DONE ]
Discovering ip protocol version                      [ DONE ]
Setting up ssh keys                                  [ DONE ]
... (생략)
Applying 172.25.10.10_nagios.pp
Applying 172.25.10.10_nagios_nrpe.pp
172.25.10.10_nagios.pp:                              [ DONE ]          
172.25.10.10_nagios_nrpe.pp:                         [ DONE ]          
Applying 172.25.10.10_postscript.pp
172.25.10.10_postscript.pp:                          [ DONE ]         
Applying Puppet manifests                            [ DONE ]
Finalizing                                           [ DONE ]

 **** Installation completed successfully ******

Additional information:
 * Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
 * File /root/keystonerc_admin has been created on OpenStack client host 172.25.10.10. To use the command line tools you need to syntaxhighlight the file.
 * To access the OpenStack Dashboard browse to http://172.25.10.10/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
 * To use Nagios, browse to http://172.25.10.10/nagios username: nagiosadmin, password: 9f93ebcf440a49cc
 * The installation log file is available at: /var/tmp/packstack/20151112-080818-IA1k9X/openstack-setup.log
 * The generated manifests are available at: /var/tmp/packstack/20151112-080818-IA1k9X/manifests

16 오픈스택 서비스 확인[ | ]

[root@servera ~]# openstack-status
== Nova services ==
openstack-nova-api:                     active
openstack-nova-cert:                    active
openstack-nova-compute:                 active
openstack-nova-network:                 inactive  (disabled on boot)
openstack-nova-scheduler:               active
openstack-nova-conductor:               active
== Glance services ==
openstack-glance-api:                   active
openstack-glance-registry:              active
== Keystone service ==
openstack-keystone:                     inactive  (disabled on boot)
== Horizon service ==
openstack-dashboard:                    active
== neutron services ==
neutron-server:                         active
neutron-dhcp-agent:                     active
neutron-l3-agent:                       active
neutron-metadata-agent:                 active
neutron-openvswitch-agent:              active
== Swift services ==
openstack-swift-proxy:                  active
openstack-swift-account:                active
openstack-swift-container:              active
openstack-swift-object:                 active
== Cinder services ==
openstack-cinder-api:                   active
openstack-cinder-scheduler:             active
openstack-cinder-volume:                active
openstack-cinder-backup:                active
== Ceilometer services ==
openstack-ceilometer-api:               active
openstack-ceilometer-central:           active
openstack-ceilometer-compute:           active
openstack-ceilometer-collector:         active
openstack-ceilometer-alarm-notifier:    active
openstack-ceilometer-alarm-evaluator:   active
openstack-ceilometer-notification:      active
== Support services ==
mysqld:                                 inactive  (disabled on boot)
openvswitch:                            active
dbus:                                   active
target:                                 active
rabbitmq-server:                        active
memcached:                              active
== Keystone users ==
Warning keystonerc not syntaxhighlightd

17 브리지 네트워크 구성[ | ]

  • ifcfg-eth0 보존 및 br-ex로 복사
[root@servera ~]# cp /etc/sysconfig/network-scripts/ifcfg-eth0 /root/
[root@servera ~]# cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-br-ex
  • ifcfg-eth0 수정
[root@servera ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
DEVICETYPE=ovs
TYPE=OVSPort
OVS_BRIDGE=br-ex
ONBOOT=yes
  • ifcfg-br-ex 수정
[root@servera ~]# vi /etc/sysconfig/network-scripts/ifcfg-br-ex
DEVICE=br-ex
DEVICETYPE=ovs
TYPE=OVSBridge
BOOTPROTO=static
IPADDR=172.25.10.10
NETMASK=255.255.255.0
GATEWAY=172.25.10.1
DNS1=8.8.8.8
ONBOOT=yes
  • 네트워크 재시작
[root@servera ~]# systemctl restart network
  • 확인
[root@servera ~]# ovs-vsctl show | egrep 'br|eth'
    Bridge br-ex
        Port br-ex
            Interface br-ex
        Port "eth0"
            Interface "eth0"
    Bridge br-int
        Port br-int
            Interface br-int
    Bridge br-tun
        Port br-tun
            Interface br-tun
[root@servera ~]# ip addr show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master ovs-system state UP qlen 1000
    link/ether 08:00:27:66:75:be brd ff:ff:ff:ff:ff:ff
    inet6 fe80::a00:27ff:fe66:75be/64 scope link 
       valid_lft forever preferred_lft forever
[root@servera ~]# ip addr show br-ex
12: br-ex: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN 
    link/ether 08:00:27:66:75:be brd ff:ff:ff:ff:ff:ff
    inet 172.25.10.10/24 brd 172.25.10.255 scope global br-ex
       valid_lft forever preferred_lft forever
    inet6 fe80::687b:61ff:fe8b:549/64 scope link 
       valid_lft forever preferred_lft forever

18 기타[ | ]

19 같이 보기[ | ]

20 참고[ | ]

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