首页 > 文章 > neutron控制节点

neutron控制节点

首先巡检
内存,free-h
磁盘,df -h
cpu检测top,ps
70告警,80中度告警
内存已满清除错误日志
/var/log/mailog
编写计划任务

检测openstack
systemctl status httpd | grep active
systemctl status rabbitmq-server.service | grep active
systemctl status mariadb| grep active
systemctl status memcached.service | grep active
rabbitmqctl cluster_status
nova list
systemctl status openstack-glance-registry.service openstack-glance-api.service| grep active
nova service-list


环境前部署
节点zxw6三块网卡
[email protected] ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens38
HWADDR=00:0C:29:5C:6C:B2
TYPE=Ethernet
IPV6INIT=no
NAME=ens38
UUID=8656cb7b-4b13-377a-be81-796a0b19085c
ONBOOT=yes
AUTOCONNECT_PRIORITY=-999

 

 分享图片

 

第一步:创建neutron数据库和用户
[[email protected] ~]# mysql -uroot -p123
create database neutron;
grant all on neutron.* to ‘neutron‘@‘loaclhost‘ identntified by‘zxw6‘;
grant all on neutron.* to ‘neutron‘@‘%‘ identified by‘zxw6‘;


登录到openstack界面


第二步:创建neutron用户
[[email protected] ~]# openstack user create --domain default --password=zxw6 neutron
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 0778712d47f844a9ab20cd34e1b9baf0 |
| name | neutron |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+

第三步:在service项目添加neutron用户到admin角色
[[email protected] ~]# openstack role add --project service --user neutron admin

第三步:创建项目
[[email protected] ~]# openstack service create --name neutron --description "OpenStack Networking" network
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Networking |
| enabled | True |
| id | 84bbbe38ac374ed38acaa1808cc11dbe |
| name | neutron |
| type | network |

第四步:创建服务节点9696

[[email protected] ~]# openstack endpoint create --region RegionOne \
network public http://zxw6:9696
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 9117edf4faef4c3f9e606107cb3f2f61 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 84bbbe38ac374ed38acaa1808cc11dbe |
| service_name | neutron |
| service_type | network |
| url | http://zxw6:9696 |


[[email protected] ~]# openstack endpoint create --region RegionOne \
network internal http://zxw6:9696
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 4f673d1bd6f74babae231a951068e7e9 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 84bbbe38ac374ed38acaa1808cc11dbe |
| service_name | neutron |
| service_type | network |
| url | http://zxw6:9696 |
+--------------+----------------------------------+

[email protected] ~]# openstack endpoint create --region RegionOne network admin http://zxw6:9696
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 161f83bfcbfd46b0874f40abc230b785 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 84bbbe38ac374ed38acaa1808cc11dbe |
| service_name | neutron |
| service_type | network |
| url | http://zxw6:9696 |
+--------------+----------------------------------+


第四步:下载nuetron安装包
[[email protected] ~]# yum install openstack-neutron openstack-neutron-ml2 openvswitch openstack-neutron-openvswitch ebtables -y

第五步:修改配置文件
[[email protected] ~]# cat /etc/neutron/neutron.conf
[DEFAULT]
state_path = /var/lib/neutron
auth_strategy = keystone
core_plugin = ml2
service_plugins = router
dhcp_agent_notification = true
allow_overlapping_ips = True
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true
transport_url = rabbit://openstack:[email protected]

[agent]

[cors]

[cors.subdomain]

[database]
connection = mysql+pymysql://neutron:[email protected]/neutron

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

[matchmaker_redis]

[nova]
region_name = RegionOne
auth_url = http://zxw6:35357
auth_type = password
project_domain_name = default
project_name = service
user_domain_name = default
username = nova
password = zxw6

[oslo_concurrency]
lock_path = $state_path/lock

[oslo_messaging_amqp]

[oslo_messaging_kafka]

[oslo_messaging_notifications]

[oslo_messaging_rabbit]

[oslo_messaging_zmq]

[oslo_middleware]

[oslo_policy]

[qos]

[quotas]

[ssl]


修改ml2的配置文件
[[email protected] ml2]# pwd
/etc/neutron/plugins/ml2
[email protected] ml2]# vim ml2_conf.ini

[DEFAULT]
[ml2]
type_drivers = flat,vxlan
tenant_network_types = vxlanmechanism_drivers = openvswitch,l2population
extension_drivers = port_security

[ml2_type_flat]
[ml2_type_geneve]
[ml2_type_gre][ml2_type_vlan]

[ml2_type_vxlan]
vni_ranges = 1:1000

[securitygroup]
enable_ipset = true

修改openvswitch_agent的配置文件
[[email protected] ml2]# pwd
/etc/neutron/plugins/ml2

[[email protected] ml2]# vim openvswitch_agent.ini

[DEFAULT]
 
[agent]
tunnel_types = vxlan
l2_population = True
 
[ovs]tunnel_bridge = br-tun
local_ip = 192.168.92.135
bridge_mappings =
 
[securitygroup]
firewall_driver = iptables_hybridenable_security_group = true
 
[xenapi]


修改 l3_agent.ini的配置文件
[[email protected] neutron]# pwd
/etc/neutron
[[email protected] neutron]# vim l3_agent.ini

[DEFAULT]
interface_driver = openvswitch
external_network_bridge = br-ex
 
[agent]
 
[ovs]


修改 dhcp的配置文件
[[email protected] neutron]# pwd
/etc/neutron
[[email protected] neutron]# vim dhcp_agent.ini

[DEFAULT]
interface_driver = openvswitch
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true
 
[agent]
 
[ovs]

修改 metadata_agent的配置文件元数据

[[email protected] neutron]# vim metadata_agent.ini

[DEFAULT]
nova_metadata_ip = zxw6
metadata_proxy_shared_secret = METADATA_SECRET
 
[agent]
 
[cache]

第六步:编辑配置文件nova
[[email protected] nova]# vim /etc/nova/nova.conf

[neutron]
url = http://zxw6:9696
auth_url = http://zxw6:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = zxw6
service_metadata_proxy = true
metadata_proxy_shared_secret = METADATA_SECRET

 分享图片

 

 分享图片

 

 


第七步:软连接ml2_conf.ini到plugin.ini
[[email protected] nova]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini

第八步:导入neutron的数据库
[[email protected] ~]# 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


第九步:重启nova_api服务
[[email protected] ~]# systemctl restart openstack-nova-api.service

第十步:启动所有服务
[[email protected] ~]# systemctl start neutron-server.service neutron-dhcp-agent.service openvswitch neutron-openvswitch-agent neutron-metadata-agent.service

[[email protected] ~]# systemctl enable neutron-server.service neutron-dhcp-agent.service openvswitch neutron-openvswitch-agent neutron-metadata-agent.service

[[email protected] ~]# systemctl status neutron-server.service neutron-dhcp-agent.service openvswitch neutron-openvswitch-agent neutron-metadata-agent.service | grep active
Active: active (running) since 四 2019-08-01 22:55:24 CST; 1min 33s ago
Active: active (running) since 四 2019-08-01 22:56:56 CST; 1s ago
Active: active (exited) since 四 2019-08-01 22:55:12 CST; 1min 45s ago
Active: active (running) since 四 2019-08-01 22:56:55 CST; 2s ago
Active: active (running) since 四 2019-08-01 22:56:57 CST; 147ms ago

第十一步:创建br-ex的网桥
[[email protected] ~]# ovs-vsctl add-br br-ex

[[email protected] ~]# ovs-vsctl show
65eb7fce-e6b1-48ce-971f-3192e21103d6
Bridge br-ex
Port br-ex
Interface br-ex
type: internal
ovs_version: "2.9.0"


第十二步:添加ens38到br-ex网桥
[[email protected] ~]# ovs-vsctl add-port br-ex ens38
[[email protected] ~]# ovs-vsctl show
65eb7fce-e6b1-48ce-971f-3192e21103d6
Bridge br-ex
Port br-ex
Interface br-ex
type: internal
Port "ens38"
Interface "ens38"
ovs_version: "2.9.0"2019-08-14
[[email protected] ~]# neutron agent-list
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
+------------------------+--------------------+------+-------------------+-------+----------------+-------------------------+
| id | agent_type | host | availability_zone | alive | admin_state_up | binary |
+------------------------+--------------------+------+-------------------+-------+----------------+-------------------------+
| 5e559f85-fabf-4695-a75 | DHCP agent | zxw6 | nova | :-) | True | neutron-dhcp-agent |
| 8-95a605c374e6 | | | | | | |
| 6d9dd18e-bba8-4546-99e | Open vSwitch agent | zxw6 | | :-) | True | neutron-openvswitch- |
| 4-d4cfe27bfea9 | | | | | | agent |
| 98ce7a22-eae1-4727-811 | Metadata agent | zxw6 | | :-) | True | neutron-metadata-agent |
| 4-eed65c1703f3 | | | | | | |
+------------------------+--------------------+------+-------------------+-------+----------------+-------------------------+

第十三步:启动l3-agent服务
[[email protected] ~]# systemctl start neutron-l3-agent.service
[[email protected] ~]# systemctl enable neutron-l3-agent.service
Created symlink from /etc/systemd/system/multi-user.target.wants/neutron-l3-agent.service to /usr/lib/systemd/system/neutron-l3-agent.service.

 

时间:2019-08-14 09:06:39阅读(18)
联系我们 - 留言反馈
© 2017 版权所有 鲁ICP备17052893号