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

[经验分享] OpenStack:安装Neutron与provider network

[复制链接]

尚未签到

发表于 2017-6-26 21:17:41 | 显示全部楼层 |阅读模式
  1. 安装
(1)Install Networking services on a dedicated network node
# apt-get install neutron-server neutron-dhcp-agent neutron-plugin-openvswitch-agent
不需要L3Agent
删除sqlite
rm -f /var/lib/neutron/neutron.sqlite
  编辑/etc/sysctl.conf, Enable packet forwarding and disable packet destination filtering
net.ipv4.ip_forward=1
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
  重新加载
# sysctl -p
# service networking restart
如果不行,则
# /etc/init.d/networking restart
2. 创建db
create database neutron;
grant all privileges on neutron.* to 'neutron'@'%' identified by 'openstack';
grant all privileges on neutron.* to 'neutron'@'localhost' identified by 'openstack';
  3. 创建user, role
# keystone user-create --name=neutron --pass=openstack
# keystone user-role-add --user=neutron --tenant=service --role=admin
  4. 配置:
(1)配置/etc/neutron/neutron.conf :
[DEFAULT]
core_plugin = neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2
auth_strategy=keystone
control_exchange = neutron
rabbit_host = controller
rabbit_userid = guest
rabbit_password = openstack
notification_driver = neutron.openstack.common.notifier.rabbit_notifier
  [database]
connection = mysql://neutron:openstack@controller/neutron
  [keystone_authtoken]
auth_uri = http://controller:35357
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = neutron
admin_password = openstack
  (2)配置/etc/neutron/api-paste.ini:
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_uri = http://controller:35357
auth_host = controller
auth_port = 35357
admin_tenant_name = service
admin_user = neutron
admin_password = openstack
  警告:Warning
keystoneclient.middleware.auth_token: You must configure auth_uri to point to the public identity endpoint. Otherwise, clients might not be able to authenticate against an admin endpoint.
  (3)配置/etc/neutron/dhcp_agent.ini
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
  (4)配置 /etc/nova/nova.conf, 回头关联nova
[DEFAULT]
neutron_metadata_proxy_shared_secret = openstack
service_neutron_metadata_proxy = true
  network_api_class=nova.network.neutronv2.api.API
  neutron_admin_username=neutron
neutron_admin_password=openstack
neutron_admin_auth_url=http://controller:35357/v2.0/
neutron_auth_strategy=keystone
neutron_admin_tenant_name=service
neutron_url=http://controller:9696/
  需要重启:
# service nova-api restart
  (5)配置/etc/neutron/metadata_agent.ini
[DEFAULT]
auth_url = http://controller:35357/v2.0
auth_region = regionOne
admin_tenant_name = service
admin_user = neutron
admin_password = openstack
nova_metadata_ip = controller
metadata_proxy_shared_secret = openstack
  5. 注册service, endpoint:
# keystone service-create \
--name=neutron --type=network \
--description="OpenStack Networking Service"
  # keystone endpoint-create \
--service-id 455075d2fb9540ac864c345109c291cf \
--publicurl http://controller:9696 \
--adminurl http://controller:9696 \
--internalurl http://controller:9696
  -------------------------------------------------------------------
>在Network Node安装Neutron
0. 安装OVS
知道3种interface
MGMI_INTERFACE: 管理接口, 使用eth1, 一般要关闭
DATA_INTERFACE: 数据接口, 使用eth1
EXTERNAL_INTERFACE: 外部接口, 使用eth0, 如果有多ISP,都绑定于该interface.
(1) 安装
# apt-get install neutron-plugin-openvswitch-agent
# ovs-vsctl add-br br-int
br-int是OVS连接VM必需的, 至于br-ex根据网络拓扑需要, 在flat网络则不用.
  (2) 配置 /etc/neutron/dhcp_agent.ini
[DEFAULT]
enable_isolated_metadata = True
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
use_namespaces = False
其中use_namespaces根据需要设定,如果是flat应该没有必要吧?
需要重启
# service neutron-dhcp-agent restart
  (3)配置/etc/neutron/neutron.conf, 设置OVS
core_plugin = neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2
  (4)配置/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini, 设置firewall_driver
[securitygroup]
# Firewall driver for realizing neutron security group function.
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
  [ovs]
tenant_network_type = none
enable_tunneling = False
network_vlan_ranges = physnet0, physnet1
bridge_mappings = physnet0:br-eth0, physnet1:br-eth1
则需要创建
  (5)重启
# service openvswitch-switch restart(只在安装后重启一次即可,不能重启)
# service neutron-plugin-openvswitch-agent restart
-------------------------------------------------------------------
  8. 重启neutron服务.
service neutron-server restart
service neutron-dhcp-agent restart
service neutron-metadata-agent restart
service neutron-plugin-openvswitch-agent restart
  ======================================
配置网络:
  (1)执行下述ovs命令
# ovs-vsctl add-br br-eth0
# ovs-vsctl add-port br-eth0 eth0
# ovs-vsctl add-br br-eth1
# ovs-vsctl add-port br-eth1 eth1
  (2)配置interfaces
openstack@openstack:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
  # The loopback network interface
auto lo
iface lo inet loopback
  auto eth0
iface eth0 inet manual
        up ifconfig eth0 0.0.0.0 promisc up
        down ifconfig eth0 down
  auto br-eth0
iface br-eth0 inet static
        address 192.168.2.3
        netmask 255.255.255.0
        gateway 192.168.2.2
        dns-nameservers 192.168.2.2
  auto eth1
iface eth1 inet manual
        up ifconfig eth1 0.0.0.0 promisc up
        down ifconfig eth1 down
  auto br-eth1
iface br-eth1 inet static
        address 10.0.0.3
        netmastk 255.255.255.0
  一旦声明 bridge_ports eth0,就不能再声明iface eth0, 否则Linux启动会报网络错误.
-----------------------------------------------
关闭gro
ethtool -k eth0
ethtool -K eth0 gro off
ethtool -k eth1
ethtool -K eth1 gro off
------------------------------------------------

运维网声明 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-388401-1-1.html 上篇帖子: how to read openstack code : stevedore 下篇帖子: openstack装B之路------http协议
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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

扫描微信二维码查看详情

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


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


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


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



合作伙伴: 青云cloud

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