Nova설치 > OpenStack 자료실

본문 바로가기
사이트 내 전체검색

OpenStack 자료실

Nova설치

페이지 정보

profile_image
작성자 IaaSM
댓글 0건 조회 7,476회 작성일 21-03-12 10:07

본문

노바는  컴퓨트 인스턴스(가상 서버) 를 제공하는 서비스 입니다.

구성방법
- 해당 구성은 테스트 서버에서 구성한 내용입니다
--------------------------------------------------------------------

 controller

1. Nova, ceilometer service 및 User 생성
# openstack user create --domain default --project service --password 111111 nova
+------------------------------+--------------------------------------------------------------+
| Field                      | Value                            |
+------------------------------+--------------------------------------------------------------+
| default_project_id  | 08218a458b224d49b23f68befab3d325 |
| domain_id          | default                          |
| enabled            | True                            |
| id                          | 1b99c9bd506e4665a3bed52f3a70cd60 |
| name                | nova                            |
| options            | {}                              |
| password_expires_at | None                                    |
+------------------------------+--------------------------------------------------------------+
# openstack user create --domain default --project service --password 111111 placement
+------------------------------+--------------------------------------------------------------+
| Field                      | Value                            |
+------------------------------+--------------------------------------------------------------+
| default_project_id  | 08218a458b224d49b23f68befab3d325 |
| domain_id          | default                          |
| enabled            | True                            |
| id                          | e9fab453b3dc4c8ebc4812d404703272 |
| name                | placement                        |
| options            | {}                              |
| password_expires_at | None                                    |
+------------------------------+--------------------------------------------------------------+

# openstack role add --project service --user nova admin
# openstack role add --project service --user placement admin



# openstack service create --name nova --description "OpenStack Compute service" compute
+-------------------+---------------------------------------------------+
| Field              | Value                                    |
+-------------------+---------------------------------------------------+
| description | OpenStack Compute service        |
| enabled    | True                                    |
| id                  | 1c238f9964124a838bd1dc651a3195ca |
| name        | nova                                    |
| type                | compute                                          |
+-------------------+---------------------------------------------------+
# openstack service create --name placement --description "OpenStack Compute Placement service" placement
+-------------------+---------------------------------------------------+
| Field              | Value                                      |
+-------------------+---------------------------------------------------+
| description | OpenStack Compute Placement service |
| enabled    | True                                        |
| id                  | a1490fdffb924a908169b716e36a9f5c    |
| name        | placement                                  |
| type                | placement                                  |
+-------------------+---------------------------------------------------+

# openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1/%\(tenant_id\)s
+-------------------+---------------------------------------------------+
| Field        | Value                                    |
+-------------------+---------------------------------------------------+
| enabled      | True                                      |
| id          | 8f9076bd689e452faf112c655a61da13 |
| interface    | public                                    |
| region      | RegionOne |
| region_id    | RegionOne |
| service_id  | 1c238f9964124a838bd1dc651a3195ca |
| service_name | nova                                      |
| service_type | compute |
| url          | http://controller:8774/v2.1/%(tenant_id)s |
+--------------+--------------------------------------------------------+




# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1/%\(tenant_id\)s
+-------------------+---------------------------------------------------+
| Field        | Value                                            |
+-------------------+---------------------------------------------------+
| enabled      | True                                              |
| id                  | c3f3a0280e4f43d4b62276663017fd87 |
| interface    | internal                                          |
| region      | RegionOne         |
| region_id    | RegionOne         |
| service_id  | 1c238f9964124a838bd1dc651a3195ca |
| service_name | nova         |
| service_type | compute                 |
| url                  | http://controller:8774/v2.1/%(tenant_id)s |
+-------------------+---------------------------------------------------+
# openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1/%\(tenant_id\)s
+-------------------+---------------------------------------------------+
| Field        | Value                                    |
+-------------------+---------------------------------------------------+
| enabled      | True                                      |
| id                  | 6fa8e6b1331b49df92ad8d499afae0c1 |
| interface    | admin |
| region      | RegionOne |
| region_id    | RegionOne |
| service_id  | 1c238f9964124a838bd1dc651a3195ca |
| service_name | nova |
| service_type | compute |
| url                  | http://controller:8774/v2.1/%(tenant_id)s |
+-------------------+---------------------------------------------------+
# openstack endpoint create --region RegionOne placement public http://controller:8778
+-------------------+---------------------------------------------------+
| Field        | Value                            |
+-------------------+---------------------------------------------------+
| enabled      | True                            |
| id                  | 974ba4c06f11407f8bb993359bc56291 |
| interface    | public                          |
| region      | RegionOne                        |
| region_id    | RegionOne                        |
| service_id  | a1490fdffb924a908169b716e36a9f5c |
| service_name | placement                        |
| service_type | placement                        |
| url                  | http://controller:8778          |
+-------------------+---------------------------------------------------+
# openstack endpoint create --region RegionOne placement internal http://controller:8778
+-------------------+---------------------------------------------------+
| Field        | Value                            |
+-------------------+---------------------------------------------------+
| enabled      | True                            |
| id                  | 651d76feabbc4a95a2ee3b2e43fe89c7 |
| interface    | internal                        |
| region      | RegionOne                        |
| region_id    | RegionOne                        |
| service_id  | a1490fdffb924a908169b716e36a9f5c |
| service_name | placement                        |
| service_type | placement                        |
| url                  | http://controller:8778          |
+-------------------+---------------------------------------------------+
# openstack endpoint create --region RegionOne placement admin http://controller:8778
+-------------------+---------------------------------------------------+
| Field        | Value                            |
+-------------------+---------------------------------------------------+
| enabled      | True                            |
| id                  | 6541de2e0c374998a973f00673376939 |
| interface    | admin                            |
| region      | RegionOne                        |
| region_id    | RegionOne                        |
| service_id  | a1490fdffb924a908169b716e36a9f5c |
| service_name | placement                        |
| service_type | placement                        |
| url                  | http://controller:8778          |
+-------------------+---------------------------------------------------+

2. Nova User의 DB를 생성
# mysql -u root -p
# create database nova;
# grant all privileges on nova.* to nova@'localhost' identified by '111111';
# grant all privileges on nova.* to nova@'%' identified by '111111';
# create database nova_api;
# grant all privileges on nova_api.* to nova@'localhost' identified by '111111';
# grant all privileges on nova_api.* to nova@'%' identified by '111111';
# create database nova_cell0;
# grant all privileges on nova_cell0.* to nova@'localhost' identified by '111111';
# grant all privileges on nova_cell0.* to nova@'%' identified by '111111';
# create database placement;
# grant all privileges on placement.* to placement@'localhost' identified by '111111';
# grant all privileges on placement.* to placement@'%' identified by '111111';
# flush privileges;
# exit;


3. Nova 설치
# dnf --enablerepo=centos-openstack-ussuri,powertools,epel -y install openstack-nova openstack-placement-api
# vi /etc/nova/nova.conf
[DEFAULT]
my_ip = 10.10.10.10
# my_ip는 반드시 IP로 적어주세요 !

state_path = /var/lib/nova
enabled_apis = osapi_compute,metadata
log_dir = /var/log/nova
transport_url = rabbit://openstack:111111@controller

[api]
auth_strategy = keystone

[glance]
api_servers = http://controller:9292

[vnc]
enabled = true
server_listen = $my_ip
server_proxyclient_address = $my_ip

[oslo_concurrency]
lock_path = $state_path/tmp

[api_database]
connection = mysql+pymysql://nova:111111@controller/nova_api

[database]
connection = mysql+pymysql://nova:111111@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 = 111111

[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 = 111111

[wsgi]
api_paste_config = /etc/nova/api-paste.ini



$ controller> vi /etc/placement/placement.conf
[DEFAULT]
debug = false

[api]
auth_strategy = keystone

[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 = placement
password = 111111

[placement_database]
connection = mysql+pymysql://placement:111111@controller/placement

# vi /etc/httpd/conf.d/00-placement-api.conf
<Directory /usr/bin>
    Require all granted
</Directory>
- 15번 줄에 추가시킵니다.

# su -s /bin/bash placement -c "placement-manage db sync"
# 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"

# 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
# systemctl restart httpd
# chown placement. /var/log/placement/placement-api.log
# for service in api conductor scheduler novncproxy; do
systemctl enable --now openstack-nova-$service
done
- # Selinux 및 방화벽을 설정합니다.

# openstack compute service list
+----+--------------------+-----------------+---------+---------------+--------+----------------------------------+
| ID  | Binary        | Host | Zone  | Status          | State  | Updated At   |
+----+--------------------+-----------------+---------+---------------+--------+----------------------------------+
|  3  | nova-conductor | controller         | internal | enabled | up    | 2021-01-03T16:00:05.000000 |
|  5  | nova-scheduler | controller         | internal | enabled | up    | 2021-01-03T16:00:06.000000 |
+----+--------------------+-----------------+---------+---------------+--------+----------------------------------+



compute node Nova 설치


1. nova 설치
# dnf --enablerepo=centos-openstack-ussuri,powertools,epel -y install qemu-kvm libvirt virt-install libguestfs-tools
- KVM 관련 모듈을 설치합니다.
# systemctl enable --now libvirtd
- libvirtd 서비스를 등록 및 시작합니다.

# nmcli connection add type bridge autoconnect yes con-name br0 ifname br0
- br0의 가상 브릿지를 추가합니다.

# nmcli connection modify br0 ipv4.addresses 10.10.10.30/24 ipv4.method manual
- 가상 브리지의 IP를 추가합니다. ( compute node ip )

# nmcli connection modify br0 ipv4.gateway 10.10.10.10
- 가상 브리지의 GATEWAY를 등록합니다.

# nmcli connection modify br0 ipv4.dns 8.8.8.8
- 가상 브릿지의 DNS를 등록합니다.

# nmcli connection del ens3
- 본래의 네트워크 인터페이스를 삭제합니다.
# nmcli connection add type bridge-slave autoconnect yes con-name ens3 ifname ens3 master br0
- 삭제한 네트워크 인터페이스 대신 브릿지를 매핑시키고 네트워크를 재시작 시킵니다.
- 테스트환경 compute node의 내부대역 IP는 10.10.10.30/24 ens3입니다

# reboot
# ifconfig
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.10.10.30  netmask 255.255.255.0  broadcast 10.10.10.255
        inet6 fe80::e04b:be95:c825:9aa5  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:67:2c:da  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 24  bytes 3054 (2.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


# dnf --enablerepo=centos-openstack-ussuri,powertools,epel -y install openstack-nova-compute
- nova 및 관련 모듈을 설치합니다.

# scp /etc/nova/nova.conf compute:/etc/nova/nova.conf
- controller에서 nova의 기본설정파일을 복사합니다.

# vi /etc/nova/nova.conf
[default]
my_ip = 10.10.10.30
# my_ip는 반드시 IP로 적어주세요 !

[libvirt]
virt_type = qemu

[vnc]
enabled = True
server_listen = 0.0.0.0
server_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html
- nova관련 설정을 추가합니다.

# firewall-cmd --add-port=5900-5999/tcp --permanent
# firewall-cmd --reload
# systemctl enable --now libvirtd
# systemctl enable --now openstack-nova-compute


2. Nova 설치 확인

controller
# su -s /bin/bash nova -c "nova-manage cell_v2 discover_hosts"
- DB에 compute의 대한 설정을 업데이트 합니다.

# nova-manage cell_v2 discover_hosts --verbose
- compute 노드가 검색이 안되었을 시 추가적으로 검색합니다.



# openstack compute service list
+--------+--------------------+--------------------+---------+---------+--------+---------------------------------+
| ID | Binary | Host | Zone | Status | State    | Updated At             |
+--------+--------------------+--------------------+---------+---------+--------+---------------------------------+
|  3 | nova-conductor | controller         | internal | enabled | up     | 2021-01-03T16:24:25.000000 |
|  5 | nova-scheduler | controller         | internal | enabled | up     | 2021-01-03T16:24:26.000000 |
|  8 | nova-compute | compute  | nova | enabled | up     | 2021-01-03T16:24:26.000000 |
+--------+--------------------+--------------------+---------+---------+--------+---------------------------------+

댓글목록

등록된 댓글이 없습니다.

회원로그인

회원가입

사이트 정보

회사명 : (주)리눅스데이타시스템
대표이사 : 정정모
본사 : 강남구 봉은사로 114길 40 홍선빌딩 2층
- tel : 02-6207-1160
대전지사 : 유성구 노은로174 도원프라자 5층
- tel : 042-331-1161

접속자집계

오늘
1,818
어제
3,009
최대
3,935
전체
1,138,434
Copyright © www.linuxdata.org All rights reserved.