设为首页 收藏本站
查看: 1050|回复: 0

[经验分享] CentOS 7部署OpenStack(6)—部署Newtron(控制节点)

[复制链接]
累计签到:2 天
连续签到:1 天
发表于 2016-1-11 10:44:30 | 显示全部楼层 |阅读模式
创建数据库
[iyunv@controller ~]# mysql -u root -p -e "CREATE DATABASEneutron;"
Enter password:
[iyunv@controller ~]# mysql -u root -p -e "GRANT ALL PRIVILEGES ONneutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'neutron';"
Enter password:
[iyunv@controller ~]# mysql -u root -p -e "GRANT ALL PRIVILEGES ONneutron.* TO 'neutron'@'%' IDENTIFIED BY 'neutron';"
Enter password:

安装neutron
[iyunv@controller ~]# yum install -y openstack-neutronopenstack-neutron-ml2 openstack-neutron-linuxbridge python-neutronclientebtables ipset
配置neutron
同步数据库

[iyunv@controller ~]# vim /etc/neutron/neutron.conf
729 connection = mysql://neutron:neutron@192.168.1.11:3306/neutron
[iyunv@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
配置其它项目

[iyunv@controller ~]# vim /etc/neutron/neutron.conf
锁路径
20 state_path = /var/lib/neutron
使用keystone验证
92 auth_strategy = keystone
配置连接keystone
716 [keystone_authtoken]
717 auth_uri = http://192.168.1.11:5000
718 auth_url = http://192.168.1.11:35357
719 auth_plugin = password            
720 project_domain_id = default         
721 user_domain_id = default   
722 project_name = service            
723 username = neutron
724 password = neutron
配置连接rabbitmq
985 rabbit_host = 192.168.1.11
989 rabbit_port = 5672
1001 rabbit_userid = openstack
1005 rabbit_password = openstack
Neutron相关配置
60 core_plugin = ml2
77 service_plugins = router
Nova相关配置
360 notify_nova_on_port_status_changes = True
364 notify_nova_on_port_data_changes = True
367 nova_url = http://192.168.1.11:8774/v2
774[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
[iyunv@controller ~]# vim /etc/neutron/plugins/ml2/ml2_conf.ini
5 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
[iyunv@controller ~]# vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
9 physical_interface_mappings = physnet1:eth0
16 enable_vxlan = False
51 prevent_arp_spoofing= True
56 firewall_driver =neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
60 enable_security_group = True
[iyunv@controller ~]# vim /etc/neutron/dhcp_agent.ini
27 interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
31 dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
52 enable_isolated_metadata = True
[iyunv@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 = neutron
27 nova_metadata_ip = 192.168.1.1127 nova_metadata_ip = 192.168.1.11
52 metadata_proxy_shared_secret = neutron
修改nova配置
[iyunv@controller ~]# vim /etc/nova/nova.con
3031 [neutron]
3032 url = http://192.168.1.11:9696
3033 auth_url = http://192.168.1.11:35357
3034 auth_plugin = password
3035 project_domain_id = default
3036 user_domain_id = default
3037 region_name = RegionOne
3038 project_name = service
3039 username = neutron
3040 password = neutron
3048 service_metadata_proxy=true
3052 metadata_proxy_shared_secret=neutron
[iyunv@controller ~]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini/etc/neutron/plugin.ini
创建用户
[iyunv@controller ~]# openstack user create --domain default--password=neutron neutron
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | default                          |
| enabled   | True                             |
| id        |33d0790e74e24a4bb0de3b21263155a5 |
| name      | neutron                          |
+-----------+----------------------------------+
[iyunv@controller ~]# openstack role add --project service --user neutronadmin
注册服务
[iyunv@controller ~]# openstack service create --name neutron--description "OpenStack Networking" network
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Networking             |
| enabled     | True                             |
| id          |a057284a51ae4ea896fce082d0242fa6 |
| name        | neutron                          |
| type        | network                          |
+-------------+----------------------------------+
[iyunv@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         |
+--------------+----------------------------------+
[iyunv@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         |
+--------------+----------------------------------+
[iyunv@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         |
+--------------+----------------------------------+
启动服务
[iyunv@controller ~]# systemctl restart openstack-nova-api
[iyunv@controller ~]# systemctl enable neutron-server.service \
neutron-linuxbridge-agent.service \
neutron-dhcp-agent.service \
neutron-metadata-agent.service
[iyunv@controller ~]# systemctl start neutron-server.service \
neutron-linuxbridge-agent.service \
neutron-dhcp-agent.service \
neutron-metadata-agent.service
查看验证
[iyunv@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 |
+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-162966-1-1.html 上篇帖子: openstack安装记录: 下篇帖子: CentOS 7部署OpenStack(7)—部署Newtron(计算节点)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表