Openstack #2-1 개념 아키텍쳐

Openstack #1 개요
Openstack #1-1 선행작업
Openstack #1-2 MariaDB(MySQL) 설치
Openstack #1-3 Chrony 설정
Openstack #1-4 MessageQueue(RabbitMQ)
Openstack #1-5 Memcached
Openstack #1-6 Etcd

openstack 모듈간 architecture 는 그림처럼 이해하면 쉽다.

하나의 가상 머신이 생성된다고 하면
– Novas는 Hypervisor로써 coumpute 노드로 설정된 노드들의 CPU와 RAM에 연결된다.
– Neutron은 네트워크 노드로 설정된 노드들의 네트워크 인터페이스와 연결된다.
– Cinder는 블록스토리지로 스토리지 노드들의 HDD(SSD 등)과 연결된다.
기본적으로 이 세 개의 모듈이 노드들의 자원을 획득하고 하나의 가상머신에 자원이 된다.

Glance와 Swift는 가상머신과 직접 연결되지 않는 것을 알 수 있는데 이는 Cinder와 달리 두 서비스는 가상머신에 가상디바이스를 직접 제공하지 않기 때문이다.

Horizon은 사용자가 openstack과 소통하기 위한 창구다. 웹 UI와 CLI를 제공한다.
Keystone은 사용자와 모듈을 식별한다.

Packstack #1 사전 작업 및 패키지 설치

※ 이 포스트는 실제 설치및 설정을 수행하면서 작성하고 있습니다. 계속 업데이트 됩니다.

Openstack #1 개요

CentOS 7 에 install 하는것으로 가정한다.
CentOS 8 Linux 설치를 참고하여 최소설치 모드로 리눅스를 설치한다.
네트워크 설정을 변경한다. (NIC는 2개 이상이 필요하다. 외부 연결용, 노드간 통신 용)
root 권한으로 해야 하는 작업이 많다. root 패스워드를 설정하거나, SuDo : SuperUser Do를 참고하여 sudo 사용 설정을 한다.
클러스터간 설치 및 통신 용의성 확보를 위해 SSH설정을 참고하여 키를 등록한다.
openstack train 기준으로 진행한다.



네트워크설정, ssh 키 설정 등이 완료 됐으면 서비스 설정을 변경한다.
openstack 클러스터의 구성 노드 모두에서 작업 해줘야 한다.

 # 노드간 통신의 용의성을 위해 방화벽 서비스를 종료한다.
[HOSTNAME:/haedong]$ sudo systemctl disable firewalld
[HOSTNAME:/haedong]$ sudo service firewalld stop

 # Network 관리 서비스인데 개인적으로 아주 고약한 녀석이다. 
 # 아무리 설정을 바꿔도 제 멋대로 설정을 덮어 써버리는 경우가 허다하므로 종료한다.
 # 어차피 네트워크는 별도로 관리해야 한다. 
[HOSTNAME:/haedong]$ sudo systemctl disable NetworkManager
[HOSTNAME:/haedong]$ sudo service NetworkManager stop

 # 만약을 위해 서비스를 재시작하고, 항상 서비스가 구동도록 설정한다.
[HOSTNAME:/haedong]$ sudo systemctl enable network
[HOSTNAME:/haedong]$ sudo service network restart

packstack1RDO project의 puppet module을 이용한 CentOS 및 Redhat linux 용 openstack 자동 배포 유틸리티이다. 관련 리포지터리 및 패키지 설치

 # 만약 epel-release 리포지터리가 추가되어있다면 삭제한다.(혹은 disable로 변경해도 된다.)
[HOSTNAME:/home/haedong]$ sudo rm /etc/yum.repos.d/epel
rm: remove 일반 파일 `epel-testing.repo'? y
rm: remove 일반 파일 `epel.repo'? y
 # packstack repo 설치
[HOSTNAME:/home/haedong:]$ sudo yum install -y https://www.rdoproject.org/repos/rdo-release.rpm
[sudo] haedong의 암호:
Loaded plugins: fastestmirror, langpacks
rdo-release.rpm                                                                                                                                               | 6.7 kB  00:00:00
Examining /var/tmp/yum-root-URQvAZ/rdo-release.rpm: rdo-release-train-1.noarch
Marking /var/tmp/yum-root-URQvAZ/rdo-release.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package rdo-release.noarch 0:train-1 will be installed
--> Finished Dependency Resolution
base/7/x86_64                                                                                                                                                 | 3.6 kB  00:00:00
Dependencies Resolved
=====================================================================================================================================================================================
 Package                                      Arch                                    Version                                    Repository                                     Size
=====================================================================================================================================================================================
Installing:
 rdo-release                                  noarch                                  train-1                                    /rdo-release                                  3.1 k
Transaction Summary
=====================================================================================================================================================================================
Install  1 Package

Total size: 3.1 k
Installed size: 3.1 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : rdo-release-train-1.noarch                                                                                                                                        1/1
  Verifying  : rdo-release-train-1.noarch                                                                                                                                        1/1
Installed:
  rdo-release.noarch 0:train-1
Complete!
 # openstack train 패키지 설치
[HOSTNAME:/home/haedong:]$ sudo yum install -y centos-release-openstack-train
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
 * base: mirror.kakao.com
 * extras: mirror.kakao.com
 * openstack-train: mirror.kakao.com
 * rdo-qemu-ev: mirror.kakao.com
 * updates: mirror.kakao.com
openstack-train                                                                                                                                               | 3.0 kB  00:00:00
rdo-qemu-ev                                                                                                                                                   | 3.0 kB  00:00:00
(1/2): rdo-qemu-ev/x86_64/primary_db                                                                                                                          |  57 kB  00:00:00
(2/2): openstack-train/x86_64/primary_db                                                                                                                      | 1.1 MB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package centos-release-openstack-train.noarch 0:1-1.el7.centos will be installed
--> Processing Dependency: centos-release-qemu-ev for package: centos-release-openstack-train-1-1.el7.centos.noarch
--> Processing Dependency: centos-release-ceph-nautilus for package: centos-release-openstack-train-1-1.el7.centos.noarch
--> Running transaction check
---> Package centos-release-ceph-nautilus.noarch 0:1.2-2.el7.centos will be installed
--> Processing Dependency: centos-release >= 7-5.1804.el7.centos.2 for package: centos-release-ceph-nautilus-1.2-2.el7.centos.noarch
--> Processing Dependency: centos-release-storage-common for package: centos-release-ceph-nautilus-1.2-2.el7.centos.noarch
--> Processing Dependency: centos-release-nfs-ganesha28 for package: centos-release-ceph-nautilus-1.2-2.el7.centos.noarch
---> Package centos-release-qemu-ev.noarch 0:1.0-4.el7.centos will be installed
--> Processing Dependency: centos-release-virt-common for package: centos-release-qemu-ev-1.0-4.el7.centos.noarch
--> Running transaction check
---> Package centos-release.x86_64 0:7-5.1804.el7.centos will be updated
---> Package centos-release.x86_64 0:7-9.2009.1.el7.centos will be an update
---> Package centos-release-nfs-ganesha28.noarch 0:1.0-3.el7.centos will be installed
---> Package centos-release-storage-common.noarch 0:2-2.el7.centos will be installed
---> Package centos-release-virt-common.noarch 0:1-1.el7.centos will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================
 Package                                                  Arch                             Version                                           Repository                         Size
=====================================================================================================================================================================================
Installing:
 centos-release-openstack-train                           noarch                           1-1.el7.centos                                    extras                            5.3 k
Installing for dependencies:
 centos-release-ceph-nautilus                             noarch                           1.2-2.el7.centos                                  extras                            5.1 k
 centos-release-nfs-ganesha28                             noarch                           1.0-3.el7.centos                                  extras                            4.3 k
 centos-release-qemu-ev                                   noarch                           1.0-4.el7.centos                                  extras                             11 k
 centos-release-storage-common                            noarch                           2-2.el7.centos                                    extras                            5.1 k
 centos-release-virt-common                               noarch                           1-1.el7.centos                                    extras                            4.5 k
Updating for dependencies:
 centos-release                                           x86_64                           7-9.2009.1.el7.centos                             updates                            27 k
Transaction Summary
=====================================================================================================================================================================================
Install  1 Package  (+5 Dependent packages)
Upgrade             ( 1 Dependent package)
Total download size: 62 k
Downloading packages:
No Presto metadata available for updates
(1/7): centos-release-7-9.2009.1.el7.centos.x86_64.rpm                                                                                                        |  27 kB  00:00:00
(2/7): centos-release-ceph-nautilus-1.2-2.el7.centos.noarch.rpm                                                                                               | 5.1 kB  00:00:00
(3/7): centos-release-nfs-ganesha28-1.0-3.el7.centos.noarch.rpm                                                                                               | 4.3 kB  00:00:00
(4/7): centos-release-qemu-ev-1.0-4.el7.centos.noarch.rpm                                                                                                     |  11 kB  00:00:00
(5/7): centos-release-storage-common-2-2.el7.centos.noarch.rpm                                                                                                | 5.1 kB  00:00:00
(6/7): centos-release-openstack-train-1-1.el7.centos.noarch.rpm                                                                                               | 5.3 kB  00:00:00
(7/7): centos-release-virt-common-1-1.el7.centos.noarch.rpm                                                                                                   | 4.5 kB  00:00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                650 kB/s |  62 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : centos-release-7-9.2009.1.el7.centos.x86_64                                                                                                                       1/8
warning: /etc/yum/vars/contentdir created as /etc/yum/vars/contentdir.rpmnew
  Installing : centos-release-storage-common-2-2.el7.centos.noarch                                                                                                               2/8
  Installing : centos-release-nfs-ganesha28-1.0-3.el7.centos.noarch                                                                                                              3/8
  Installing : centos-release-ceph-nautilus-1.2-2.el7.centos.noarch                                                                                                              4/8
  Installing : centos-release-virt-common-1-1.el7.centos.noarch                                                                                                                  5/8
  Installing : centos-release-qemu-ev-1.0-4.el7.centos.noarch                                                                                                                    6/8
  Installing : centos-release-openstack-train-1-1.el7.centos.noarch                                                                                                              7/8
  Cleanup    : centos-release-7-5.1804.el7.centos.x86_64                                                                                                                         8/8
  Verifying  : centos-release-openstack-train-1-1.el7.centos.noarch                                                                                                              1/8
  Verifying  : centos-release-nfs-ganesha28-1.0-3.el7.centos.noarch                                                                                                              2/8
  Verifying  : centos-release-7-9.2009.1.el7.centos.x86_64                                                                                                                       3/8
  Verifying  : centos-release-ceph-nautilus-1.2-2.el7.centos.noarch                                                                                                              4/8
  Verifying  : centos-release-virt-common-1-1.el7.centos.noarch                                                                                                                  5/8
  Verifying  : centos-release-storage-common-2-2.el7.centos.noarch                                                                                                               6/8
  Verifying  : centos-release-qemu-ev-1.0-4.el7.centos.noarch                                                                                                                    7/8
  Verifying  : centos-release-7-5.1804.el7.centos.x86_64                                                                                                                         8/8
Installed:
  centos-release-openstack-train.noarch 0:1-1.el7.centos
Dependency Installed:
  centos-release-ceph-nautilus.noarch 0:1.2-2.el7.centos        centos-release-nfs-ganesha28.noarch 0:1.0-3.el7.centos        centos-release-qemu-ev.noarch 0:1.0-4.el7.centos
  centos-release-storage-common.noarch 0:2-2.el7.centos         centos-release-virt-common.noarch 0:1-1.el7.centos
Dependency Updated:
  centos-release.x86_64 0:7-9.2009.1.el7.centos

Complete!
 # 설치 된 패키지 업데이트.
[HOSTNAME:/home/haedong:]$ sudo yum -y update
Loaded plugins: fastestmirror, langpacks
Repository rdo-trunk-train-tested is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirror.kakao.com
 * centos-ceph-nautilus: mirror.kakao.com
 * centos-nfs-ganesha28: mirror.kakao.com
 * centos-openstack-train: mirror.kakao.com
 * centos-qemu-ev: mirror.kakao.com
 * extras: mirror.kakao.com
 * openstack-train: mirror.kakao.com
 * rdo-qemu-ev: mirror.kakao.com
 * updates: mirror.kakao.com
Resolving Dependencies
--> Running transaction check
---> Package GeoIP.x86_64 0:1.5.0-11.el7 will be updated
---> Package GeoIP.x86_64 0:1.5.0-14.el7 will be an update
--> Processing Dependency: geoipupdate for package: GeoIP-1.5.0-14.el7.x86_64
---> Package LibRaw.x86_64 0:0.14.8-5.el7.20120830git98d925 will be updated
---> Package LibRaw.x86_64 0:0.19.4-1.el7 will be an update
---> Package ModemManager.x86_64 0:1.6.10-1.el7 will be updated
---> Package ModemManager.x86_64 0:1.6.10-4.el7 will be an update
---> Package ModemManager-glib.x86_64 0:1.6.10-1.el7 will be updated
---> Package ModemManager-glib.x86_64 0:1.6.10-4.el7 will be an update
---> Package NetworkManager.x86_64 1:1.10.2-13.el7 will be updated
---> Package NetworkManager.x86_64 1:1.18.8-2.el7_9 will be an update
---> Package NetworkManager-adsl.x86_64 1:1.10.2-13.el7 will be updated
---> Package NetworkManager-adsl.x86_64 1:1.18.8-2.el7_9 will be an update
---> Package NetworkManager-glib.x86_64 1:1.10.2-13.el7 will be updated
---> Package NetworkManager-glib.x86_64 1:1.18.8-2.el7_9 will be an update
---> Package NetworkManager-libnm.x86_64 1:1.10.2-13.el7 will be updated
---> Package NetworkManager-libnm.x86_64 1:1.18.8-2.el7_9 will be an update
---> Package NetworkManager-ppp.x86_64 1:1.10.2-13.el7 will be updated
---> Package NetworkManager-ppp.x86_64 1:1.18.8-2.el7_9 will be an update
--> Running transaction check
...중략...
---> Package mokutil.x86_64 0:15-8.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================
 Package                                                 Arch                     Version                                             Repository                                Size
=====================================================================================================================================================================================
Installing:
 freerdp-libs                                            x86_64                   2.1.1-2.el7                                         base                                     851 k
     replacing  freerdp-plugins.x86_64 1.0.2-15.el7
 gnome-dictionary                                        x86_64                   3.26.1-2.el7                                        base                                     642 k
     replacing  gnome-dictionary-libs.x86_64 3.20.0-1.el7
 gnome-shell                                             x86_64                   3.28.3-32.el7                                       updates                                  2.1 M
     replacing  caribou.x86_64 0.4.21-1.el7
     replacing  caribou-gtk2-module.x86_64 0.4.21-1.el7
     replacing  caribou-gtk3-module.x86_64 0.4.21-1.el7
     replacing  python2-caribou.noarch 0.4.21-1.el7
 xorg-x11-xauth                                          x86_64                   1:1.0.9-1.el7                                       base                                      30 k
 xorg-x11-xinit                                          x86_64                   1.3.4-2.el7                                         base                                      58 k
 xorg-x11-xkb-utils                                      x86_64                   7.7-14.el7                                          base                                     103 k
...중략...
Transaction Summary
=====================================================================================================================================================================================
Install   36 Packages (+95 Dependent packages)
Upgrade  940 Packages

Total download size: 1.1 G
Downloading packages:
No Presto metadata available for centos-openstack-train
No Presto metadata available for openstack-train
No Presto metadata available for base
No Presto metadata available for updates
No Presto metadata available for centos-ceph-nautilus
(1/1071): GeoIP-1.5.0-14.el7.x86_64.rpm                                                                                                                       | 1.5 MB  00:00:00
(2/1071): LibRaw-0.19.4-1.el7.x86_64.rpm                                                                                                                      | 308 kB  00:00:00
(3/1071): ModemManager-1.6.10-4.el7.x86_64.rpm                                                                                                                | 738 kB  00:00:00
(4/1071): ModemManager-glib-1.6.10-4.el7.x86_64.rpm                                                                                                           | 232 kB  00:00:00
(5/1071): NetworkManager-adsl-1.18.8-2.el7_9.x86_64.rpm                                                                                                       | 163 kB  00:00:00
(6/1071): NetworkManager-glib-1.18.8-2.el7_9.x86_64.rpm                                                                                                       | 1.5 MB  00:00:00
(7/1071): NetworkManager-libnm-1.18.8-2.el7_9.x86_64.rpm                                                                                                      | 1.7 MB  00:00:00
...중략...
(1068/1071): yum-utils-1.1.31-54.el7_8.noarch.rpm                                                                                                             | 122 kB  00:00:00
(1069/1071): zlib-1.2.7-18.el7.x86_64.rpm                                                                                                                     |  90 kB  00:00:00
(1070/1071): zlib-devel-1.2.7-18.el7.x86_64.rpm                                                                                                               |  50 kB  00:00:00
(1071/1071): zenity-3.28.1-1.el7.x86_64.rpm                                                                                                                   | 4.0 MB  00:00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                 46 MB/s | 1.1 GB  00:00:25
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage
Importing GPG key 0xE451E5B5:
 Userid     : "CentOS Storage SIG (http://wiki.centos.org/SpecialInterestGroup/Storage) <security@centos.org>"
 Fingerprint: 7412 9c0b 173b 071a 3775 951a d4a2 e50b e451 e5b5
 Package    : centos-release-storage-common-2-2.el7.centos.noarch (@extras)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage
...중략...
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : libgcc-4.8.5-44.el7.x86_64                                                                                                                                     1/2055
  Installing : urw-base35-fonts-common-20170801-10.el7.noarch                                                                                                                 2/2055
  Installing : xorg-x11-proto-devel-2018.4-1.el7.noarch                                                                                                                       3/2055
...중략...
  Verifying  : 10:qemu-kvm-1.5.3-156.el7.x86_64                                                                                                                            2053/2055
  Verifying  : python-dmidecode-3.12.2-2.el7.x86_64                                                                                                                        2054/2055
  Verifying  : freerdp-1.0.2-15.el7.x86_64                                                                                                                                 2055/2055
Installed:
  freerdp-libs.x86_64 0:2.1.1-2.el7                             gnome-dictionary.x86_64 0:3.26.1-2.el7                  gnome-shell.x86_64 0:3.28.3-32.el7
  grub2.x86_64 1:2.02-0.86.el7.centos                           grub2-tools.x86_64 1:2.02-0.86.el7.centos               grub2-tools-extra.x86_64 1:2.02-0.86.el7.centos
...중략...
  qemu-img.x86_64 10:1.5.3-156.el7                         qemu-kvm.x86_64 10:1.5.3-156.el7                               qemu-kvm-common.x86_64 10:1.5.3-156.el7
  sip-macros.x86_64 0:4.14.6-4.el7                         urw-fonts.noarch 0:2.4-16.el7                                  webkitgtk4-plugin-process-gtk2.x86_64 0:2.16.6-6.el7

Complete!
[HOSTNAME:/home/haedong:]$ sudo yum install -y openstack-packstack
Loaded plugins: fastestmirror, langpacks
Repository rdo-trunk-train-tested is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirror.kakao.com
Resolving Dependencies
--> Running transaction check
---> Package openstack-packstack.noarch 1:15.0.1-1.el7 will be installed
--> Processing Dependency: openstack-packstack-puppet = 1:15.0.1-1.el7 for package: 1:openstack-packstack-15.0.1-1.el7.noarch
--> Processing Dependency: python-docutils for package: 1:openstack-packstack-15.0.1-1.el7.noarch
--> Processing Dependency: python2-pbr for package: 1:openstack-packstack-15.0.1-1.el7.noarch
--> Running transaction check
---> Package openstack-packstack-puppet.noarch 1:15.0.1-1.el7 will be installed
--> Processing Dependency: puppet-aodh for package: 1:openstack-packstack-puppet-15.0.1-1.el7.noarch
--> Processing Dependency: puppet-apache for package: 1:openstack-packstack-puppet-15.0.1-1.el7.noarch
...중략...
  Verifying  : 1:openstack-packstack-15.0.1-1.el7.noarch                                                                                                                       76/78
  Verifying  : python2-pbr-5.1.2-2.el7.noarch                                                                                                                                  77/78
  Verifying  : puppet-cinder-15.4.0-1.el7.noarch                                                                                                                               78/78
Installed:
  openstack-packstack.noarch 1:15.0.1-1.el7
Dependency Installed:
  boost159-atomic.x86_64 0:1.59.0-2.el7.1                 boost159-chrono.x86_64 0:1.59.0-2.el7.1                      boost159-date-time.x86_64 0:1.59.0-2.el7.1
...중략...
  ruby-facter.x86_64 1:3.9.3-7.el7                        ruby-shadow.x86_64 0:1.4.1-23.el7                            rubygem-pathspec.noarch 0:0.2.1-3.el7
  rubygem-rgen.noarch 0:0.6.6-2.el7                       yaml-cpp.x86_64 0:0.5.1-6.el7
Complete!










CentOS 8 Linux 설치

SuDO : SuperUser DO

CentOS 7 네트워크설정

이전 포스트 CentOS 설치 미디어(ISO) 다운로드 를 참고하여 CentOS 설치 이미지를 다운로드 하고 설치 미디어를 만들어 부팅한다.

정상적으로 설치 미디어로 부팅이 된다면 다음 절차들을 참고하여 설치를 진행한다.
※ 예시는 CentOS8을 기준으로 하였지만 CentOS7도 다르지 않다.

설치가 완료되면 재부팅한다.
root 패스워드를 설정하지 않았으므로 root 계정으로는 로그인할 수 없다.
sudo 명령을 이용해 권한을 바꿔가면서 작업 하는 것을 권장하지만 꼭 root 로 로그인 해야 한다면 아래를 참고하여 password를 변경하면 된다.

login as: haedong
haedong@192.168.103.176's password:
Last login: Wed Dec  9 15:08:34 2020 from 192.168.4.199
[centos7:/home/haedong:]$ sudo -i
[sudo] haedong의 암호:
[centos7:/root:]# passwd root
root 사용자의 비밀 번호 변경 중
새  암호:
새  암호 재입력:
passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.
[centos7:/root:]#