학교 랩실에서 단일노드 Openstack 구축하기 - Neutron(7)
1. Controller 노드
1-1. DB 구축
# mysql -u root -p
MariaDB [(none)] CREATE DATABASE neutron;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' \
IDENTIFIED BY 'NEUTRON_DB_비밀번호';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' \
IDENTIFIED BY 'NEUTRON_DB_비밀번호';
1-2. 서비스 자격 증명 생성
# . admin-openrc
# openstack user create --domain default --password-prompt neutron
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | fdb0f541e28141719b6a43c8944bf1fb |
| name | neutron |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
# openstack role add --project service --user neutron admin
# openstack service create --name neutron \
--description "OpenStack Networking" network
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Networking |
| enabled | True |
| id | f71529314dab4a4d8eca427e701d209e |
| name | neutron |
| type | network |
+-------------+----------------------------------+
# openstack endpoint create --region RegionOne \
network public http://노드_IP_주소:9696
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 85d80a6d02fc4b7683f611d7fc1493a3 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | f71529314dab4a4d8eca427e701d209e |
| service_name | neutron |
| service_type | network |
| url | http://노드_IP_주소:9696 |
+--------------+----------------------------------+
# openstack endpoint create --region RegionOne \
network internal http://노드_IP_주소:9696
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 09753b537ac74422a68d2d791cf3714f |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | f71529314dab4a4d8eca427e701d209e |
| service_name | neutron |
| service_type | network |
| url | http://노드_IP_주소:9696 |
+--------------+----------------------------------+
# openstack endpoint create --region RegionOne \
network admin http://노드_IP_주소:9696
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 1ee14289c9374dffb5db92a5c112fc4e |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | f71529314dab4a4d8eca427e701d209e |
| service_name | neutron |
| service_type | network |
| url | http://노드_IP_주소:9696 |
+--------------+----------------------------------+
1-3. 네트워크 설정 - Self-service networks
네트워크 옵션에는 Provider networks와 Self-service networks가 있다. 이번 프로젝트에서는 단일 노드로 하기 때문에 Self-service networks으로 네트워크 설정을 한다.
1-3-1. 컴포넌트 설치
# # apt install neutron-server neutron-plugin-ml2 \
neutron-linuxbridge-agent neutron-l3-agent neutron-dhcp-agent \
neutron-metadata-agent
1-3-2. 서버 컴포넌트 구성
# vim /etc/neutron/neutron.conf
[database]
# ...
connection = mysql+pymysql://neutron:NEUTRON_DB_비밀번호PASS@localhost/neutron
[DEFAULT]
# ...
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = true
transport_url = rabbit://openstack:RabbitMQ_비밀번호@localhost
auth_strategy = keystone
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = 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 = neutron
password = NEUTRON_PASS
[nova]
# ...
auth_url = http://localhost:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = NOVA_비밀번호
[oslo_concurrency]
# ...
lock_path = /var/lib/neutron/tmp
1-3-3. ML2(Modular Layer 2) 플러그인 구성
# vim /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
# ...
type_drivers = flat,vlan,vxlan
tenant_network_types = vxlan
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security
[ml2_type_flat]
# ...
flat_networks = provider
vni_ranges = 1:1000
[securitygroup]
# ...
enable_ipset = true
1-3-4.Linux bridge agent 구성
# vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:PROVIDER_INTERFACE_NAME
[vxlan]
enable_vxlan = true
local_ip = OVERLAY_INTERFACE_IP_ADDRESS
l2_population = true
[securitygroup]
# ...
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
1-3-5. 커널 파라미터 값 변경
# vim /etc/sysctl.conf
# ...
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
# sysctl -p
1-3-6. layer-3, DHCP agent 구성
# vim /etc/neutron/l3_agent.ini
[DEFAULT]
interface_driver = linuxbridge
# vim /etc/neutron/dhcp_agent.ini
[DEFAULT]
interface_driver = linuxbridge
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true
1-4. Metadata agent 구성
# vim /etc/neutron/metadata_agent.ini
[DEFAULT]
nova_metadata_host = localhost
metadata_proxy_shared_secret = METADATA_SECRET
METADATA_SECRET은 적절한 secret으로 변경한다.
Nova를 설치한 후
# vim /etc/nova/nova.conf
[neutron]
# ...
auth_url = http://localhost:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = NEUTRON_비밀번호
service_metadata_proxy = true
metadata_proxy_shared_secret = METADATA_SECRET
metadata_proxy_shared_secret은 위에서 설정한 secret을 입력한다.
1-5. 설치 완료
# su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf \
--config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron
# service nova-api restart
# service neutron-server restart
# service neutron-linuxbridge-agent restart
# service neutron-dhcp-agent restart
# service neutron-metadata-agent restart
# service neutron-l3-agent restart
2. Compute 노드
원래는 두 노드를 사용해서 따로 설정을 해줘야 하지만 단일 노드를 사용하기 때문에 같은 노드에 설정을 해주면 된다. 이미 설정이 되어있다면 확인하고 넘어가면 된다.
2-1. components 설치
# apt install neutron-linuxbridge-agent
2-2. common component 구성
# vim /etc/neutron/neutron.conf
[DEFAULT]
# ...
transport_url = rabbit://openstack:RabbitMQ_비밀번호@localhost
auth_strategy = keystone
[keystone_authtoken]
# ...
www_authenticate_uri = http://localhost:5000
auth_url = http://localhost:5000
memcached_servers = localhost:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = NEUTRON_비밀번호
[oslo_concurrency]
# ...
lock_path = /var/lib/neutron/tmp
2-3. 네트워크 설정 - Self-service networks
2-3-1. Linux bridge agent 구성
# vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:PROVIDER_INTERFACE_NAME
[vxlan]
enable_vxlan = true
local_ip = OVERLAY_INTERFACE_IP_ADDRESS
l2_population = true
[securitygroup]
# ...
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
2-4. 컴퓨팅 서비스 구성
# vim /etc/nova/nova.conf
[neutron]
# ...
auth_url = http://localhost:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = NEUTRON_비밀번호
2-5. 설치 완료
# service nova-compute restart
# service neutron-linuxbridge-agent restart
Author And Source
이 문제에 관하여(학교 랩실에서 단일노드 Openstack 구축하기 - Neutron(7)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@kwakdubu/학교-랩실에서-단일노드-Openstack-구축하기-Neutron7저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)