网络服务neutron服务器端的安装及配置
1.创建数据库
# mysql -u root -p123456
mysql> CREATE DATABASE neutron;
mysql> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' \
IDENTIFIED BY 'NEUTRON_DBPASS';
mysql> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' \
IDENTIFIED BY 'NEUTRON_DBPASS';
2.获取admin权限
# . admin-openrc
3.创建neutron服务
# openstack user create --domain default --password-prompt neutron
[iyunv@controller ~]# openstack user create --domain default --password-prompt neutron
User Password:123456
Repeat User Password:123456
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | f510da80ec9948009e8d62dad74177fe |
| name | neutron |
| password_expires_at | None |
+---------------------+----------------------------------+
# openstack role add --project service --user neutron admin
# openstack service create --name neutron \
--description "OpenStack Networking" network
[iyunv@controller ~]# openstack service create --name neutron \
> --description "OpenStack Networking" network
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Networking |
| enabled | True |
| id | 49d146c23d8e4bb3b936a504b6961eed |
| name | neutron |
| type | network |
+-------------+----------------------------------+
4.创建网络服务API端点
$ openstack endpoint create --region RegionOne \
network public http://controller:9696
[iyunv@controller ~]# openstack endpoint create --region RegionOne \
> network public http://controller:9696
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | c05e3a81d744442db25c180556cb4083 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 49d146c23d8e4bb3b936a504b6961eed |
| service_name | neutron |
| service_type | network |
| url | http://controller:9696 |
+--------------+----------------------------------+
# openstack endpoint create --region RegionOne \
network internal http://controller:9696
[iyunv@controller ~]# openstack endpoint create --region RegionOne \
> network internal http://controller:9696
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 8c5eccd7a5594dbf836299dec3fd9f3c |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 49d146c23d8e4bb3b936a504b6961eed |
| service_name | neutron |
| service_type | network |
| url | http://controller:9696 |
+--------------+----------------------------------+
# openstack endpoint create --region RegionOne \
network admin http://controller:9696
[iyunv@controller ~]# openstack endpoint create --region RegionOne \
> network admin http://controller:9696
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | da4a06f7c16b4a4e87e0e20ba00285d8 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 49d146c23d8e4bb3b936a504b6961eed |
| service_name | neutron |
| service_type | network |
| url | http://controller:9696 |
+--------------+----------------------------------+
网络选择网络1模式:Provider networks
4.安装软件包
# yum install openstack-neutron openstack-neutron-ml2 \
openstack-neutron-linuxbridge ebtables -y
5.编辑 /etc/neutron/neutron.conf
[iyunv@controller ~]# cd /etc/neutron/
[iyunv@controller neutron]# cp neutron.conf neutron.conf.bak
[iyunv@controller neutron]# egrep -v "^$|^#" neutron.conf.bak > neutron.conf
[iyunv@controller neutron]# vim neutron.conf
[database]
...
connection = mysql+pymysql://neutron:NEUTRON_DBPASS@controller/neutron
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = neutron
password = 123456
[nova]
...
auth_url = http://controller:35357
auth_type = password
project_domain_name = Default
user_domain_name = Default
region_name = RegionOne
project_name = service
username = nova
password = 123456
[oslo_concurrency]
...
lock_path = /var/lib/neutron/tmp
[DEFAULT]
core_plugin = ml2
service_plugins =
transport_url = rabbit://openstack:RABBIT_PASS@controller
auth_strategy = keystone
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
6.编辑/etc/neutron/plugins/ml2/ml2_conf.ini
[iyunv@controller ~]# cd /etc/neutron/plugins/ml2/
[iyunv@controller ml2]# cp ml2_conf.ini ml2_conf.ini.bak
[iyunv@controller ml2]# egrep -v "^$|^#" ml2_conf.ini.bak > ml2_conf.ini
[iyunv@controller ml2]# vim ml2_conf.ini
[ml2]
...
type_drivers = flat,vlan
tenant_network_types =
mechanism_drivers = linuxbridge
extension_drivers = port_security
[ml2_type_flat]
...
flat_networks = provider
[securitygroup]
...
enable_ipset = True
6.编辑/etc/neutron/plugins/ml2/linuxbridge_agent.ini
[iyunv@controller ~]# cd /etc/neutron/plugins/ml2/
[iyunv@controller ml2]# cp linuxbridge_agent.ini linuxbridge_agent.ini.bak
[iyunv@controller ml2]# egrep -v "^$|^#" linuxbridge_agent.ini.bak >linuxbridge_agent.ini
[iyunv@controller ml2]# vim linuxbridge_agent.ini
[linux_bridge]physical_interface_mappings = provider:eth0
[vxlan]enable_vxlan = False
[securitygroup]
...
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
7.编辑/etc/neutron/dhcp_agent.ini
[iyunv@controller ~]# cd /etc/neutron/
[iyunv@controller neutron]# cp dhcp_agent.ini dhcp_agent.ini.bak
[iyunv@controller neutron]# egrep -v "^$|^#" dhcp_agent.ini.bak > dhcp_agent.ini
[iyunv@controller neutron]# vim dhcp_agent.ini
[DEFAULT]
...
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = True
8.修改/etc/neutron/metadata_agent.ini
[iyunv@controller ~]# cd /etc/neutron/
[iyunv@controller neutron]# cp metadata_agent.ini metadata_agent.ini.bak
[iyunv@controller neutron]# egrep -v "^$|^#" metadata_agent.ini.bak metadata_agent.ini
[iyunv@controller neutron]# egrep -v "^$|^#" metadata_agent.ini.bak > metadata_agent.ini
[iyunv@controller neutron]# vim metadata_agent.ini
[DEFAULT]
...
nova_metadata_ip = controller
metadata_proxy_shared_secret = mate
8.编辑/etc/nova/nova.conf
[iyunv@controller ~]# cd /etc/nova/
[iyunv@controller nova]# cp nova.conf nova.conf.nova
[iyunv@controller nova]# vim nova.conf
[neutron]
...
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = Default
user_domain_name = Default
region_name = RegionOne
project_name = service
username = neutron
password = NEUTRON_PASS
service_metadata_proxy = True
metadata_proxy_shared_secret = mate
9.创建链接
1
# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
10.导入数据库
# 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
11.重启nova-api服务
# systemctl restart openstack-nova-api.service
12.启动服务
# systemctl enable neutron-server.service \
neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
neutron-metadata-agent.service
# systemctl start neutron-server.service \
neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
neutron-metadata-agent.service
# systemctl enable neutron-l3-agent.service
# systemctl start neutron-l3-agent.service
13.验证
[iyunv@controller nova]# openstack network agent list
+--------------------------------------+--------------------+----------------------+-------------------+-------+-------+---------------------------+
| ID | Agent Type | Host | Availability Zone | Alive | State | Binary |
+--------------------------------------+--------------------+----------------------+-------------------+-------+-------+---------------------------+
| 698c8ca2-3090-4c0c-99c6-c057372b964f | Linux bridge agent | controller.novalocal | None | True | UP | neutron-linuxbridge-agent |
| 75342101-7cc6-449f-93aa-915b145d071e | Metadata agent | controller.novalocal | None | True | UP | neutron-metadata-agent |
| d8c7e1b1-52a1-4a4f-9b9b-ab5fa56e94e9 | DHCP agent | controller.novalocal | nova | True | UP | neutron-dhcp-agent |
+--------------------------------------+--------------------+----------------------+-------------------+-------+-------+---------------------------+
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com