###########################################
############# ctr.park.com 컨트롤러 세팅 ##########
###########################################
DB생성
[root@controller ~]# mysql -u root -p
MariaDB [(none)]> create database nova;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> create database nova_api;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> create database nova_cell0;
Query OK, 1 row affected (0.01 sec)
MariaDB [(none)]> create database nova_placement;
Query OK, 1 row affected (0.00 sec)
db계정 권한 설정
MariaDB [(none)]> grant all privileges on nova.* to nova@'localhost' identified by 'nova';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all privileges on nova.* to nova@'%' identified by 'nova';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all privileges on nova_api.* to nova@'localhost' identified by 'nova';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all privileges on nova_api.* to nova@'%' identified by 'nova';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all privileges on nova_cell0.* to nova@'localhost' identified by 'nova';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all privileges on nova_cell0.* to nova@'%' identified by 'nova';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all privileges on nova_placement.* to nova@'localhost' identified by 'nova';
Query OK, 0 rows affected (0.01 sec)
MariaDB [(none)]> grant all privileges on nova_placement.* to nova@'%' identified by 'nova';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
인증
[root@controller ~]# source ~/keystonerc
계정생성
[root@controller ~]# openstack user create --domain default --password-prompt nova
User Password: nova
Repeat User Password: nova
[root@controller ~]# openstack role add --project service --user nova admin
[root@controller ~]# openstack service create --name nova --description "OpenStack Compute" compute
[root@controller ~]# openstack endpoint create --region RegionOne compute public http://192.168.100.110:8774/v2.1
[root@controller ~]# openstack endpoint create --region RegionOne compute admin http://192.168.100.110:8774/v2.1
[root@controller ~]# openstack endpoint create --region RegionOne compute internal http://192.168.100.110:8774/v2.1
[root@controller ~]# openstack user create --domain default --password-prompt placement
User Password: placement
Repeat User Password: placement
[root@controller ~]# openstack role add --project service --user placement admin
[root@controller ~]# openstack service create --name placement --description "Compute Placement API" placement
[root@controller ~]# openstack endpoint create --region RegionOne placement public http://192.168.100.110:8778
[root@controller ~]# openstack endpoint create --region RegionOne placement internal http://192.168.100.110:8778
[root@controller ~]# openstack endpoint create --region RegionOne placement admin http://192.168.100.110:8778
[root@controller ~]# openstack user list
[root@controller ~]# openstack service list
[root@controller ~]# openstack endpoint list
[root@controller ~]# yum -y install openstack-nova
[root@controller ~]# cp /etc/nova/nova.conf /etc/nova/nova.conf.bak
[root@controller ~]# vi /etc/nova/nova.conf
[DEFAULT]
#compute meta 허용
enabled_apis = osapi_compute,metadata
#rabbit mq 서렂ㅇ
transport_url = rabbit://openstack:password@192.168.100.110
#compute 관리 ip
my_ip = 192.168.100.110
#neutron 네트워킹 사용 허가
use_neutron = true
firewall_driver = nova.virt.firewall.NoopFirewallDriver
#keystone 인증
[api]
auth_strategy = keystone
# controller node의 관리 IP를 사용하도록 VNC proxy 구성
[vnc]
enabled = true
server_listen = $my_ip
server_proxyclient_address = $my_ip
#glance api 설정
[glance]
api_servers = http://192.168.100.110:9292
#lock 경로 설정
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
#nova api db 접근 설정
[api_database]
connection = mysql+pymysql://nova:nova@192.168.100.110/nova_api
#nova db 접근 설정
[database]
connection = mysql+pymysql://nova:nova@192.168.100.110/nova
keyston 설정
[keystone_authtoken]
auth_url = http://192.168.100.110:5000/v3
memcached_servers = 192.168.100.110:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
#placement api 설정
[placement]
region_name = RegionOne
project_domain_name = default
project_name = service
auth_type = password
user_domain_name = default
auth_url = http://192.168.100.110:5000/v3
username = placement
password = placement
#placement db 설정
[placement_database]
connection = mysql+pymysql://nova:nova@192.168.100.110/nova_placement
[wsgi]
api_paste_config = /etc/nova/api-paste.ini
[root@controller ~]# chmod 640 /etc/nova/nova.conf
[root@controller ~]# chgrp nova /etc/nova/nova.conf
[root@controller ~]# vi /etc/httpd/conf.d/00-nova-placement-api.conf
Listen 8778
<VirtualHost *:8778>
WSGIProcessGroup nova-placement-api
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIDaemonProcess nova-placement-api processes=3 threads=1 user=nova group=nova
WSGIScriptAlias / /usr/bin/nova-placement-api
<Directory /usr/bin>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
<IfVersion < 2.4>
order allow,deny
Allow from all
</IfVersion>
</Directory>
ErrorLog /var/log/nova/nova-placement-api.log
#SSLEngine On
#SSLCertificateFile ...
#SSLCertificateKeyFile ...
</VirtualHost>
Alias /nova-placement-api /usr/bin/nova-placement-api
<Location /nova-placement-api>
SetHandler wsgi-script
Options +ExecCGI
WSGIProcessGroup nova-placement-api
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
</Location>
[root@controller ~]# su -s /bin/bash nova -c "nova-manage api_db sync"
[root@controller ~]# su -s /bin/bash nova -c "nova-manage cell_v2 map_cell0 --database_connection mysql+pymysql://nova:nova@192.168.100.110/nova_cell0"
[root@controller ~]# su -s /bin/bash nova -c "nova-manage db sync" //워닝은 상관없이 db 다 들어감
[root@controller ~]# su -s /bin/bash nova -c "nova-manage cell_v2 create_cell --name cell1 --database_connection mysql+pymysql://nova:nova@192.168.100.110/nova --transport-url rabbit://openstack:password@192.168.100.110:5672"
[root@controller ~]# nova-manage cell_v2 list_cells
[root@controller ~]# systemctl restart httpd
[root@controller ~]# chown nova. /var/log/nova/nova-placement-api.log
[root@controller ~]# systemctl enable openstack-nova-api openstack-nova-consoleauth openstack-nova-scheduler openstack-nova-conductor openstack-nova-novncproxy
[root@controller ~]# systemctl start openstack-nova-api openstack-nova-consoleauth openstack-nova-scheduler openstack-nova-conductor openstack-nova-novncproxy
[root@controller ~]# systemctl status openstack-nova-api
[root@controller ~]# lsof -i tcp:6080
[root@controller ~]# lsof -i tcp:8774
[root@controller ~]# lsof -i tcp:8778
[root@controller ~]# openstack compute service list //3개 나옴
[root@controller ~]# ls -l /var/log/nova
###########################################
############# cpt.park.com 컴퓨트 세팅 ##########
###########################################
[root@compute ~]# yum -y install centos-release-openstack-rocky
[root@compute ~]# yum -y install openstack-nova-compute qemu-kvm libvirt virt-install bridge-utils
[root@compute ~]# cp /etc/nova/nova.conf /etc/nova/nova.conf.bak
[root@compute ~]# vi /etc/nova/nova.conf
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:password@192.168.100.110
my_ip = 192.168.100.111
use_neutron = true
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api]
auth_strategy = keystone
[vnc]
enable = true
server_listen = 0.0.0.0
server_proxyclient_address = $my_ip
novncproxy_base_url = http://192.168.100.110:6080/vnc_auto.html
[glance]
api_servers = http://192.168.100.110:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[keystone_authtoken]
auth_url = http://192.168.100.110:5000/v3
memcached_servers = 192.168.100.110:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
[placement]
region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://192.168.100.110:5000/v3
username = placement
password = placement
[wsgi]
api_paste_config = /etc/nova/api-paste.ini
[root@compute ~]# chgrp nova /etc/nova/nova.conf
[root@compute ~]# chmod 640 /etc/nova/nova.conf
[root@compute ~]# lsmod | grep kvm
[root@compute ~]# systemctl start libvirtd openstack-nova-compute
[root@compute ~]# systemctl enable libvirtd openstack-nova-compute
[root@compute ~]# systemctl status openstack-nova-compute
//가상cpu 세팅 되었는지 확인 0이면 가상cpu 활성화 안된것, vmware workstation에서 활성화 해줘야함
[root@compute ~]# egrep -c '(vmx|svm)' /proc/cpuinfo
[root@compute ~]# ls -l /var/log/nova/
....
-rw-r--r--. 1 nova nova 10526 Jan 18 20:01 nova-compute.log
###########################################
############# ctr.park.com 컨트롤러 세팅 ##########
###########################################
인증
[root@controller ~]# source ~/keystonerc
//리스트 compute 확인
[root@controller ~]# openstack compute service list
//컴퓨트 1개 확인
[root@controller ~]# openstack compute service list --service nova-compute
//노바 host 찾음
[root@controller ~]# su -s /bin/bash nova -c "nova-manage cell_v2 discover_hosts --verbose"
[root@controller ~]# openstack compute service list
//하이퍼바이저에서 사용되는 노드 확인
[root@controller ~]# openstack hypervisor list
cell과 placement api 동작 여부 확인
[root@controller ~]# nova-status upgrade check
category 확인
[root@controller ~]# openstack catalog list
image 리스트 확인
[root@controller ~]# openstack image list
참고 : it00.tistory.com/18?category=808035
'openstack' 카테고리의 다른 글
openstack - neutron 설치 (0) | 2021.01.19 |
---|---|
openstack- horizon 설치 (0) | 2021.01.18 |
openstack - glance 설치 (0) | 2021.01.18 |
openstack - keystone 설치 (0) | 2021.01.16 |
openstack - host vm setting (0) | 2021.01.12 |