码迷,mamicode.com
首页 > 其他好文 > 详细

openstack(六)neutron

时间:2020-04-19 15:11:48      阅读:78      评论:0      收藏:0      [点我收藏+]

标签:su -   lse   lin   agent   color   project   none   des   database   

控制节点

yum install -y openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables

/etc/neutron/neutron.conf

技术图片
cat > /etc/neutron/neutron.conf << EOF
[DEFAULT]
auth_strategy = keystone
transport_url = rabbit://openstack:openstack@192.168.3.220
core_plugin = ml2
service_plugins =
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True

[database]
connection = mysql+pymysql://neutron:neutron@192.168.3.220/neutron

[keystone_authtoken]
auth_uri = http://192.168.3.220:5000
auth_url = http://192.168.3.220:35357
memcached_servers = 192.168.3.220:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron

[nova]
auth_url = http://192.168.3.220:35357
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
EOF
neutron.conf

/etc/neutron/plugins/ml2/ml2_conf.ini

技术图片
cat > /etc/neutron/plugins/ml2/ml2_conf.ini << EOF
[ml2]
type_drivers = flat,vlan,gre,vxlan,geneve
tenant_network_types = flat,vlan,gre,vxlan,geneve
mechanism_drivers = linuxbridge,openvswitch,l2population
extension_drivers = port_security,qos

[ml2_type_flat]
flat_networks = provider

[securitygroup]
enable_ipset = True
EOF
ml2_conf.ini

/etc/neutron/plugins/ml2/linuxbridge_agent.ini

技术图片
cat > /etc/neutron/plugins/ml2/linuxbridge_agent.ini << EOF
[linux_bridge]
physical_interface_mappings = provider:ens32

[vxlan]
enable_vxlan = False

[securitygroup]
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
enable_security_group = True
EOF
linuxbridge_agent.ini

/etc/neutron/dhcp_agent.ini

技术图片
cat > /etc/neutron/dhcp_agent.ini << EOF
[DEFAULT]
nova_metadata_host = 192.168.3.220

metadata_proxy_shared_secret = le
EOF
dhcp_agent.ini

/etc/nova/nova.conf (增加)

技术图片
[neutron]
url = http://192.168.3.220:9696
auth_url = http://192.168.3.220:35357
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 = le
增加部分

建立plugin.ini

ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini

初始化neutron数据库
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

查看表

mysql -uneutron -pneutron -e "use neutron;show tables;"

重启服务并设置开机启动

systemctl restart openstack-nova-api neutron-server neutron-linuxbridge-agent neutron-dhcp-agent neutron-metadata-agent

systemctl enable neutron-server neutron-linuxbridge-agent neutron-dhcp-agent neutron-metadata-agent 1>&2

创建服务/端点

技术图片
openstack service create --name neutron --description "OpenStack Networking" network
openstack endpoint create --region RegionOne network public http://192.168.3.220:9696
openstack endpoint create --region RegionOne network internal http://192.168.3.220:9696
openstack endpoint create --region RegionOne network admin http://192.168.3.220:9696
服务/端点

查看网络

openstack network agent list

========================================================

计算节点

yum install -y openstack-neutron openstack-neutron-linuxbridge ebtables

/etc/neutron/neutron.conf(删掉控制节数据库)

技术图片
cat > /etc/neutron/neutron.conf << EOF
[DEFAULT]
auth_strategy = keystone
transport_url = rabbit://openstack:openstack@192.168.3.220

[keystone_authtoken]
auth_uri = http://192.168.3.220:5000
auth_url = http://192.168.3.220:35357
memcached_servers = 192.168.3.220: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

EOF
neutron.conf

/etc/neutron/plugins/ml2/linuxbridge_agent.ini(和控制节点一样)

技术图片
cat > /etc/neutron/plugins/ml2/linuxbridge_agent.ini << EOF
[linux_bridge]
physical_interface_mappings = provider:ens32

[vxlan]
enable_vxlan = False

[securitygroup]
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
enable_security_group = True
EOF
linuxbridge_agent.ini

/etc/nova/nova.conf(添加neutron)

技术图片
[neutron]
url = http://192.168.3.220:9696
auth_url = http://192.168.3.220:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron
nova.conf

配置开机启动并启动服务

systemctl restart neutron-linuxbridge-agent openstack-nova-compute

systemctl enable neutron-linuxbridge-agent 1>&2 

========================================================

openstack network agent list

openstack(六)neutron

标签:su -   lse   lin   agent   color   project   none   des   database   

原文地址:https://www.cnblogs.com/Leaders543/p/12731406.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!