본문 바로가기
Openstack

9. 오픈스택: compute 추가

by 왈레 2023. 4. 6.

compute 노드에서 진행 

지금까지 컨트롤러 노드에서 오픈스택에 필요한 기본 패키지 설치하였고 필수 컴포넌트인

keystone, glance, placement, nova, neutron, horizon, cinder도 설치하였다.

또한 실제 cinder 서버(리눅스)를 설치하고 거기에서도 cinder 컴포넌트(패키지)를 설치
컨트롤러 서버와 연동도 확인했다.

 

앞으로는 실제로 가상자원이 할당되는 서버인 compute 서버(리눅스)를 설치하고,  오픈스택 컴포넌트인

nova와 neutron을 설치하면 이젠 정말로 오픈스택을 사용할 수 있게 된다.

 

작업 순서

  1. 패키지 리파지토리 변경
  2. /etc/hosts 설정
  3. NTP 설치
  4. nova 설치
  5. neutron 설치

 

설치

# 우분투 22.04, 오픈스택 zed인경우 
$ add-apt-repository cloud-archive:zed

# /etc/hosts
$ vi /etc/hosts # 컨트롤러 노드 복붙

# NTP 설치 및 설정
$ apt install chrony # NTP 단점을 개선한 시간 동기화 프로토콜
$ cp /etc/chrony/chrony.conf /etc/chrony/chrony.conf.org
$ vi /etc/chrony/chrony.conf
# 주석처리 pool ntp.ubuntu.com        iburst maxsources 4
# 주석처리 pool 0.ubuntu.pool.ntp.org iburst maxsources 1
# 주석처리 pool 1.ubuntu.pool.ntp.org iburst maxsources 1
# 주석처리 pool 2.ubuntu.pool.ntp.org iburst maxsources 2
server controller iburst # 추가된 코드

# 설명
# pool... 코드는 실제 타임서버에서 시간을 가져와 동기화 시키는 코드이다
# compute서버들은 controller 서버타임과 시간을 맞추도록 설정하는 것

# NTP 검증
$ chronyc sources -v # ^?가 뜨면안되고 ^*가 떠야함 (조금 기다려야함)

# Nova 설정
$ apt install nova-compute
$ cp /etc/nova/nova.conf /etc/nova/nova.conf.org
$ grep -E '^[^#].' /etc/nova/nova.conf.org > /etc/nova/nova.conf
$ vi /etc/nova/nova.conf # 밑에 참고, 모든 내용을 복붙하고 첫번째 1줄만 수정
$ service nova-compute restart

# Nova 검증
########## controller 노드에서 진행 시작 ########
$ su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
$ openstack compute service list
########## controller 노드에서 진행 끝 ##########

# neutron 설치 및 설정 (compute 노드에서 진행)
$ apt install neutron-linuxbridge-agent

# neutron.conf 설정
$ cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.org
$ grep -E '^[^#].' /etc/neutron/neutron.conf.org > /etc/neutron/neutron.conf
$ vi /etc/neutron/neutron.conf # 밑에 참고, 수정없이 모든 내용 복붙

# linuxbridge_agent.ini 설정
$ cp /etc/neutron/plugins/ml2/linuxbridge_agent.ini /etc/neutron/plugins/ml2/linuxbridge_agent.ini.org
$ grep -E '^[^#].' /etc/neutron/plugins/ml2/linuxbridge_agent.ini.org > /etc/neutron/plugins/ml2/linuxbridge_agent.ini
$ vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini  # 밑에 참고, 모든 내용 복붙 후 2줄 수정) 
$ service nova-compute restart
$ service neutron-linuxbridge-agent restart

# neutron 검증 (controller에서 진행)
$ openstack network agent list
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| ID                                   | Agent Type         | Host       | Availability Zone | Alive | State | Binary                    |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| 37c563fa-c9f3-46cf-aab2-590bac2f451b | Linux bridge agent | compute2   | None              | :-)   | UP    | neutron-linuxbridge-agent |
| 828364c2-99cd-488f-afa2-d7caa8cb0b4b | Metadata agent     | controller | None              | :-)   | UP    | neutron-metadata-agent    |
| 9a3cbf78-9005-44e2-9f8e-068eb5be318b | Linux bridge agent | controller | None              | :-)   | UP    | neutron-linuxbridge-agent |
| b9c24d0f-27f6-443a-8d0c-85d89ed78514 | L3 agent           | controller | nova              | :-)   | UP    | neutron-l3-agent          |
| ba7a2a35-4455-4fa6-b908-e13d9c7c4924 | Linux bridge agent | compute3   | None              | :-)   | UP    | neutron-linuxbridge-agent |
| bc028443-fb97-4dfd-a35b-597eddee8233 | DHCP agent         | controller | nova              | :-)   | UP    | neutron-dhcp-agent        |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+

 

 

/etc/nova/nova.conf (1줄 수정)

[DEFAULT]
my_ip = 10.0.0.31 # 이 부분만 compute ip로 변경해주면 댐 (10점대 영역)
transport_url = rabbit://openstack:a@controller
log_dir = /var/log/nova 
lock_path = /var/lock/nova
state_path = /var/lib/nova

[api]
auth_strategy = keystone

[api_database]
connection = sqlite:////var/lib/nova/nova_api.sqlite

[barbican]
[cache]
[cinder]
[compute]
[conductor]
[console]
[consoleauth]
[cors]
[cyborg]

[database]
connection = sqlite:////var/lib/nova/nova.sqlite

[devices]
[ephemeral_storage_encryption]
[filter_scheduler]

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

[guestfs]
[healthcheck]
[hyperv]
[image_cache]
[ironic]
[key_manager]
[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 = nova
password = a

[libvirt]
[metrics]
[mks]

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

[notifications]

[oslo_concurrency]
lock_path = /var/lib/nova/tmp

[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_middleware]
[oslo_policy]
[pci]

[placement]
region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = <http://controller:5000/v3>
username = placement
password = a

[powervm]
[privsep]
[profiler]
[quota]
[rdp]
[remote_debug]
[scheduler]
[serial_console]
[service_user]
[spice]
[upgrade_levels]
[vault]
[vendordata_dynamic_auth]
[vmware]

[vnc]
enabled = true
server_listen = 0.0.0.0
server_proxyclient_address = $my_ip
novncproxy_base_url = <http://controller:6080/vnc_auto.html>

[workarounds]
[wsgi]
[xenserver]
[zvm]

[cells]
enable = False

[os_region_name]
openstack =

 

/etc/neutron/neutron.conf (수정없이 그대로 사용)

[DEFAULT]
transport_url = rabbit://openstack:a@controller
core_plugin = ml2
auth_strategy = keystone

[agent]
root_helper = "sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf"
[cors]
[database]
connection = sqlite:////var/lib/neutron/neutron.sqlite
[ironic]
[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 = a
[nova]
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_middleware]
[oslo_policy]
[privsep]
[quotas]
[ssl]

 

/etc/neutron/plugins/m12/linuxbridge_agent.ini (2줄 수정)

[DEFAULT]
[agent]
[linux_bridge]
physical_interface_mappings = provider:카드이름 # 수정 (172 영역대 ip 인터페이스 카드이름)
[network_log]
[securitygroup]
enable_security_group = true 
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
[vxlan]
enable_vxlan = true
local_ip = 10.0.0.31 # 수정 (10 영역대 자신의 ip)
l2_population = true

'Openstack' 카테고리의 다른 글

오픈스택: magnum  (0) 2023.04.10
오픈스택: heat  (0) 2023.04.10
8. 오픈스택: cinder(블록 스토리지) 설치(2)  (0) 2023.04.06
7. 오픈스택: cinder(블록 스토리지) 설치(1)  (0) 2023.04.06
6. 오픈스택: horizon 설치  (0) 2023.04.06

댓글