CentOS 7部署OpenStack(6)―部署Newtron(控制节点)
2015-12-30 17:55
906 查看
创建数据库[root@controller ~]# mysql -u root -p -e "CREATE DATABASEneutron;"Enter password: [root@controller ~]# mysql -u root -p -e "GRANT ALL PRIVILEGES ONneutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'neutron';"Enter password: [root@controller ~]# mysql -u root -p -e "GRANT ALL PRIVILEGES ONneutron.* TO 'neutron'@'%' IDENTIFIED BY 'neutron';"Enter password:
安装neutron[root@controller ~]# yum install -y openstack-neutronopenstack-neutron-ml2 openstack-neutron-linuxbridge python-neutronclientebtables ipset配置neutron同步数据库[root@controller ~]# vim /etc/neutron/neutron.conf729 connection = mysql://neutron:neutron@192.168.1.11:3306/neutron[root@controller ~]# 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配置其它项目
[root@controller ~]# vim /etc/neutron/neutron.conf锁路径20 state_path = /var/lib/neutron使用keystone验证92 auth_strategy = keystone配置连接keystone716 [keystone_authtoken]717 auth_uri = http://192.168.1.11:5000718 auth_url = http://192.168.1.11:35357719 auth_plugin = password 720 project_domain_id = default 721 user_domain_id = default 722 project_name = service 723 username = neutron724 password = neutron配置连接rabbitmq985 rabbit_host = 192.168.1.11989 rabbit_port = 56721001 rabbit_userid = openstack1005 rabbit_password = openstackNeutron相关配置60 core_plugin = ml277 service_plugins = routerNova相关配置360 notify_nova_on_port_status_changes = True364 notify_nova_on_port_data_changes = True367 nova_url = http://192.168.1.11:8774/v2774[nova] 775 auth_url =http://192.168.1.11:35357 776 auth_plugin = password 777 project_domain_id = default 778 user_domain_id = default 779 region_name = RegionOne 780 project_name = service 781 username = nova 782 password = nova[root@controller ~]# vim /etc/neutron/plugins/ml2/ml2_conf.ini5 type_drivers = flat,vlan,gre,vxlan,geneve //支持的网络驱动12 tenant_network_types = vlan,gre,vxlan,geneve//网络类型18 mechanism_drivers = openvswitch,linuxbridge //底层驱动27 extension_drivers = port_security //端口安全67 flat_networks = physnet1 //使用单一扁平网络120 enable_ipset = True[root@controller ~]# vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini9 physical_interface_mappings = physnet1:eth016 enable_vxlan = False51 prevent_arp_spoofing= True56 firewall_driver =neutron.agent.linux.iptables_firewall.IptablesFirewallDriver60 enable_security_group = True[root@controller ~]# vim /etc/neutron/dhcp_agent.ini27 interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver31 dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq52 enable_isolated_metadata = True[root@controller ~]# vim /etc/neutron/metadata_agent.ini 5 auth_uri =http://192.168.1.11:5000 6 auth_url =http://192.168.1.11:35357 7 auth_region = RegionOne 8 auth_plugin = password 9 project_domain_id = default 10 user_domain_id = default 11 project_name = service 12 username = neutron 13 password = neutron27 nova_metadata_ip = 192.168.1.1127 nova_metadata_ip = 192.168.1.1152 metadata_proxy_shared_secret = neutron修改nova配置[root@controller ~]# vim /etc/nova/nova.con3031 [neutron]3032 url = http://192.168.1.11:96963033 auth_url = http://192.168.1.11:353573034 auth_plugin = password3035 project_domain_id = default3036 user_domain_id = default3037 region_name = RegionOne3038 project_name = service3039 username = neutron3040 password = neutron3048 service_metadata_proxy=true3052 metadata_proxy_shared_secret=neutron[root@controller ~]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini/etc/neutron/plugin.ini创建用户[root@controller ~]# openstack user create --domain default--password=neutron neutron+-----------+----------------------------------+| Field | Value |+-----------+----------------------------------+| domain_id | default || enabled | True || id |33d0790e74e24a4bb0de3b21263155a5 || name | neutron |+-----------+----------------------------------+[root@controller ~]# openstack role add --project service --user neutronadmin注册服务[root@controller ~]# openstack service create --name neutron--description "OpenStack Networking" network+-------------+----------------------------------+| Field | Value |+-------------+----------------------------------+| description | OpenStack Networking || enabled | True || id |a057284a51ae4ea896fce082d0242fa6 || name | neutron || type | network |+-------------+----------------------------------+[root@controller ~]# openstack endpoint create --region RegionOne networkpublic http://192.168.1.11:9696+--------------+----------------------------------+| Field | Value |+--------------+----------------------------------+| enabled | True || id |77d289a63ccf4fa289a42f3ebba18fad || interface | public || region | RegionOne || region_id | RegionOne || service_id |a057284a51ae4ea896fce082d0242fa6 || service_name | neutron || service_type | network || url |http://192.168.1.11:9696 |+--------------+----------------------------------+[root@controller ~]# openstack endpoint create --region RegionOne networkinternal http://192.168.1.11:9696+--------------+----------------------------------+| Field | Value |+--------------+----------------------------------+| enabled | True || id |571a7fb989f14efb9db43c20a03e3aff || interface | internal || region | RegionOne || region_id | RegionOne || service_id |a057284a51ae4ea896fce082d0242fa6 || service_name | neutron || service_type | network || url |http://192.168.1.11:9696 |+--------------+----------------------------------+[root@controller ~]# openstack endpoint create --region RegionOne networkadmin http://192.168.1.11:9696+--------------+----------------------------------+| Field | Value |+--------------+----------------------------------+| enabled | True || id |008aac0f57e64e3084a76c2743f6c096 || interface | admin || region | RegionOne || region_id | RegionOne || service_id |a057284a51ae4ea896fce082d0242fa6 || service_name | neutron || service_type | network || url |http://192.168.1.11:9696 |+--------------+----------------------------------+启动服务[root@controller ~]# systemctl restart openstack-nova-api[root@controller ~]# systemctl enable neutron-server.service \neutron-linuxbridge-agent.service \neutron-dhcp-agent.service \neutron-metadata-agent.service[root@controller ~]# systemctl start neutron-server.service \neutron-linuxbridge-agent.service \neutron-dhcp-agent.service \neutron-metadata-agent.service查看验证[root@controller ~]# neutron agent-list+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+| id | agent_type | host | alive | admin_state_up | binary |+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+| 41bcc4cb-dea4-4a4d-9ffa-18209c746762 | Metadata agent | controller | :-) | True | neutron-metadata-agent || 5c7c894f-5260-49d7-9da4-c90c0a591fb6 | DHCP agent | controller | :-) | True | neutron-dhcp-agent || 7df41d2f-f4a6-42cc-a761-83d9eab0a0f0 | Linux bridge agent | controller| :-) | True | neutron-linuxbridge-agent |+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+Linux运维开发群:298324302
北京linux运维求职招聘群:153677549
本文出自 “长街听风人” 博客,请务必保留此出处http://kevinhao.blog.51cto.com/5204735/1730086
安装neutron[root@controller ~]# yum install -y openstack-neutronopenstack-neutron-ml2 openstack-neutron-linuxbridge python-neutronclientebtables ipset配置neutron同步数据库[root@controller ~]# vim /etc/neutron/neutron.conf729 connection = mysql://neutron:neutron@192.168.1.11:3306/neutron[root@controller ~]# 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配置其它项目
[root@controller ~]# vim /etc/neutron/neutron.conf锁路径20 state_path = /var/lib/neutron使用keystone验证92 auth_strategy = keystone配置连接keystone716 [keystone_authtoken]717 auth_uri = http://192.168.1.11:5000718 auth_url = http://192.168.1.11:35357719 auth_plugin = password 720 project_domain_id = default 721 user_domain_id = default 722 project_name = service 723 username = neutron724 password = neutron配置连接rabbitmq985 rabbit_host = 192.168.1.11989 rabbit_port = 56721001 rabbit_userid = openstack1005 rabbit_password = openstackNeutron相关配置60 core_plugin = ml277 service_plugins = routerNova相关配置360 notify_nova_on_port_status_changes = True364 notify_nova_on_port_data_changes = True367 nova_url = http://192.168.1.11:8774/v2774[nova] 775 auth_url =http://192.168.1.11:35357 776 auth_plugin = password 777 project_domain_id = default 778 user_domain_id = default 779 region_name = RegionOne 780 project_name = service 781 username = nova 782 password = nova[root@controller ~]# vim /etc/neutron/plugins/ml2/ml2_conf.ini5 type_drivers = flat,vlan,gre,vxlan,geneve //支持的网络驱动12 tenant_network_types = vlan,gre,vxlan,geneve//网络类型18 mechanism_drivers = openvswitch,linuxbridge //底层驱动27 extension_drivers = port_security //端口安全67 flat_networks = physnet1 //使用单一扁平网络120 enable_ipset = True[root@controller ~]# vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini9 physical_interface_mappings = physnet1:eth016 enable_vxlan = False51 prevent_arp_spoofing= True56 firewall_driver =neutron.agent.linux.iptables_firewall.IptablesFirewallDriver60 enable_security_group = True[root@controller ~]# vim /etc/neutron/dhcp_agent.ini27 interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver31 dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq52 enable_isolated_metadata = True[root@controller ~]# vim /etc/neutron/metadata_agent.ini 5 auth_uri =http://192.168.1.11:5000 6 auth_url =http://192.168.1.11:35357 7 auth_region = RegionOne 8 auth_plugin = password 9 project_domain_id = default 10 user_domain_id = default 11 project_name = service 12 username = neutron 13 password = neutron27 nova_metadata_ip = 192.168.1.1127 nova_metadata_ip = 192.168.1.1152 metadata_proxy_shared_secret = neutron修改nova配置[root@controller ~]# vim /etc/nova/nova.con3031 [neutron]3032 url = http://192.168.1.11:96963033 auth_url = http://192.168.1.11:353573034 auth_plugin = password3035 project_domain_id = default3036 user_domain_id = default3037 region_name = RegionOne3038 project_name = service3039 username = neutron3040 password = neutron3048 service_metadata_proxy=true3052 metadata_proxy_shared_secret=neutron[root@controller ~]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini/etc/neutron/plugin.ini创建用户[root@controller ~]# openstack user create --domain default--password=neutron neutron+-----------+----------------------------------+| Field | Value |+-----------+----------------------------------+| domain_id | default || enabled | True || id |33d0790e74e24a4bb0de3b21263155a5 || name | neutron |+-----------+----------------------------------+[root@controller ~]# openstack role add --project service --user neutronadmin注册服务[root@controller ~]# openstack service create --name neutron--description "OpenStack Networking" network+-------------+----------------------------------+| Field | Value |+-------------+----------------------------------+| description | OpenStack Networking || enabled | True || id |a057284a51ae4ea896fce082d0242fa6 || name | neutron || type | network |+-------------+----------------------------------+[root@controller ~]# openstack endpoint create --region RegionOne networkpublic http://192.168.1.11:9696+--------------+----------------------------------+| Field | Value |+--------------+----------------------------------+| enabled | True || id |77d289a63ccf4fa289a42f3ebba18fad || interface | public || region | RegionOne || region_id | RegionOne || service_id |a057284a51ae4ea896fce082d0242fa6 || service_name | neutron || service_type | network || url |http://192.168.1.11:9696 |+--------------+----------------------------------+[root@controller ~]# openstack endpoint create --region RegionOne networkinternal http://192.168.1.11:9696+--------------+----------------------------------+| Field | Value |+--------------+----------------------------------+| enabled | True || id |571a7fb989f14efb9db43c20a03e3aff || interface | internal || region | RegionOne || region_id | RegionOne || service_id |a057284a51ae4ea896fce082d0242fa6 || service_name | neutron || service_type | network || url |http://192.168.1.11:9696 |+--------------+----------------------------------+[root@controller ~]# openstack endpoint create --region RegionOne networkadmin http://192.168.1.11:9696+--------------+----------------------------------+| Field | Value |+--------------+----------------------------------+| enabled | True || id |008aac0f57e64e3084a76c2743f6c096 || interface | admin || region | RegionOne || region_id | RegionOne || service_id |a057284a51ae4ea896fce082d0242fa6 || service_name | neutron || service_type | network || url |http://192.168.1.11:9696 |+--------------+----------------------------------+启动服务[root@controller ~]# systemctl restart openstack-nova-api[root@controller ~]# systemctl enable neutron-server.service \neutron-linuxbridge-agent.service \neutron-dhcp-agent.service \neutron-metadata-agent.service[root@controller ~]# systemctl start neutron-server.service \neutron-linuxbridge-agent.service \neutron-dhcp-agent.service \neutron-metadata-agent.service查看验证[root@controller ~]# neutron agent-list+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+| id | agent_type | host | alive | admin_state_up | binary |+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+| 41bcc4cb-dea4-4a4d-9ffa-18209c746762 | Metadata agent | controller | :-) | True | neutron-metadata-agent || 5c7c894f-5260-49d7-9da4-c90c0a591fb6 | DHCP agent | controller | :-) | True | neutron-dhcp-agent || 7df41d2f-f4a6-42cc-a761-83d9eab0a0f0 | Linux bridge agent | controller| :-) | True | neutron-linuxbridge-agent |+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+Linux运维开发群:298324302
北京linux运维求职招聘群:153677549
本文出自 “长街听风人” 博客,请务必保留此出处http://kevinhao.blog.51cto.com/5204735/1730086
相关文章推荐
- VFS目录树
- linux进程状态
- kafka centos 单点配置
- linux sigar java.lang.UnsatisfiedLinkError
- 【Linux探索之旅】第四部分第三课:文件传输,潇洒同步
- 在centos6.5上安装软件
- 【Linux探索之旅】第四部分第三课:文件传输,潇洒同步
- centos7 下搭建Python2.7 + PyQt4.11.3 + Eric4.0开发平台
- Linux安装VMwareTools-9.6.0-1294478.tar.gz
- Linux组、用户操作
- Linux_Network_Management
- Linux Bridge实践 -- 使用dnsmasq为虚拟机分配IP地址
- 【原创】linux学习笔记之文件处理命令
- linux下创建expdp备份的计划任务
- Linux下安装mysql
- Linux mysql 数据库自动备份
- Linux查询网址
- Linux文件与目录常用命令
- linux使用xinetd自定义服务
- Linux环境下安装部署AWStats日志分析系统实例