Cài đặt và cấu hình Liberty OpenStack – Phần 3
Cài đặt Neutron trên Controller Node
mysql -u root -pOpenstack12345
CREATE DATABASE neutron;
GRANT ALL PRIVILEGES ON neutron.*TO 'neutron'@'localhost'IDENTIFIED BY Openstack12345';
GRANT ALL PRIVILEGES ON neutron.*TO 'neutron'@'%'IDENTIFIED BY Openstack12345';
exit;
openstack user create --domain default --password Openstack12345 neutron
openstack role add --project service --user neutron admin
openstack service create --name neutron --description "OpenStack Networking"network
openstack endpoint create --region RegionOne network public http://10.10.10.120:9696
openstack endpoint create --region RegionOne network internal http://10.10.10.120:9696
openstack endpoint create --region RegionOne network admin http://10.10.10.120:9696
apt-get -y install neutron-server neutron-plugin-ml2 \
neutron-plugin-linuxbridge-agent neutron-l3-agent neutron-dhcp-agent \
neutron-metadata-agent python-neutronclient
cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bak
rm /etc/neutron/neutron.conf
[DEFAULT]
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True
rpc_backend = rabbit
auth_strategy = keystone
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
nova_url = http://10.10.10.120:8774/v2
verbose = True
[matchmaker_redis]
[matchmaker_ring]
[quotas]
[agent]
root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
[keystone_authtoken]
auth_uri = http://10.10.10.120:5000
auth_url = http://10.10.10.120:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = neutron
password = Openstack12345
[database]
connection = mysql+pymysql://neutron:Openstack12345@10.10.10.120/neutron
[nova]
auth_url = http://10.10.10.120:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
region_name = RegionOne
project_name = service
username = nova
password = Openstack12345
[oslo_concurrency]
lock_path = $state_path/lock
[oslo_policy]
[oslo_messaging_amqp]
[oslo_messaging_qpid]
[oslo_messaging_rabbit]
rabbit_host = 10.10.10.120
rabbit_userid = openstack
rabbit_password = Openstack12345
[qos]
cp /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.bak
[ml2]
tenant_network_types = vxlan
type_drivers = flat,vlan,vxlan
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security
[ml2_type_flat]
flat_networks = public
[ml2_type_vlan]
[ml2_type_gre]
[ml2_type_vxlan]
vni_ranges = 1:1000
[ml2_type_geneve]
[securitygroup]
enable_ipset = True
Configure the Linux bridge agent
cp /etc/neutron/plugins/ml2/linuxbridge_agent.ini /etc/neutron/plugins/ml2/linuxbridge_agent.ini.bak
- Sửa file linuxbridge_agent.ini bằng lệnh `/etc/neutron/plugins/ml2/linuxbridge_agent.ini`với nội dung dưới
```sh
[linux_bridge]
physical_interface_mappings = public:eth1
[vxlan]
enable_vxlan = True
local_ip = 10.10.10.120
l2_population = True
[agent]
prevent_arp_spoofing = True
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
Cấu hình cho layer-3 agent
cp /etc/neutron/l3_agent.ini /etc/neutron/l3_agent.ini.bak
Xóa file /etc/neutron/l3_agent.ini
rm /etc/neutron/l3_agent.ini
-Sửa file /etc/neutron/l3_agent.ini bằng lệnh vi /etc/neutron/l3_agent.ini với nội dung dưới
[DEFAULT]
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
external_network_bridge =
verbose = True
[AGENT]
Cấu hình DHCP agent
cp /etc/neutron/dhcp_agent.ini /etc/neutron/dhcp_agent.ini.bak
[DEFAULT]
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = True
verbose = True
dnsmasq_config_file = /etc/neutron/dnsmasq-neutron.conf
[AGENT]
echo"dhcp-option-force=26,1450">/etc/neutron/dnsmasq-neutron.conf
cp /etc/neutron/metadata_agent.ini /etc/neutron/metadata_agent.ini.bak
-Sửa file sau với lệnh vi /etc/neutron/metadata_agent.ini chứa nội dung dưới
DEFAULT]
auth_uri = http://10.10.10.120:5000
auth_url = http://10.10.10.120:35357
auth_region = RegionOne
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = neutron
password = Openstack12345
nova_metadata_ip = 10.10.10.120
metadata_proxy_shared_secret = Openstack12345
verbose = True
[neutron]
url = http://10.10.10.120:9696
auth_url = http://10.10.10.120:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
region_name = RegionOne
project_name = service
username = neutron
password = Openstack12345
service_metadata_proxy = True
metadata_proxy_shared_secret = Openstack12345
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-plugin-linuxbridge-agent restart
service neutron-dhcp-agent restart
service neutron-metadata-agent restart
service neutron-l3-agent restart
rm -f /var/lib/neutron/neutron.sqlite
Cài đặt thành phần của neutron trên COMPUTE NODE
apt-get -y install neutron-plugin-linuxbridge-agent
cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bak
[DEFAULT]
core_plugin = ml2
rpc_backend = rabbit
auth_strategy = keystone
verbose = True
[matchmaker_redis]
[matchmaker_ring]
[quotas]
[agent]
root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
[keystone_authtoken]
auth_uri = http://10.10.10.120:5000
auth_url = http://10.10.10.120:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = neutron
password = Openstack12345
[database]
# connection = sqlite:////var/lib/neutron/neutron.sqlite
[nova]
[oslo_concurrency]
lock_path = $state_path/lock
[oslo_policy]
[oslo_messaging_amqp]
[oslo_messaging_qpid]
[oslo_messaging_rabbit]
rabbit_host = 10.10.10.120
rabbit_userid = openstack
rabbit_password = Openstack12345
[qos]
Configure the Linux bridge agent
cp /etc/neutron/plugins/ml2/linuxbridge_agent.ini /etc/neutron/plugins/ml2/linuxbridge_agent.ini.bak
[linux_bridge]
physical_interface_mappings = public:eth1
[vxlan]
enable_vxlan = True
local_ip = 10.10.10.121
l2_population = True
[agent]
prevent_arp_spoofing = True
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
[neutron]
url = http://10.10.10.120:9696
auth_url = http://10.10.10.120:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
region_name = RegionOne
project_name = service
username = neutron
password = Openstack12345
service nova-compute restart
service neutron-plugin-linuxbridge-agent restart
Cai dat dashboad tren CONTROLLER
apt-get -y install openstack-dashboard
» Tin mới nhất:
» Các tin khác: