Openstack Stain Manual 설치
Openstack Stain Manual 설치
1. 시스템 및 네트워크 구성
- 여기서는 Nat 네트워크를 외부, host1 대역을 내부로 사용하여 Openstack을 구축해보도록 하겠습니다.
- 운영체제 및 네트워크 구성
- Hypervisor : Vmware Workstation 15
- OS : CentOS7
- 노드 구성
OS | Hostname | Network Interface | Network Interface2 | CPU | RAM | DISK |
---|---|---|---|---|---|---|
CentOS7 | controller | Nat ( 192.168.10.100 ) | HOST1 ( 10.10.10.10 ) | 2cpu 4thread | 8 RAm | 30G |
CentOS7 | natwork | Nat ( 192.168.10.101 ) | HOST1 ( 10.10.10.20 ) | 1cpu 2thread | 2 RAm | 20G |
CentOS7 | compute | Nat ( 192.168.10.102 ) | HOST1 ( 10.10.10.30 ) | 1cpu 4thread | 4 RAm | 100G |
- 기본적인 업데이트 및 설정을 모든 노드에 진행합니다.
$ yum -y update
# 업데이트
$ vi /etc/hosts
10.10.10.10 controller
10.10.10.20 network
10.10.10.30 compute
# known host 등록
- 설정이 완료되면 기본 구성을 모든 노드에 진행합니다.
$ yum -y install chrony
# 시간 동기화를 위한 chrony 설치
$ vi /etc/chrony.conf
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server ntp1.jst.mfeed.ad.jp iburst
server ntp2.jst.mfeed.ad.jp iburst
server ntp3.jst.mfeed.ad.jp iburst
allow 10.10.10.0/24
# 시간동기화
$ firewall-cmd --add-service=ntp --permanent
$ firewall-cmd --reload
# ntp 방화벽 허용 및 리로딩
$ init 6
# 시스템 재시작
$ chronyc sources
# 확인
2. Openstack 기본 패키지 구성
- Openstack의 기본 패키지 구성은 먼저 contorller 노드만을 통해 진행됨을 유의해주시길 바랍니다.
- controller 노드에는 다음의 패키지가 설치됩니다.
- MariaDB: OpenStack 서비스 및 VM 관련 설정들을 보관하기 위해 사용
- RabbitMQ: OpenStack 서비스 간 상호 메시지를 주고 받기 위하나 메시지 큐로 사용
- Memcached: 범용 분산 메모리 캐시 시스템으로, 자주 외부 데이터에 접근해야 하는 경우에 발생하는 오버헤드를 줄이기 위해 메모리르르 캐싱하고 읽어들이는 역할을 담당, OpenStack 서비스에서는 주로 인증 메커니즘에서 토큰 캐싱을 위해 사용됩니다.
- Openstack 패키지 설치 및 레포지토리 구성
$ yum -y install centos-release-openstack-stein
$ sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-OpenStack-stein.repo
# stein 패캐지를 등록합니다.
- MariaDB를 설치합니다.
$ yum --enablerepo=centos-openstack-stein -y install mariadb-server
$ vi /etc/my.cnf
[mysqld]
character-set-server=utf8
# charset을 utf-8으로 변경합니다
$ systemctl start mariadb
$ systemctl enable mariadb
# mariadb을 시작 및 자동시작을 등록합니다.
$ mysql_secure_installation
# 패스워드 설정을 진행합니다.
$ firewall-cmd --add-service=mysql --permanent
$ firewall-cmd --reload
- RabbitMQ 및 Memcached를 설치합니다.
$ yum --enablerepo=centos-openstack-stein -y install rabbitmq-server
$ yum --enablerepo=centos-openstack-stein -y install memcached
$ vi /etc/my.cnf.d/mariadb-server.cnf
[mysqld]
...
character-set-server=utf8
max_connections=500
# Mariadb의 위에 내용을 추가합니다.
$ vi /etc/sysconfig/memcached
OPTIONS="-l 0.0.0.0,::"
# mamcached를 모든 리스닝 상태로 전환시킵니다.
$ systemctl restart mariadb rabbitmq-server memcached
$ systemctl enable mariadb rabbitmq-server memcached
# Mariadb와 함께 RabbitMQ 및 Memcached를 시작 및 자동시작을 등록합니다.
$ rabbitmqctl add_user [ id ] [ pw ]
# rabbitmq 유저를 생성합니다. 여기서는 openstack/qwer1234를 사용하도록 하겠습니다.
$ rabbitmqctl set_permissions [ id ] ".*" ".*" ".*"
# 생성한 사용자에게 모든 권한을 부여합니다.
$ firewall-cmd --add-port={11211/tcp,5672/tcp} --permanent
$ firewall-cmd --reload
3. Keystone ( 인증 서비스 ) 구성
- Keystone 또한 controller의 설치를 진행합니다.
- keystone에 대한 설명은 keystone을 참조해주세요.
- keyston DB 생성
$ mysql -u root -p
MariaDB [(none)]> create database keystone;
MariaDB [(none)]> grant all privileges on keystone.* to keystone@'localhost' identified by 'pw';
MariaDB [(none)]> grant all privileges on keystone.* to keystone@'%' identified by 'pw';
MariaDB [(none)]> flush privileges;
# keystone 구성을 위한 db를 생성합니다. ( 저는 편의를 위해 모든 pw로 qwer1234 설정하였습니다. )
- keystone 패키지 설치 및 수정
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-keystone openstack-utils python-openstackclient httpd mod_wsgi
# keystone 및 관련 패키지를 설치합니다.
$ vi /etc/keystone/keystone.conf
[cache]
...
memcache_servers = controller:11211
[database]
...
connection = mysql+pymysql://keystone:qwer1234@controller/keystone
[token]
...
provider = fernet
# keystone 구성을 위해 설정파일 수정합니다.
# hosts에 등록한 IP 혹은 controller의 IP를 기입하셔도 무관합니다.
$ su -s /bin/bash keystone -c "keystone-manage db_sync"
# 설정 값을 토대로 db의 설정을 저정합니다.
$ keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
$ keystone-manage credential_setup --keystone-user keystone --keystone-group keystone
# 토큰 및 자격 증명 암호화를 위해 사용되는 키 저장소를 생성합니다.
$ export controller=10.10.10.10
$ keystone-manage bootstrap --bootstrap-password qwer1234 \
--bootstrap-admin-url http://$controller:5000/v3/ \
--bootstrap-internal-url http://$controller:5000/v3/ \
--bootstrap-public-url http://$controller:5000/v3/ \
--bootstrap-region-id RegionOne
# controlelr의 IP로 keystone을 부트스트랩합니다.
$ setsebool -P httpd_use_openstack on
$ setsebool -P httpd_can_network_connect on
$ setsebool -P httpd_can_network_connect_db on
$ firewall-cmd --add-port=5000/tcp --permanent
$ firewall-cmd --reload
# Selinux와 방화벽으르 설정합니다.
$ ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/
$ systemctl start httpd
$ systemctl enable httpd
# keystone 설정 활성화 및 httpd 를 시작합니다.
- 정상 동작 확인을 위한 토큰 파일 생성
$ vi ~/admin
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=qwer1234
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
$ chmod 600 ~/admin
$ source ~/admin
- project 생성
$ cd ~
$ . admin
$ openstack project create --domain default --description "Service Project" service
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | Service Project |
| domain_id | default |
| enabled | True |
| id | 3f0b3ef5b8c94a0a9cca8e34ea2fdbd6 |
| is_domain | False |
| name | service |
| parent_id | default |
| tags | [] |
+-------------+----------------------------------+
# project 생성
$ openstack project list
+----------------------------------+---------+
| ID | Name |
+----------------------------------+---------+
| 3f0b3ef5b8c94a0a9cca8e34ea2fdbd6 | service |
| ec1a4336cfa64d04bbc8f908b26a6cda | admin |
+----------------------------------+---------+
- 이것으로 keystone에 대한 설치가 끝났습니다.
- 혹시 오류가 발생할 경우 /var/log/keystone/ 혹은 /var/log/httpd/에서 error 로그, keystone 로그를 검색하여 오류를 찾아내시면 보다 쉽게 문제를 해결하실 수 있습니다.
4. Glance ( 이미지 서비스 ) 구성
- Glance 또한 controller에서만 설치를 진행합니다.
- 에 대한 설명은 Glance을 참조해주세요.
- glance 사용자 추가
$ source ~/admin
# 전에 생성했던 토큰 값을 적용합니다.
$ openstack user create --domain default --project service --password qwer1234 glance
# glance 게정을 추가합니다.
$ openstack role add --project service --user glance admin
# glance에 admin의 권한을 부여합니다.
$ openstack service create --name glance --description "OpenStack Image service" image
# glance 서비스 엔트리를 생성합니다.
$ export controller=10.10.10.10
$ openstack endpoint create --region RegionOne image public http://$controller:9292
$ openstack endpoint create --region RegionOne image internal http://$controller:9292
$ openstack endpoint create --region RegionOne image admin http://$controller:9292
# glance 서비스의 endpoint를 추가합니다 ( public, internal, admin )
$ openstack user list
+----------------------------------+--------+
| ID | Name |
+----------------------------------+--------+
| bd36365f2459468a9c480cb48bab3ac0 | glance |
| e19db9d5ec2c4c30b7a85d18b8b0e589 | admin |
+----------------------------------+--------+
$ openstack endpoint list
+----------------------------------+-----------+--------------+--------------+---------+-----------+-----------------------------+
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
+----------------------------------+-----------+--------------+--------------+---------+-----------+-----------------------------+
| 00b38774cef048ee9950eda6938accc3 | RegionOne | keystone | identity | True | public | http://10.10.10.10:5000/v3/ |
| 4591b06391374fe888380fa23b8f5121 | RegionOne | glance | image | True | admin | http://10.10.10.10:9292 |
| 53dd31fecf2d44949c141149a13c673b | RegionOne | keystone | identity | True | admin | http://10.10.10.10:5000/v3/ |
| 555f3d900f7e416bb783120f7ce74fe8 | RegionOne | glance | image | True | internal | http://10.10.10.10:9292 |
| 5b3ac620bb7d4d9aabdf0f33229ee346 | RegionOne | glance | image | True | public | http://10.10.10.10:9292 |
| bdd7df7c8cba46f6ada2c12155a9f1d6 | RegionOne | keystone | identity | True | internal | http://10.10.10.10:5000/v3/ |
+----------------------------------+-----------+--------------+--------------+---------+-----------+-----------------------------+
- Glance DB 생성
$ mysql -u root -p
MariaDB [(none)]> create database glance;
MariaDB [(none)]> grant all privileges on glance.* to glance@'localhost' identified by 'pw';
MariaDB [(none)]> grant all privileges on glance.* to glance@'%' identified by 'pw';
MariaDB [(none)]> flush privileges;
# 구성을 위한 db를 생성합니다. ( 저는 편의를 위해 모든 pw로 qwer1234 설정하였습니다. )
- glance 패키지 설치 및 수정
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-glance
# glance 패키지를 설치합니다.
$ vi /etc/glance/glance-api.conf
[DEFAULT]
bind_host = 0.0.0.0
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/ # 이미지 경로 지정
[database] # database 연동
connection = mysql+pymysql://glance:qwer1234@controller/glance
[keystone_authtoken] # keystone 인증
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = qwer1234
[paste_deploy]
flavor = keystone
# glance.conf를 수정합니다.
$ su -s /bin/bash glance -c "glance-manage db_sync"
# glance db를 동기화 시킵니다.
$ systemctl start openstack-glance-api
$ systemctl enable openstack-glance-api
# glance를 시작 및 실행시 자동시작을 등록합니다.
$ setsebool -P glance_api_can_network on
$ firewall-cmd --add-port=9292/tcp --permanent
$ firewall-cmd --reload
# Selinux 및 firewall을 설정합니다.
- 확인을 위한 이미지 생성
$ wget http://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img
# 확인을 위해 cirros 이미지를 다운 받습니다.
$ openstack image create "Cirros" --file cirros-0.5.1-x86_64-disk.img --disk-format qcow2
# image 등록
$ openstack image list
+--------------------------------------+--------+--------+
| ID | Name | Status |
+--------------------------------------+--------+--------+
| 38e15009-022b-49ce-bcdf-b220eb3c5b12 | Cirros | active |
+--------------------------------------+--------+--------+
# 확인
5. Nova ( 컴퓨트 서비스 ) 구성
- Nova 서비스는 controller 노드와 compute노드에 구성됩니다.
- 설치는 contoller > compute 순으로 진행하도록 하겠습니다.
- Nova에 대한 설명은 Nova을 참조해주세요.
- Nova, Placement 추가 및 등록
$ source ~/admin
$ openstack user create --domain default --project service --password qwer1234 nova
$ openstack role add --project service --user nova admin
$ openstack user create --domain default --project service --password qwer1234 placement
$ openstack role add --project service --user placement admin
# nova 유저와 placement유저를 생성합니다.
$ openstack service create --name nova --description "OpenStack Compute Service" compute
# nova 서버 엔트리 저장
$ openstack service create --name placement --description "OpenStack Compute Placement Service" placement
# placement 서버 엔트리 저장
$ openstack user list
# 확인
+----------------------------------+-----------+
| ID | Name |
+----------------------------------+-----------+
| 18bdf3e68a754aa182f93196a918ba65 | nova |
| 18ff8b52493a408d9933596ed20cca9c | glance |
| bfd0cf6d358e49bf88f183a463c689a2 | placement |
| e19db9d5ec2c4c30b7a85d18b8b0e589 | admin |
+----------------------------------+-----------+
$ export controller=10.10.10.10
$ openstack endpoint create --region RegionOne compute public http://$controller:8774/v2.1/%\(tenant_id\)s
$ openstack endpoint create --region RegionOne compute internal http://$controller:8774/v2.1/%\(tenant_id\)s
$ openstack endpoint create --region RegionOne compute admin http://$controller:8774/v2.1/%\(tenant_id\)s
# nova 서비스의 endpoint를 추가합니다
$ openstack endpoint create --region RegionOne placement public http://$controller:8778
$ openstack endpoint create --region RegionOne placement internal http://$controller:8778
$ openstack endpoint create --region RegionOne placement admin http://$controller:8778
$ placement의 endpoint를 추가합니다.
$ openstack endpoint list
# 확인
-------+-----------+--------------------------------------------+
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------------------+
| 00b38774cef048ee9950eda6938accc3 | RegionOne | keystone | identity | True | public | http://10.10.10.10:5000/v3/ |
| 04ca5fb6701348089777d68a68ca7cd2 | RegionOne | placement | placement | True | public | http://10.10.10.10:8778 |
| 53ad55ce8897463b86ea616a8ba64d95 | RegionOne | glance | image | True | public | http://10.10.10.10:9292 |
| 53dd31fecf2d44949c141149a13c673b | RegionOne | keystone | identity | True | admin | http://10.10.10.10:5000/v3/ |
| 595a2045543b42c2bb6f23e2dd30a3bb | RegionOne | glance | image | True | internal | http://10.10.10.10:9292 |
| 6820b49138d54b63ac34cd52f1be08f6 | RegionOne | placement | placement | True | internal | http://10.10.10.10:8778 |
| 6ad740445fca4a0fb684d913909fe129 | RegionOne | nova | compute | True | admin | http://10.10.10.10:8774/v2.1/%(tenant_id)s |
| 9863826e093943cf97a05dfc6e3c159a | RegionOne | nova | compute | True | internal | http://10.10.10.10:8774/v2.1/%(tenant_id)s |
| b9f9701a57ec40e487ce493a63903cae | RegionOne | placement | placement | True | admin | http://10.10.10.10:8778 |
| bd787b85b3124f0ab15854998624cb19 | RegionOne | nova | compute | True | public | http://10.10.10.10:8774/v2.1/%(tenant_id)s |
| bdd7df7c8cba46f6ada2c12155a9f1d6 | RegionOne | keystone | identity | True | internal | http://10.10.10.10:5000/v3/ |
| d394eaf13ac840b3b2e69e074c2c1c20 | RegionOne | glance | image | True | admin | http://10.10.10.10:9292 |
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------------------+
- Nova DB 생성
$ mysql -u root -p
MariaDB [(none)]> create database nova;
MariaDB [(none)]> grant all privileges on nova.* to nova@'localhost' identified by 'pw';
MariaDB [(none)]> grant all privileges on nova.* to nova@'%' identified by 'pw';
MariaDB [(none)]> create database nova_api;
MariaDB [(none)]> grant all privileges on nova_api.* to nova@'localhost' identified by 'pw';
MariaDB [(none)]> grant all privileges on nova_api.* to nova@'%' identified by 'pw';
MariaDB [(none)]> create database nova_placement;
MariaDB [(none)]> grant all privileges on nova_placement.* to nova@'localhost' identified by 'pw';
MariaDB [(none)]> grant all privileges on nova_placement.* to nova@'%' identified by 'pw';
MariaDB [(none)]> create database nova_cell0;
MariaDB [(none)]> grant all privileges on nova_cell0.* to nova@'localhost' identified by 'pw';
MariaDB [(none)]> grant all privileges on nova_cell0.* to nova@'%' identified by 'pw';
MariaDB [(none)]> flush privileges;
# nova 구성을 위한 db를 생성합니다. ( 저는 편의를 위해 모든 pw로 qwer1234 설정하였습니다. )
- nova 서비스를 설치 및 수정합니다.
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-nova
# nova 패키지를 설치합니다.
$ vi /etc/nova/nova.conf
[DEFAULT]
my_ip = 10.10.10.10
state_path = /var/lib/nova
enabled_apis = osapi_compute,metadata
log_dir = /var/log/nova
[api]
auth_strategy = keystone
[glance]
api_servers = http://controller:9292
[oslo_concurrency]
lock_path = $state_path/tmp
[api_database]
connection = mysql+pymysql://nova:qwer1234@controller/nova_api
[database]
connection = mysql+pymysql://nova:qwer1234@controller/nova
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = qwer1234
[placement]
auth_url = http://controller:5000
os_region_name = RegionOne
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = placement
password = qwer1234
[placement_database]
connection = mysql+pymysql://nova:qwer1234@controller/nova_placement
[wsgi]
api_paste_config = /etc/nova/api-paste.ini
# nova의 설정 파일을 수정합니다.
- Selinux 및 firewalld을 설정합니다.
$ yum --enablerepo=centos-openstack-stein -y install openstack-selinux
$ semanage port -a -t http_port_t -p tcp 8778
$ firewall-cmd --add-port={6080/tcp,6081/tcp,6082/tcp,8774/tcp,8775/tcp,8778/tcp} --permanent
$ firewall-cmd --reload
- nova 서비스를 DB에 저장합니다.
$ su -s /bin/bash nova -c "nova-manage api_db sync"
$ su -s /bin/bash nova -c "nova-manage cell_v2 map_cell0"
$ su -s /bin/bash nova -c "nova-manage db sync"
$ su -s /bin/bash nova -c "nova-manage cell_v2 create_cell --name cell1"
- nova 서비스를 시작 및 자동시작을 설정합니다.
$ systemctl restart httpd
$ chown nova. /var/log/nova/nova-placement-api.log
$ for service in api consoleauth conductor scheduler novncproxy; do
systemctl start openstack-nova-$service
systemctl enable openstack-nova-$service
done
- 이상으로 controller 노드에서의 구성을 마치겠습니다.
- 하단부터의 패키지 설치는 compute노드에서 진행해주세요
- Stein 레포지터리를 활성화합니다.
$ yum -y install centos-release-openstack-stein
$ sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-OpenStack-stein.repo
# stein 패캐지를 등록합니다.
- KVM 하이퍼바이저를 구성합니다.
$ yum -y install qemu-kvm libvirt virt-install bridge-utils
# KVM 구성에 필요한 가상화 및 네트워크 도구들을 설치합니다.
$ lsmod | grep kvm
# 확인
$ systemctl start libvirtd
$ systenctk ebable libvirtd
- compute 노드에 nova 서비스를 설치 및 수정합니다.
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-nova
# nova 패키지를 설치합니다.
$ vi /etc/nova/nova.conf
[DEFAULT]
my_ip = 10.10.10.30
state_path = /var/lib/nova
enabled_apis = osapi_compute,metadata
log_dir = /var/log/nova
transport_url = rabbit://openstack:qwer1234@controller
[api]
auth_strategy = keystone
[vnc]
enabled = True
server_listen = 0.0.0.0
server_proxyclient_address = 192.168.10.102
novncproxy_base_url = http://192.168.10.102/vnc_auto.html
# vnc 화면으르 활성화 합니다. 추후 오픈스택 대시보드 혹은 vnc 클라이언트 프로그램으로 접속할 때 사용합니다.
[glance]
api_servers = http://controller:9292
[oslo_concurrency]
lock_path = $state_path/tmp
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = qwer1234
[placement]
auth_url = http://controller:5000
os_region_name = RegionOne
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = placement
password = qwer1234
[wsgi]
api_paste_config = /etc/nova/api-paste.ini
# nova의 설정 파일을 수정합니다.
- Selinux 및 firewall 설정
$ yum --enablerepo=centos-openstack-stein -y install openstack-selinux
$ firewall-cmd --add-port=5900-5999/tcp --permanent
$ firewall-cmd --reload
- nova 서비스 시작
$ systemctl start openstack-nova-compute
$ systemctl enable openstack-nova-compute
& controller# openstack compute service list
# 확인
+----+------------------+------------+----------+---------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At |
+----+------------------+------------+----------+---------+-------+----------------------------+
| 4 | nova-consoleauth | controller | internal | enabled | up | 2020-07-19T02:47:16.000000 |
| 5 | nova-conductor | controller | internal | enabled | up | 2020-07-19T02:47:12.000000 |
| 8 | nova-scheduler | controller | internal | enabled | up | 2020-07-19T02:47:12.000000 |
| 9 | nova-compute | compute | nova | enabled | up | 2020-07-19T02:47:08.000000 |
+----+------------------+------------+----------+---------+-------+----------------------------+
6. Neutron ( 네트워크 서비스 ) 구성
- Neutron 서비스르르 구성하는 과정에서는 모든 노드에 설치가 진행됩니다.
- 기본적으로 openvswithch를 중심으로 진행하며, 경우에 따라서는 linuxbridge로 서비스를 대체하는 것이 가능합니다.
- 설치 과정은 controller, compute, network 노드 순으로 진행하겠습니다.
- Neutron에 대한 설명은 Neutron을 참조해주세요.
- Neutron 사용자 추가
$ openstack user create --domain default --project service --password qwer1234 neutron
$ openstack role add --project service --user neutron admin
$ openstack service create --name neutron --description "OpenStack Networking service" network
# Netutron 사용자를 추가 및 서비스를 등록합니다.
$ export controller=10.10.10.10
$ openstack endpoint create --region RegionOne network public http://$controller:9696
$ openstack endpoint create --region RegionOne network internal http://$controller:9696
$ openstack endpoint create --region RegionOne network admin http://$controller:9696
# neutron의 endpoint를 생성합니다.
- Neutron DB 생성
$ mysql -u root -p
MariaDB [(none)]> create database neutron_ml2;
MariaDB [(none)]> grant all privileges on neutron_ml2.* to neutron@'localhost' identified by 'pw';
MariaDB [(none)]> grant all privileges on neutron_ml2.* to neutron@'%' identified by 'pw';
MariaDB [(none)]> flush privileges;
# neutron 구성을 위한 db를 생성합니다. ( 저는 편의를 위해 모든 pw로 qwer1234 설정하였습니다. )
- Neutron 설치 및 설정
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-neutron openstack-neutron-ml2
# neutron 패키지 설치
$ vi /etc/neutron/neutron.conf
[DEFAULT]
core_plugin = ml2
service_plugins = router
auth_strategy = keystone
stae_path = /var/lib/neutron
dhcp_agent_notification = True
allow_overlapping_ips = True
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
transport_url = rabbit://openstack:qwer1234@controller
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = qwer1234
[database]
connection = mysql+pymysql://neutron:qwer1234@controller/neutron_ml2
[nova]
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = qwer1234
[oslo_concurrency]
lock_path = $state_path/tmp
$ vi /etc/neutron/metadata_agent.ini
[DEFAULT]
nova_metadata_host = controller
metadata_proxy_shared_secret = metadata_secret
memcache_servers = controller:11211
# metadata_agent.ini 파일을 수정합니다.
$ vi /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan,gre,vxlan
tenant_network_types =
mechanism_drivers = openvswitch
extension_drivers = port_security
# ml2_conf.ini 파일에 설정을 수정합니다.
- 이어 nova.conf 파일에 설정을 추가합니다.
$ vi /etc/nova/nova.conf
[DEFAULT]
...
use_neutron = True
linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[neutron]
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = qwer1234
service_metadata_proxy = True
metadata_proxy_shared_secret = metadata_secret
- Selinux 및 방화벽 설정
$ yum --enablerepo=centos-openstack-stein -y install openstack-selinux
$ setsebool -P neutron_can_network on
$ setsebool -P daemons_enable_cluster_mode on
$ firewall-cmd --add-port=9696/tcp --permanent
$ firewall-cmd --reload
# Selinux 및 방화벽을 설정합니다.
- Neutron DB를 생성 및 서비스를 시작합니다.
$ ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
$ su -s /bin/bash neutron -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head"
# Neutron DB를 생성합니다.
$ systemctl start neutron-server neutron-metadata-agent
$ systemctl enable neutron-server neutron-metadata-agent
$ systemctl restart openstack-nova-api
- 이제 다음으로는 network 노드에 구현해보도록 하겠습니다.
$ yum -y install centos-release-openstack-stein
$ sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-OpenStack-stein.repo
# stein 패캐지를 등록합니다.
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-neutron openstack-neutron-ml2 openstack-neutron-openvswitch libibverbs
# neutron 패키지를 설치합니다.
- neutron 설정합니다.
$ vi /etc/neutron/neutron.conf
[DEFAULT]
core_plugin = ml2
service_plugins = router
auth_strategy = keystone
stae_path = /var/lib/neutron
allow_overlapping_ips = True
transport_url = rabbit://openstack:qwer1234@controller
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = qwer1234
[oslo_concurrency]
lock_path = $state_path/tmp
$ vi /etc/neutron/l3_agent.ini
[DEFAULT]
...
interface_driver = openvswitch
# l3_agent.ini 파일을 수정합니다.
$ vi /etc/neutron/dhcp_agent.ini
[DEFAULT]
...
interface_driver = openvswitch
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true
# dhcp_agent.ini 파일을 수정합니다.
$ vi /etc/neutron/metadata_agent.ini
[DEFAULT]
nova_metadata_host = controller
metadata_proxy_shared_secret = metadata_secret
# metadata_agent.ini 파일을 수정합니다.
$ vi /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan,gre,vxlan
tenant_network_types =
mechanism_drivers = openvswitch
extension_drivers = port_security
# ml2_conf.ini 파일에 설정을 수정합니다.
$ vi /etc/neutron/plugins/ml2/openvswitch_agent.ini
[securitygroup]
firewall_driver = openvswitch
enable_security_group = true
enable_ipset = true
# openvswitch_agent.ini 파일의 하단에 추가합니다.
- Selinux 및 방화벽 설정
$ yum --enablerepo=centos-openstack-stein -y install openstack-selinux
$ setsebool -P neutron_can_network on
$ setsebool -P haproxy_connect_any on
$ setsebool -P daemons_enable_cluster_mode on
$ vi my-ovsofctl.te
# create new
module my-ovsofctl 1.0;
require {
type neutron_t;
class capability sys_rawio;
}
#============= neutron_t ==============
allow neutron_t self:capability sys_rawio;
$ checkmodule -m -M -o my-ovsofctl.mod my-ovsofctl.te
$ semodule_package --outfile my-ovsofctl.pp --module my-ovsofctl.mod
$ semodule -i my-ovsofctl.pp
# Selinux 및 방화벽을 추가설정합니다.
- 시스템을 재시작 합니다.
$ ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
$ systemctl start openvswitch
$ systemctl enable openvswitch
$ ovs-vsctl add-br br-int
$ systemctl restart openstack-nova-compute
$ systemctl start neutron-openvswitch-agent
$ systemctl enable neutron-openvswitch-agent
- 이어서 compute 노드에서의 설정을 진행하겠습니다.
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-neutron openstack-neutron-ml2 openstack-neutron-openvswitch
# neutron 패키지를 설치합니다.
- neutron 설정합니다.
$ vi /etc/neutron/neutron.conf
[DEFAULT]
core_plugin = ml2
service_plugins = router
auth_strategy = keystone
stae_path = /var/lib/neutron
allow_overlapping_ips = True
transport_url = rabbit://openstack:qwer1234@controller
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = qwer1234
[oslo_concurrency]
lock_path = $state_path/tmp
$ vi /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan,gre,vxlan
tenant_network_types =
mechanism_drivers = openvswitch
extension_drivers = port_security
# ml2_conf.ini 파일에 설정을 수정합니다.
$ vi /etc/neutron/plugins/ml2/openvswitch_agent.ini
[securitygroup]
firewall_driver = openvswitch
enable_security_group = true
enable_ipset = true
# openvswitch_agent.ini 파일의 하단에 추가합니다.
- 이어서 Nova.conf 파일을 수정합니다.
$ vi /etc/nova/nova.conf
[DEFAULT]
...
use_neutron = True
linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
vif_plugging_is_fatal = True
vif_plugging_timeout = 300
[neutron]
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = qwer1234
service_metadata_proxy = True
metadata_proxy_shared_secret = metadata_secret
- Selinux 및 방화벽 설정
$ yum --enablerepo=centos-openstack-stein -y install openstack-selinux
$ setsebool -P neutron_can_network on
$ setsebool -P haproxy_connect_any on
$ setsebool -P daemons_enable_cluster_mode on
$ vi my-ovsofctl.te
# create new
module my-ovsofctl 1.0;
require {
type neutron_t;
class capability sys_rawio;
}
#============= neutron_t ==============
allow neutron_t self:capability sys_rawio;
$ checkmodule -m -M -o my-ovsofctl.mod my-ovsofctl.te
$ semodule_package --outfile my-ovsofctl.pp --module my-ovsofctl.mod
$ semodule -i my-ovsofctl.pp
# Selinux 및 방화벽을 추가설정합니다.
- 시스템을 재시작 합니다.
$ ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
$ systemctl start openvswitch
$ systemctl enable openvswitch
$ ovs-vsctl add-br br-int
$ for service in dhcp-agent l3-agent metadata-agent openvswitch-agent; do
systemctl start neutron-$service
systemctl enable neutron-$service
done
- 이제 이어 compute 노드에서 neutron 서비스를 설치하도록 하겠습니다.
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-neutron openstack-neutron-ml2 openstack-neutron-openvswitch
# neutron 서비스를 설치합니다.
$ vi /etc/neutron/neutron.conf
[DEFAULT]
core_plugin = ml2
service_plugins = router
auth_strategy = keystone
stae_path = /var/lib/neutron
allow_overlapping_ips = True
transport_url = rabbit://openstack:qwer1234@controller
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = qwer1234
[oslo_concurrency]
lock_path = $state_path/tmp
$ vi /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan,gre,vxlan
tenant_network_types =
mechanism_drivers = openvswitch
extension_drivers = port_security
$ vi /etc/neutron/plugins/ml2/openvswitch_agent.ini
[securitygroup]
firewall_driver = openvswitch
enable_security_group = true
enable_ipset = true
- 이어서 nova.conf 파일을 수정합니다.
$ vi /etc/nova/nova.conf
[DEFAULT]
...
use_neutron = True
linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
vif_plugging_is_fatal = True
vif_plugging_timeout = 300
[neutron]
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = qwer1234
service_metadata_proxy = True
metadata_proxy_shared_secret = metadata_secret
- Selinux 및 방화벽 설정
$ yum --enablerepo=centos-openstack-stein -y install openstack-selinux
$ setsebool -P neutron_can_network on
$ setsebool -P haproxy_connect_any on
$ setsebool -P daemons_enable_cluster_mode on
$ vi my-ovsofctl.te
# create new
module my-ovsofctl 1.0;
require {
type neutron_t;
class capability sys_rawio;
}
#============= neutron_t ==============
allow neutron_t self:capability sys_rawio;
$ checkmodule -m -M -o my-ovsofctl.mod my-ovsofctl.te
$ semodule_package --outfile my-ovsofctl.pp --module my-ovsofctl.mod
$ semodule -i my-ovsofctl.pp
# Selinux 및 방화벽을 추가설정합니다.
- 서비스를 재시작 및 등록합니다.
$ ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
$ systemctl start openvswitch
$ systemctl enable openvswitch
$ ovs-vsctl add-br br-int
$ systemctl restart openstack-nova-compute
$ systemctl start neutron-openvswitch-agent
$ systemctl enable neutron-openvswitch-agent
- 이제 다음으로는 본격적으로 neutron 네트워크를 구현해보도록 하겠습니다.
- 먼저 controller 노드에서 ml2_conf 파일을 수정 및 추가합니다.
- 위에서 tenant 타입을 비워둔 이유는, 타입에 따라 사용하는 네트워크 구조가 달라지기 때문입니다.
- 여기서는 vxlan을 사용해 구성해보도록 하겠습니다.
$ vi /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
tenant_network_types = vxlan
[ml2_type_flat]
flat_networks = physnet1
[ml2_type_vxlan]
vni_ranges = 1:1000
# ml2.conf 파일을 수정합니다
$ systemctl restart neutron-server
# neutron 서비스를 재시작 합니다.
- 이제 Network 노드에서의 설치를 진행해보도록 하겠습니다.
$ ovs-vsctl add-br br-eth1
$ ovs-vsctl add-port br-eth1 ens33
# 네트워크 브릿지를 생성하고, 네트워크 노드의 외부대역의 인터페이스 번호를 바인딩합니다.
- neutron 서비스 사용을 위한 설정을 진행합니다.
$ vi /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan,gre,vxlan
tenant_network_types = vxlan
mechanism_drivers = openvswitch
extension_drivers = port_security
[ml2_type_flat]
flat_networks = physnet1
[ml2_type_vxlan]
vni_ranges = 1:1000
# ml2_conf.ini 파일에 설정을 추가 설정합니다.
$ vi /etc/neutron/plugins/ml2/openvswitch_agent.ini
[agent]
tunnel_type = vxlan
prevent_arp_spoofing = True
[ovs]
local_ip = 10.10.10.20
bridge_mappings = physnet1:br-eth1
# openvswitch_agent.ini 파일의 하단에 추가합니다.
$ for service in dhcp-agent l3-agent metadata-agent openvswitch-agent; do systemctl restart neutron-$service
done
# neutron 서비스를 재시작합니다.
$ systemctl stop firewalld
$ systemctl disable firewalld
# 방화벽을 해제합니다.
- 바인딩 오류를 해결하기 위해 설정을 진행합니다.
$ vi /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
NAME=ens33
DEVICE=ens33
ONBOOT=yes
$ vi /var/tmp/create_interface.sh
#!/bin/bash
ip link set up br-eth1
ip addr add 192.168.10.101/24 dev br-eth1
route add default gw 192.168.10.2 dev br-eth1
echo "nameserver 8.8.8.8" > /etc/resolv.conf
$ chmod 755 /var/tmp/create_interface.sh
$ vi /etc/systemd/system/set_interface.service
[Unit]
Description=Description for sample script goes here
After=network.target
[Service]
Type=simple
ExecStart=/var/tmp/create_interface.sh
TimeoutStartSec=0
[Install]
WantedBy=default.target
$ systemctl enable set_interface
$ init 6
- 이어 compute 노드에서의 설정을 진행합니다.
$ vi /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan,gre,vxlan
tenant_network_types = vxlan
mechanism_drivers = openvswitch
extension_drivers = port_security
[ml2_type_flat]
flat_networks = physnet1
[ml2_type_vxlan]
vni_ranges = 1:1000
# ml2_conf.ini 파일에 설정을 추가 설정합니다.
$ vi /etc/neutron/plugins/ml2/openvswitch_agent.ini
[agent]
tunnel_type = vxlan
prevent_arp_spoofing = True
[ovs]
local_ip = 10.10.10.30
# openvswitch_agent.ini 파일의 하단에 추가합니다.
$ for service in dhcp-agent l3-agent metadata-agent openvswitch-agent; do systemctl restart neutron-$service
done
# neutron 서비스를 재시작합니다.
$ systemctl stop firewalld
$ systemctl disable firewalld
# 방화벽을 해제합니다.
- 확인
$ openstack network agent list
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| ID | Agent Type | Host | Availability Zone | Alive | State | Binary |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| 261bbd8f-ece9-4818-91c3-be75b928fa54 | Open vSwitch agent | network | None | :-) | UP | neutron-openvswitch-agent |
| 26376b7b-e4d0-413c-85b9-521994c41bf6 | Open vSwitch agent | compute | None | :-) | UP | neutron-openvswitch-agent |
| 8b520189-c500-47ec-b330-b84bc0a3b622 | Metadata agent | controller | None | :-) | UP | neutron-metadata-agent |
| ba443e32-a931-465f-acff-05621dac0424 | Metadata agent | network | None | :-) | UP | neutron-metadata-agent |
| be878ec2-b8c9-4923-8d01-111d7c11c8f1 | L3 agent | network | nova | :-) | UP | neutron-l3-agent |
| cb74c09d-7ec5-4457-a384-8303235adc97 | DHCP agent | network | nova | :-) | UP | neutron-dhcp-agent |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
$ openstack router create router01
$ openstack network create int --provider-network-type vxlan
$ openstack subnet create int_sub --network int \
--subnet-range 1.1.1.0/24 --gateway 1.1.1.2 \
--dns-nameserver 8.8.8.8
# 라우터와 내부대역을 생성합니다.
$ openstack router add subnet router01 int_sub
# 라우터와 내부대벽을 연결시킵니다.
$ openstack network create \
--provider-physical-network physnet1 \
--provider-network-type flat --external ext
$ openstack subnet create subnet2 \
--network ext_net --subnet-range 192.168.10.0/24 \
--allocation-pool start=192.168.10.150,end=192.168.10.200 \
--gateway 192.168.10.2 --dns-nameserver 8.8.8.8
# 외부대역을 생성합니다. 외부대역의 IP는 바인딩한 br-eth1의 IP 대역과 동일해야합니다.
$ openstack router set router01 --external-gateway ext
# 생성한 라우터의 게이트웨이를 생성한 외부대역에 바운딩시킵니다.
$ openstack network list
+--------------------------------------+------+--------------------------------------+
| ID | Name | Subnets |
+--------------------------------------+------+--------------------------------------+
| 2875f833-2d46-4740-bdd4-09c75c53e2b1 | int | 698d35ae-8d7c-436f-be1b-fcf4319eb5fe |
| 4a25933d-ed21-4a5c-a87b-4e782e93c14c | ext | 47b0ee11-b628-4260-9185-71d1dab401ea |
+--------------------------------------+------+--------------------------------------+
$ openstack subnet list
+--------------------------------------+---------+--------------------------------------+-----------------+
| ID | Name | Network | Subnet |
+--------------------------------------+---------+--------------------------------------+-----------------+
| 47b0ee11-b628-4260-9185-71d1dab401ea | ext-sub | 4a25933d-ed21-4a5c-a87b-4e782e93c14c | 192.168.10.0/24 |
| 698d35ae-8d7c-436f-be1b-fcf4319eb5fe | int-sub | 2875f833-2d46-4740-bdd4-09c75c53e2b1 | 1.1.1.0/24 |
+--------------------------------------+---------+--------------------------------------+-----------------+
$ wget http://cloud-images.ubuntu.com/releases/18.04/release/ubuntu-18.04-server-cloudimg-amd64.img -P /var/kvm/images
$ openstack image create "Ubuntu1804" --file /var/kvm/images/ubuntu-18.04-server-cloudimg-amd64.img --disk-format qcow2 --container-format bare --public
# 이미지를 다운로드 및 등록합니다.
$ openstack flavor create --ram 1024 --disk 10 --vcpus 1 m1.small
# flavor를 생성합니다.
$ ssh-keygen -q -N ""
$ openstack keypair create --public-key ~/.ssh/id_rsa.pub mykey
# keypair를 생성합니다.
$ openstack floating ip create ext
# floating ip를 생성합니다.
$ openstack create server --image Ubuntu1804 --flavor m1.small --key mykey --network int Ubuntu
$ openstack server add floating ip Ubuntu 192.168.10.170
# 인스턴스를 생성하고 floating ip를 추가합니다.
$ openstack server list
+--------------------------------------+--------+--------+-------------------------------+------------+----------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+--------+--------+-------------------------------+------------+----------+
| 75fa0186-ab63-4aaa-a27c-3f2126e5d31d | Ubuntu | ACTIVE | int=1.1.1.248, 192.168.10.170 | Ubuntu1804 | m1.small |
+--------------------------------------+--------+--------+-------------------------------+------------+----------+
$ openstack security group create open
$ openstack security group rule create --protocol icmp --ingress open
$ openstack security group rule create --protocol tcp --dst-port 22:22 open
$ openstack security group rule create --protocol tcp --dst-port 80:80 open
$ openstack server add security group Ubuntu open
# 보안그룹을 생성하고 적용시킵니다.
$ ssh ubuntu@192.168.10.170
$ ping 8.8.8.8
$ sudo apt -y install apache2
$ sudo service apache2 start
# 본체 Host에서 접속해서 확인
- 이것으로 기본적인 openstack-stein 버전의 설치를 완료하였습니다.
7. Horizon ( 대시보드 서비스 ) 구성
- Horizon은 controller 노드에서 설치가 진행됩니다.
- 에 대한 설명은 Horizone을 참조해주세요.
- Horizon 패키지 설치
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-dashboard
# Horizon 패키지를 설치합니다.
- 대시보드를 설정합니다.
$ vi /etc/openstack-dashboard/local_settings
ALLOWED_HOSTS = ['*']
# 수정
OPENSTACK_API_VERSIONS = {
"identity": 3,
"image": 3,
"volume": 3,
"compute": 2,
}
# 주석 제거 및 수정
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
# 주석 해제 및 수정
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'Default'
# 주석 제거
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
},
}
# 주석제거
OPENSTACK_HOST = "controller"
# IP 변경
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "member"
# 수정
$ vi /etc/httpd/conf.d/openstack-dashboard.conf
WSGIDaemonProcess dashboard
WSGIProcessGroup dashboard
WSGISocketPrefix run/wsgi
WSGIApplicationGroup %{GLOBAL}
# 추가
- Selinux 및 방화벽 설정
$ setsebool -P httpd_can_network_connect on
$ firewall-cmd --add-service={http,https} --permanent
$ firewall-cmd --reload
$ systemctl restart httpd
- ** DB 생성**
$ mysql -u root -p
MariaDB [(none)]> create database keystone;
MariaDB [(none)]> grant all privileges on .* to @'localhost' identified by 'pw';
MariaDB [(none)]> grant all privileges on .* to @'%' identified by 'pw';
MariaDB [(none)]> flush privileges;
# 구성을 위한 db를 생성합니다. ( 저는 편의를 위해 모든 pw로 qwer1234 설정하였습니다. )
8. Cinder ( 오브젝트 스토리지 및 블록 스토리지 구성 )
- Cinder는 기본적으로 독립적으로 storage 노드를 구성하거나 혹은 compute 노드에 추가하여 사용합니다.
- 여기서는 compute 노드에 포함하여 구성하도록 하겠습니다/
- 구성 순서는 controller > compute 노드 순으로 진행하겠습니다.
- Cinder에 대한 설명은 Cinder을 참조해주세요.
- Cinder 서비스 등록
$ source ~/admin
$ openstack user create --domain default --project service --password qwer1234 cinder
$ openstack role add --project service --user cinder admin
$ openstack service create --name cinderv3 --description "OpenStack Block service" volumev3
# cinder 사용자를 추가 및 서비스를 등록합니다.
$ export controller=10.10.10.10
$ openstack endpoint create --region RegionOne volumev3 public http://$controller:8776/v3/%\(tenant_id\)s
$ openstack endpoint create --region RegionOne volumev3 internal http://$controller:8776/v3/%\(tenant_id\)s
$ openstack endpoint create --region RegionOne volumev3 admin http://$controller:8776/v3/%\(tenant_id\)s
# cinder의 endpoint를 생성합니다.
- Cinder DB 생성
$ mysql -u root -p
MariaDB [(none)]> create database cinder;
MariaDB [(none)]> grant all privileges on cinder.* to cinder@'localhost' identified by 'pw';
MariaDB [(none)]> grant all privileges on cinder.* to cinder@'%' identified by 'pw';
MariaDB [(none)]> flush privileges;
# cinder 구성을 위한 db를 생성합니다. ( 저는 편의를 위해 모든 pw로 qwer1234 설정하였습니다. )
- cinder 패키지 설치 및 수정
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-cinder
$ vi /etc/cinder/cinder.conf
[DEFAULT]
my_ip = 10.10.10.10
log_dir = /var/log/cinder
state_path = /var/lib/cinder
auth_strategy = keystone
transport_url = rabbit://openstack:qwer1234@controller
enable_v3_api = True
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = qwer1234
[database]
connection = mysql+pymysql://cinder:qwer1234@controller/cinder
[oslo_concurrency]
lock_path = $state_path/tmp
# cinder.conf 파일을 수정합니다.
$ su -s /bin/bash cinder -c "cinder-manage db sync"
# cinder db를 동기화시킵니다.
$ systemctl start openstack-cinder-api openstack-cinder-scheduler
$ systemctl enable openstack-cinder-api openstack-cinder-scheduler
# cinder 시작 및 자동시작을 등록합니다.
$ echo "export OS_VOLUME_API_VERSION=3" >> ~/admin
$ source ~/admin
# 볼륨 버전을 API 3로 지정합니다.
$ firewall-cmd --add-port=8776/tcp --permanent
$ firewall-cmd --reload
- 이어서 compute 노드에 설치를 진행하겠습니다.
- cinder 패키지 설치 및 수정
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-cinder python2-crypto targetcli
$ vi /etc/cinder/cinder.conf
[DEFAULT]
my_ip = 10.10.10.30
log_dir = /var/log/cinder
state_path = /var/lib/cinder
auth_strategy = keystone
transport_url = rabbit://openstack:qwer1234@controller
glance_api_servers = http://controller:9292
enable_v3_api = True
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = qwer1234
[database]
connection = mysql+pymysql://cinder:qwer1234@controller/cinder
[oslo_concurrency]
lock_path = $state_path/tmp
# cinder.conf 파일을 수정합니다.
$ systemctl start openstack-cinder-volume
$ systemctl enable openstack-cinder-volume
# cinder 서비스를 시작 및 자동시작을 등록합니다.
$ controller $openstack volume service list
# 확인
+------------------+------------+------+---------+-------+----------------------------+
| Binary | Host | Zone | Status | State | Updated At |
+------------------+------------+------+---------+-------+----------------------------+
| cinder-scheduler | controller | nova | enabled | up | 2020-07-20T04:02:31.000000 |
+------------------+------------+------+---------+-------+----------------------------+
8-2. LVM으로 블록 스토리지 백엔드 구성
- compute 노드에 cinder 서비스를 설치한 것에 이어 LVM 백엔드를 설정해보도록 하겠습니다.
- VG 생성 참조
$ fdisk /dev/sd[ n ]
# 만약 디스크 파티션이 없으시면 새로 생성 후 등록합니다.
# 저는 간단하게 100G 하드를 추가한 후, cinder 이름으로 vg를 생성하였습니다.
$ vi /etc/cinder/cinder.conf
[DEFAULT]
...
enabled_backends = lvm
[lvm]
target_helper = lioadm
target_protocol = iscsi
target_ip_address = 10.10.10.30
volume_group = cinder
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_dir = $state_path/volumes
# cinder.conf의 상단에 내용을 추가설정합니다.
$ firewall-cmd --add-service=iscsi-target --permanent
$ firewall-cmd --reload
# 방화벽 설정을 추가합니다.
$ systemctl restart openstack-cinder-volume
# 서비스를 재시작합니다.
- 이어서 compute 노드의 nova.conf 파일을 수정합니다.
$ vi /etc/nova/nova.conf
[cinder]
os_region_name = RegionOne
# nova.conf의 하단에 상단의 내용을 추가합니다.
$ systemctl restart openstack-nova-compute
# nova 서비스를 재시작합니다.
$ controller $ openstack volume service list
# 생성을 확인합니다.
+------------------+-------------+------+---------+-------+----------------------------+
| Binary | Host | Zone | Status | State | Updated At |
+------------------+-------------+------+---------+-------+----------------------------+
| cinder-scheduler | controller | nova | enabled | up | 2020-07-20T04:54:52.000000 |
| cinder-volume | compute@lvm | nova | enabled | up | 2020-07-20T04:54:52.000000 |
+------------------+-------------+------+---------+-------+----------------------------+
$ controller $ openstack volume cretae --size 1 test
# 확인용 1G volume을 생성합니다.
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2020-07-20T05:00:21.000000 |
| description | None |
| encrypted | False |
| id | f09ee80f-3ec8-4eaf-a4a5-af13cccbd5ae |
| migration_status | None |
| multiattach | False |
| name | test |
| properties | |
| replication_status | None |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| type | None |
| updated_at | None |
| user_id | 296ce49d1dc94931b62a726fb64712e9 |
+---------------------+--------------------------------------+
$ openstack volume list
# 생성한 volume을 확인합니다.
+--------------------------------------+------+-----------+------+-------------+
| ID | Name | Status | Size | Attached to |
+--------------------------------------+------+-----------+------+-------------+
| f09ee80f-3ec8-4eaf-a4a5-af13cccbd5ae | test | available | 1 | |
+--------------------------------------+------+-----------+------+-------------+
8-3. LBaaS 설치
- 로드밸런싱을 위해서는 LBaaS를 사용해야 합니다.
- LBaaS에 대해서는 LBaaS를 참조해주세요.
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-neutron-lbaas net-tools
# LBaaS 서비스를 설치합니다.
$ vi /etc/neutron/neutron.conf
service_plugins = router,lbaasv2
# lbaasv2 서비스를 추가합니다.
$ vi /etc/neutron/neutron_lbaas.conf
[service_providers]
service_provider = LOADBALANCERV2:Haproxy:neutron_lbaas.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
$ vi /etc/neutron/lbaas_agent.ini
[DEFAULT]
interface_driver = openvswitch
$ su -s /bin/bash neutron -c "neutron-db-manage --subproject neutron-lbaas --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head"
$ systemctl restart neutron-server
- network 노드와 compute 노드는 동일하게 진행합니다.
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-neutron-lbaas haproxy net-tools
$ vi /etc/neutron/neutron.conf
service_plugins = router,lbaasv2
$ vi /etc/neutron/neutron_lbaas.conf
[service_providers]
service_provider = LOADBALANCERV2:Haproxy:neutron_lbaas.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
$ vi /etc/neutron/lbaas_agent.ini
[DEFAULT]
interface_driver = openvswitch
$ systemctl start neutron-lbaasv2-agent
$ systemctl enable neutron-lbaasv2-agent
8-4. LFS, LVM 기반 다중 스토리지 노드 구성
9. Swift ( 오브젝트 스토리지 서비스 ) 구성
- Swift란 오브젝트 스토리지 서비스로, 흔히 우리가 생각하는 네이버 클라우드와 거의 동일한 맥락이라 할 수 있습니다.
- swift는 기본적으로 controller에 설치하나 여기서는 비교적 자원소모가 적은 network 노드에 proxy-sever를, compute 노드를 storage로 사용하여 설치하여 진행하겠습니다.
- swift에 대한 설명은 swift을 참조해주세요.**
- swift 서비스 생성
- controlloer 노드에는 swift 관련 패키지를 설치하지는 않지만 서비스의 관리를 위해 유저, 엔드포인트, url을 생성합니다.
$ openstack user create --domain default --project service --password qwer1234 swift
$ openstack role add --project service --user swift admin
$ openstack service create --name swift --description "OpenStack Object Storage" object-store
# swfit 유저를 생성하고 관리자의 권한을 부여합니다.
$ export swift_proxy=10.10.10.20
$ openstack endpoint create --region RegionOne object-store public http://$swift_proxy:8080/v1/AUTH_%\(tenant_id\)s
$ openstack endpoint create --region RegionOne object-store internal http://$swift_proxy:8080/v1/AUTH_%\(tenant_id\)s
$ openstack endpoint create --region RegionOne object-store admin http://$swift_proxy:8080/v1/AUTH_%\(tenant_id\)s
# swift의 endpoint를 등록합니다. 여기서 proxy 서버는 네트워크 노드를 등록합니다.
- 이어서 network 노드에서의 swift 설치 및 설정을 진행하겠습니다.
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-swift-proxy python-memcached openssh-clients
# swift 서비스에 필요한 패키지를 설치합니다.
$ vi /etc/swift/proxy-server.conf
[filter:cache]
use = egg:swift#memcache
#memcache_servers = 127.0.0.1:11211
memcache_servers = controller:11211
[filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
#admin_tenant_name = %SERVICE_TENANT_NAME%
#admin_user = %SERVICE_USER%
#admin_password = %SERVICE_PASSWORD%
#admin_host = 127.0.0.1
#admin_port = 35357
#admin_protocol = http
#admin_ /tmp/keystone-signing-swift
# paste.filter_factory를 제외한 기존 정보는 주석처리
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = swift
password = qwer1234
delay_auth_decision = true
# 위에 내용을 대신 주석 추가
# proxy-server.conf 파일을 수정합니다.
# memcache_servers의 IP는 controller 노드의 IP로 수정합니다.
$ vi /etc/swift/swift.conf
[swift-hash]
#swift_hash_path_suffix = %SWIFT_HASH_PATH_SUFFIX%
swift_hash_path_suffix = swift_shared_path
swift_hash_path_prefix = swift_shared_path
- swift 서비스의 사용을 위해 account, container, object를 생성합니다.
$ swift-ring-builder /etc/swift/account.builder create 12 1 1
$ swift-ring-builder /etc/swift/container.builder create 12 1 1
$ swift-ring-builder /etc/swift/object.builder create 12 1 1
# account, container, object를 생성합니다.
# 12 = 한 클러스터 스토리지에서 생성 가능한 파티션의 수
# 1 = 오브젝트 복수 수 ( 스토리지의 개수 )
# 1 = 데이터 이동, 복제, 파티션 이동 등이 진행될 때 잠기는 최소 시간, 데이터 손실을 방지하기 위한 기능
$ swift-ring-builder /etc/swift/account.builder add r0z0-10.10.10.30:6202/device0 100
$ swift-ring-builder /etc/swift/container.builder add r0z0-10.10.10.30:6201/device0 100
$ swift-ring-builder /etc/swift/object.builder add r0z0-10.10.10.30:6200/device0 100
$ swift-ring-builder /etc/swift/account.builder rebalance
$ swift-ring-builder /etc/swift/container.builder rebalance
$ swift-ring-builder /etc/swift/object.builder rebalance
# compute 노드의 builder에 region과 zone을 추가 후 반영시킵니다.
# r = region, z = zone
$ chown swift. /etc/swift/*.gz
# swift 관련 파일의 소유권을 변경합니다.
$ systemctl start openstack-swift-proxy
$ systemctl enable openstack-swift-proxy
# 프록시 서비스를 시작합니다.
$ firewall-cmd --add-port=8080/tcp --permanent
$ firewall-cmd --reload
# 방화벽을 사용 중이라면 방화벽을 등록합니다.
- 이제 이어 storage를 구성하기 위해 compute 노드에서의 설치를 진행해보도록 하겠습니다.
- compute 노드는 이미 cinder 서비스가 동작하고 있어 기본적인 네트워크, 시간 설정, 레포지터리 지정 등은 구성이 마친 상태의 노드입니다.
- 만약 다른 노드에 구성하시거나 swift 서비스를 다중 노드로 구성하시는 경우 위와 같은 설정을 먼저 진행해주시길 바랍니다.
- 여기서는 swift 서비스를 위해 100G의 버츄얼 디스크( dev/sdc )를 추가하여 진행하였습니다.
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-swift-account openstack-swift-container openstack-swift-object xfsprogs rsync openssh-clients
# swift 서비스를 설치합니다.
$ scp root@network:/etc/swift/*.gz /etc/swift/
$ chown swift. /etc/swift/*.gz
# network 노드에서의 설정파일을 복사옵니다.
$ vi /etc/swift/swift.conf
[swift-hash]
#swift_hash_path_suffix = %SWIFT_HASH_PATH_SUFFIX%
swift_hash_path_suffix = swift_shared_path
swift_hash_path_prefix = swift_shared_path
$ swift.conf 파일을 설정합니다.
$ vi /etc/swift/account-server.conf
bind-ip = 0.0.0.0
bind_port = 6202
$ vi /etc/swift/container-server.conf
bind-ip = 0.0.0.0
bind_port = 6201
$ vi /etc/swift/object-server.conf
bind-ip = 0.0.0.0
bind_port = 6200
$ vi /etc/rsyncd.conf
pid file = /var/run/rsymcd.pid
log file = /var/log/rsymcd.log
uid = swift
gid = swift
address = compute
[account]
path = /srv/node
read only = false
write only = no
list = yes
incoming chmod = 0644
outgoing chmod = 0644
max connections = 25
lock file = /var/lock/account.lock
[container]
path = /srv/node
read only = false
write only = no
list = yes
incoming chmod = 0644
outgoing chmod = 0644
max connections = 25
lock file = /var/lock/container.lock
[object]
path = /srv/node
read only = false
write only = no
list = yes
incoming chmod = 0644
outgoing chmod = 0644
max connections = 25
lock file = /var/lock/object.lock
[swift_server]
path = /etc/swift
read only = true
write only = no
list = yes
incoming chmod = 0644
outgoing chmod = 0644
max connections = 5
lock file = /var/lock/swift_server.lock
# swift 서비스관련 파일을 수정합니다.
- compute 노드에서 disk 설정을 진행합니다.
$ mkfs.xfs -i size=1024 -s size=4096 /dev/sdb1
meta-data=/dev/sdc1 isize=1024 agcount=4, agsize=6553536 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=26214144, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=12799, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
# 디스크의 xfs의 유형으로 포맷시킵니다.
$ mkdir -p /srv/node/device0
$ mount -o noatime,nodiratime,nobarrier /dev/sdc1 /srv/node/device0
$ chown -R swift. /srv/node
# device0 디렉토리를 생성하고 해당 디렉토리에 sdb1 볼륨을 마운트시킨 후, swift로 소유권을 변경시킵니다.
$ vi /etc/fstab
/dev/sdc1 /srv/node/device0 xfs noatime,nodiratime,nobarrier 0 0
# 재부팅할 경우를 대비하여 생성한 볼륨을 fstab에 등록합니다.
- selinux 및 방화벽 관련 서비스를 설정합니다.
$ semanage fcontext -a -t swift_data_t /srv/node/device0
$ restorecon /srv/node/device0
$ firewall-cmd --add-port={873/tcp,6200/tcp,6201/tcp,6202/tcp} --permanent
$ firewall-cmd --reload
- swift 관련 서비스를 재시작합니다.
$ systemctl restart rsyncd openstack-swift-account-auditor openstack-swift-account-replicator openstack-swift-account openstack-swift-container-auditor openstack-swift-container-replicator openstack-swift-container-updater openstack-swift-container openstack-swift-object-auditor openstack-swift-object-replicator openstack-swift-object-updater openstack-swift-object
$ systemctl enable rsyncd openstack-swift-account-auditor openstack-swift-account-replicator openstack-swift-account openstack-swift-container-auditor openstack-swift-container-replicator openstack-swift-container-updater openstack-swift-container openstack-swift-object-auditor openstack-swift-object-replicator openstack-swift-object-updater openstack-swift-object
- 확인을 위해 controller 노드에 httpd를 재시작합니다.
$ systemctl restart httpd
# 대시보드 접속 후 프로젝트에서 오브젝트 스토리지가 메뉴에 있는 지를 확인합니다.
$ openstack container create test
+---------------------------------------+-----------+------------------------------------+
| account | container | x-trans-id |
+---------------------------------------+-----------+------------------------------------+
| AUTH_2ac06290d2d943d5a768fe3daa53b118 | test | tx22f3dd125f134a189602c-005f24cef1 |
+---------------------------------------+-----------+------------------------------------+
$ echo Hello > test.txt
$ swift upload test test.txt
$ swift list
test
$ swift list test
test.txt
10. Heat ( Orchestration ) 설치
- 클라우딩 컴퓨팅이 꽃인 Orchestaration 기능을 수행하는 Heat 서비스를 설치해보도록 하겠습니다.
- Heat 설치는 controller, network 노드 순으로 우리어집니다.
- Heat*에 대한 설명은 Heat을 참조해주세요.
- Heat 서비스 생성
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-heat-common python-heatclient
# heat 서비스 관련 패키지를 다운로드 합니다.
$ openstack user create --domain default --project service --password qwer1234 heat
$ openstack role add --project service --user heat admin
$ openstack role create heat_stack_owner
$ openstack role create heat_stack_user
$ openstack role add --project admin --user admin heat_stack_owner
$ openstack service create --name heat --description "Openstack Orchestration" orchestration
$ openstack service create --name heat-cfn --description "Openstack Orchestration" cloudformation
# heat 유저를 생성하고 관리자의 권한을 부여합니다.
$ export heat_api=10.10.10.20
$ openstack endpoint create --region RegionOne orchestration public http://$heat_api:8004/v1/AUTH_%\(tenant_id\)s
$ openstack endpoint create --region RegionOne orchestration internal http://$heat_api:8004/v1/AUTH_%\(tenant_id\)s
$ openstack endpoint create --region RegionOne orchestration admin http://$heat_api:8004/v1/AUTH_%\(tenant_id\)s
$ openstack endpoint create --region RegionOne cloudformation public http://$heat_api:8000/v1
$ openstack endpoint create --region RegionOne cloudformation internal http://$heat_api:8000/v1
$ openstack endpoint create --region RegionOne cloudformation admin http://$heat_api:8000/v1
# heat 서비스의 endpoint를 등록합니다. 여기서 proxy 서버는 네트워크 노드를 등록합니다.
$ openstack domain create --description "Stack projects and users" heat
$ openstack user create --domain heat --password qwer1234 heat_domain_admin
$ openstack role add --domain heat --user heat_domain_admin admin
# heat domain을 생성하고 heat 유저에게 권한을 부여합니다.
- heat의 DB를 생성합니다.
$ mysql -u root -p
MariaDB [(none)]> create database heat;
MariaDB [(none)]> grant all privileges on heat.* to heat@'localhost' identified by 'pw';
MariaDB [(none)]> grant all privileges on heat.* to keystone@'%' identified by 'pw';
MariaDB [(none)]> flush privileges;
# heat DB를 생성합니다. 여기서 pw는 qwer1234으로 모두 통일하였습니다.
- 이어서 network 노드에서 heat 서비스를 설치해보겠습니다.
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-heat-api openstack-heat-api-cfn openstack-heat-engine python-heatclient
# heat 서비스를 위한 패키지를 설치합니다.
$ vi /etc/heat/heat.conf
[DEFAULT]
deferred_auth_method = trusts
trusts_delegated_roles = heat_stack_owner
# Heat installed server
heat_metadata_server_url = http://network:8000
heat_waitcondition_server_url = http://network:8000/v1/waitcondition
heat_watch_server_url = http://network:8003
heat_stack_user_role = heat_stack_user
# Heat domain name
stack_user_domain_name = heat
# Heat domain admin name
stack_domain_admin = heat_domain_admin
# Heat domain admin's password
stack_domain_admin_password = qwer1234
# RabbitMQ connection info
transport_url = rabbit://openstack:qwer1234@controller
# MariaDB connection info
[database]
connection = mysql+pymysql://heat:qwer1234@controller/heat
# Keystone auth info
[clients_keystone]
auth_uri = http://controller:5000
# Keystone auth info
[ec2authtoken]
auth_uri = http://controller:5000
[heat_api]
bind_host = 0.0.0.0
bind_port = 8004
[heat_api_cfn]
bind_host = 0.0.0.0
bind_port = 8000
# Keystone auth info
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = heat
password = qwer1234
[trustee]
auth_plugin = password
auth_url = http://controller:5000
username = heat
password = qwer1234
user_domain_name = default
# heat.conf 파일을 수정합니다.
$ su -s /bin/bash heat -c "heat-manage db_sync"
$ systemctl start openstack-heat-api openstack-heat-api-cfn openstack-heat-engine
$ systemctl enable openstack-heat-api openstack-heat-api-cfn openstack-heat-engine
# DB의 데이터를 삽입하고, 서비스슬 등록합니다.
- 방화벽을 사용중이면 방화벽을 설정합니다.
$ firewall-cmd --add-port={8000/tcp,8004/tcp} --permanent
$ firewall-cmd --reload
$ yum --enablerepo=centos-openstack-stein,epel -y install openstack-designate-api openstack-designate-central openstack-designate-worker openstack-designate-producer openstack-designate-mdns python-designateclient bind bind-utils
# 서비스 관련 패키지를 설치합니다.
$ rndc-confgen -a -k designate -c /etc/designate.key -r /dev/urandom
$ chown named:designate /etc/designate.key
$ chmod 640 /etc/designate.key
# key를 생성합니다.
$ vi /etc/named.conf
# create new
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { none; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
# replace query range to your own environment
allow-query { localhost; 10.10.10.0/24; };
allow-new-zones yes;
request-ixfr no;
recursion no;
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
};
include "/etc/designate.key";
controls {
inet 0.0.0.0 port 953
allow { localhost; } keys { "designate"; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
$ chown -R named. /var/named
$ systemctl start named
$ systemctl enable naemd
$ vi /etc/designate/designate.conf
[DEFAULT]
log_dir = /var/log/designate
transport_url = rabbit://openstack:qwer1234@controller
root_helper = sudo designate-rootwrap /etc/designate/rootwrap.conf
[database]
connection = mysql+pymysql://heat:qwer1234@controller/heat
[service:api]
listen = 0.0.0.0:9001
auth_strategy = keystone
api_base_uri = http://controller:9001
enable_api_v2 = True
enabled_extensions_v2 = quotas, reports
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = heat
password = qwer1234
[service:worker]
enabled = True
notify = True
[storage:sqlalchemy]
connection = mysql+pymysql://heat:qwer1234@controller/heat
$ su -s /bin/sh -c "designate-manage database sync" designate
$ systemctl start designate-central designate-api
$ systemctl enable designate-central designate-api
$ vi /etc/designate/pools.yaml
# create new (replace hostname and IP address to your own environment)
- name: default
description: Default Pool
attributes: {}
ns_records:
- hostname: network.srv.world.
priority: 1
nameservers:
- host: 10.10.10.20
port: 53
targets:
- type: bind9
description: BIND9 Server
masters:
- host: 10.10.10.20
port: 5354
options:
host: 10.10.10.20
port: 53
rndc_host: 10.10.10.20
rndc_port: 953
rndc_key_file: /etc/designate.key
$ su -s /bin/sh -c "designate-manage pool update" designate
Updating Pools Configuration
$ systemctl start designate-worker designate-producer designate-mdns
$ systemctl enable designate-worker designate-producer designate-mdns
- 이어서 selinux와 방화벽을 설정합니다.
$ setsebool -P named_write_master_zones on
$ firewall-cmd --add-service=dns --permanent
$ firewall-cmd --add-port={5354/tcp,9001/tcp} --permanent
$ firewall-cmd --reload
controller> $openstack dns service list
# 확인
11. Openstack 대시보드 메인 로고 및 링크 변경
12. Neutron 기반 Service Functon Chaining ( SFC ) 기능 구성
마지막 수정일자