Centos7手动部署Openstack Mitaka版安装配置--(六)安装neutron网络服务

安装neutron

本章节中包含控制节点和计算节点

@以下内容在控制节点操作@

1、创建neutron数据库

mysql -uroot -phncgo110 -e "CREATE DATABASE neutron;"

注意:hncgo110为数据库root密码

2、创建数据库用户并赋予权限

#mysql -uroot -phncgo110 -e "GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'hncgo110';" 
#mysql -uroot -phncgo110 -e "GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'hncgo110';" 

注意:将hncgo110替换为自己的密码

3、创建neutron用户及赋予admin权限

#source /root/admin-openrc 
#openstack user create --domain default neutron --password hncgo110
#openstack role add --project service --user neutron admin

注意:将hncgo110替换为自己的密码

4、安装neutron相关软件

#yum install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtablest -y

5、配置neutron配置文件/etc/neutron/neutron.conf

#openstack-config --set  /etc/neutron/neutron.conf database connection  mysql+pymysql://neutron:hncgo110@192.168.31.100/neutron 
#openstack-config --set  /etc/neutron/neutron.conf DEFAULT core_plugin  ml2  
#openstack-config --set  /etc/neutron/neutron.conf DEFAULT service_plugins 
#openstack-config --set  /etc/neutron/neutron.conf DEFAULT rpc_backend  rabbit  
#openstack-config --set  /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_host  192.168.31.100  
#openstack-config --set  /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_userid  openstack  
#openstack-config --set  /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_password  hncgo110  
#openstack-config --set  /etc/neutron/neutron.conf DEFAULT auth_strategy  keystone  
#openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken auth_uri  http://192.168.31.100:5000  
#openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken auth_url  http://192.168.31.100:35357 
#openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken memcached_servers  192.168.31.100:11211
#openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken auth_type  password  
#openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken project_domain_name default  
#openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken user_domain_name  default  
#openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken project_name  service  
#openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken username  neutron  
#openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken password  hncgo110  
#openstack-config --set  /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_status_changes  True  
#openstack-config --set  /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_data_changes  True  
#openstack-config --set  /etc/neutron/neutron.conf nova auth_url  http://192.168.31.100:35357  
#openstack-config --set  /etc/neutron/neutron.conf nova auth_type  password 
#openstack-config --set  /etc/neutron/neutron.conf nova project_domain_name  default  
#openstack-config --set  /etc/neutron/neutron.conf nova user_domain_name  default  
#openstack-config --set  /etc/neutron/neutron.conf nova region_name  RegionOne  
#openstack-config --set  /etc/neutron/neutron.conf nova project_name  service  
#openstack-config --set  /etc/neutron/neutron.conf nova username  nova  
#openstack-config --set  /etc/neutron/neutron.conf nova password  hncgo110  
#openstack-config --set  /etc/neutron/neutron.conf oslo_concurrency lock_path  /var/lib/neutron/tmp  

6、配置/etc/neutron/plugins/ml2/ml2_conf.ini.

#openstack-config --set  /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers  flat,vlan,gre,vxlan,geneve
#openstack-config --set  /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types flat
#openstack-config --set  /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers  linuxbridge,openvswitch
#openstack-config --set  /etc/neutron/plugins/ml2/ml2_conf.ini ml2 extension_drivers  port_security
------------------------
#openstack-config --set  /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_flat flat_networks  provider 
------------------------
#openstack-config --set  /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup enable_ipset  True 

7、配置/etc/neutron/plugins/ml2/linuxbridge_agent.ini。

#openstack-config --set   /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings  public:eno16777728 
#openstack-config --set   /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan  enable_vxlan  False
#openstack-config --set   /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup  enable_security_group  True 
#openstack-config --set   /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup  firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

注意将eno16777728替换为自己的网卡名称

8、配置/etc/neutron/dhcp_agent.ini

#openstack-config --set   /etc/neutron/dhcp_agent.ini DEFAULT  interface_driver  neutron.agent.linux.interface.BridgeInterfaceDriver
#openstack-config --set   /etc/neutron/dhcp_agent.ini DEFAULT  dhcp_driver  neutron.agent.linux.dhcp.Dnsmasq 
#openstack-config --set   /etc/neutron/dhcp_agent.ini DEFAULT  enable_isolated_metadata  True 

9、配置 /etc/neutron/metadata_agent.ini

#openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT nova_metadata_ip 192.168.31.100
#openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT metadata_proxy_shared_secret hncgo110

用你为元数据代理设置的密码hncgo110

配置网络服务
10、配置/etc/nova/nova.conf

#openstack-config --set  /etc/nova/nova.conf  neutron url http://192.168.31.100:9696       
#openstack-config --set  /etc/nova/nova.conf  neutron auth_url http://192.168.31.100:35357
#openstack-config --set  /etc/nova/nova.conf  neutron auth_type password
#openstack-config --set  /etc/nova/nova.conf  neutron project_domain_name default
#openstack-config --set  /etc/nova/nova.conf  neutron user_domain_name default
#openstack-config --set  /etc/nova/nova.conf  neutron region_name RegionOne
#openstack-config --set  /etc/nova/nova.conf  neutron project_name service
#openstack-config --set  /etc/nova/nova.conf  neutron username neutron
#openstack-config --set  /etc/nova/nova.conf  neutron password hncgo110
#openstack-config --set  /etc/nova/nova.conf  neutron service_metadata_proxy True
#openstack-config --set  /etc/nova/nova.conf  neutron metadata_proxy_shared_secret hncgo110

11、创建链接

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

12、同步数据库

#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

13、重启nova_api服务

#systemctl restart openstack-nova-api.service

14、重启neutron服务并设置开机启动

#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 status neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
#systemctl list-unit-files |grep neutron-server.service 
#systemctl list-unit-files |grep neutron-linuxbridge-agent.service
#systemctl list-unit-files |grep neutron-dhcp-agent.service
#systemctl list-unit-files |grep neutron-metadata-agent.service

15、创建network服务

#source /root/admin-openrc
#openstack service create --name neutron --description "OpenStack Networking" network

16、创建endpoint

#openstack endpoint create --region RegionOne network public http://192.168.31.100:9696
#openstack endpoint create --region RegionOne network internal http://192.168.31.100:9696
#openstack endpoint create --region RegionOne network admin http://192.168.31.100:9696

@以下内容在计算节点操作@

17、安装和配置计算节点

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

18、配置/etc/neutron/neutron.conf

#openstack-config --set /etc/neutron/neutron.conf DEFAULT rpc_backend rabbit
#openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_host 192.168.31.100
#openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_userid openstack
#openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_password hncgo110
#openstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone
#openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_uri http://192.168.31.100:5000
#openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://192.168.31.100:35357
#openstack-config --set /etc/neutron/neutron.conf keystone_authtoken memcached_servers 192.168.31.100:11211
#openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_type password
#openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_domain_name default
#openstack-config --set /etc/neutron/neutron.conf keystone_authtoken user_domain_name default
#openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_name service
#openstack-config --set /etc/neutron/neutron.conf keystone_authtoken username neutron
#openstack-config --set /etc/neutron/neutron.conf keystone_authtoken password hncgo110
#openstack-config --set /etc/neutron/neutron.conf oslo_concurrency lock_path /var/lib/neutron/tmp

19、配置/etc/neutron/plugins/ml2/linuxbridge_agent.ini文件并且完成以下操作

#openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings public:eno16777728
#openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan enable_vxlan False
#openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup enable_security_group True
#openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

20、配置/etc/nova/nova.conf

#openstack-config --set /etc/nova/nova.conf neutron url http://192.168.31.100:9696
#openstack-config --set /etc/nova/nova.conf neutron auth_url http://192.168.31.100:35357
#openstack-config --set /etc/nova/nova.conf neutron auth_type password
#openstack-config --set /etc/nova/nova.conf neutron project_domain_name default
#openstack-config --set /etc/nova/nova.conf neutron user_domain_name default
#openstack-config --set /etc/nova/nova.conf neutron region_name RegionOne
#openstack-config --set /etc/nova/nova.conf neutron project_name service 
#openstack-config --set /etc/nova/nova.conf neutron username neutron
#openstack-config --set /etc/nova/nova.conf neutron password hncgo110

21、重启计算服务

#systemctl restart openstack-nova-compute.service

22、启动Linuxbridge代理并配置它开机自启动

#systemctl enable neutron-linuxbridge-agent.service
#systemctl start neutron-linuxbridge-agent.service
#systemctl status neutron-linuxbridge-agent.service
#systemctl list-unit-files |grep neutron-linuxbridge-agent.service

23、验证

#source /root/admin-openrc
#neutron ext-list
#neutron agent-list
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值