OpenStack安装流程(juno版)- 添加网络服务(neutron)- compute节点

在compute节点上安装和配置

设定kernel networking参数:

  1. 编辑# vi /etc/sysctl.conf文件:
    <pre>net.ipv4.conf.all.rp_filter=0

net.ipv4.conf.default.rp_filter=0</pre>

  1. 使上述变化生效:

# sysctl -p

安装网络服务组件

# apt-get install neutron-plugin-ml2 neutron-plugin-openvswitch-agent

配置网络服务的通用组件

编辑# vi /etc/neutron/neutron.conf文件:

[database]部分,注释掉connection选项,因为compute节点不需要直接访问数据库。

[DEFAULT]部分,设定RabbitMQ的访问选项:
<pre>[DEFAULT]
...
rpc_backend = rabbit
rabbit_host = controller
rabbit_password = RABBIT_PASS
</pre>
RABBIT_PASS为RabbitMQ guest账户的密码。

[DEFAULT][keystone_authtoken]部分,设定认证服务的访问选项:
<pre>[DEFAULT]
...
auth_strategy = keystone
</pre>
<pre>[keystone_authtoken]
...
auth_uri = http://controller:5000/v2.0
identity_uri = http://controller:35357
admin_tenant_name = service
admin_user = neutron
admin_password = NEUTRON_PASS
</pre>
NEUTRON_PASS为创建neutron用户时使用的密码。在[keystone_authtoken]部分,注释掉 auth_host,auth_port,和auth_protocol的选项,因为identity_uri选项是直接代替它们的。

[DEFAULT]部分,开启Modular Layer 2(ML2)plug-in选项,设定router service和overlapping IP addresses选项:
<pre>[DEFAULT]
...
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True
</pre>

[DEFAULT]部分,开启“详细输出日志”选项:
<pre>[DEFAULT]
...
verbose = True
</pre>

设定Modular Layer 2(ML2)plug-in

编辑# vi /etc/neutron/plugins/ml2/ml2_conf.ini文件:

[ml2]部分,启用flat和generic routing encapsulation(GRE)网络类型的驱动( network type drivers),GRE 租户网络和OVS机制的驱动:
<pre>[ml2]
...
type_drivers = flat,gre
tenant_network_types = gre
mechanism_drivers = openvswitch
</pre>

[ml2_type_gre]部分,设定tunnel ID范围:
<pre>[ml2_type_gre]
...
tunnel_id_ranges = 1:1000
</pre>

[securitygroup]部分,启用security groups,ipset, and configure,设定OVS iptables firewall driver:
<pre>[securitygroup]
...
enable_security_group = True
enable_ipset = True
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
</pre>

[ovs]部分,启用tunnel,设定local tunnel endpoint,把external flat provider network和br-ex external network brigde绑定起来:
<pre>[ovs]
...
local_ip = INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS
enable_tunneling = True
bridge_mappings = external:br-ex
</pre>
INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS为network节点在tunnel network中的IP地址。

[agent]部分,启用GRE tunnels:
<pre>[agent]
...
tunnel_types = gre
</pre>

配置Open vSwitch(OVS)服务

重启OVS服务:
# service openvswitch-switch restart

配置计算服务使之使用网络服务

编辑# vi /etc/nova/nova.conf文件:
[DEFAULT]部分,设定API和驱动:
<pre>[DEFAULT]
...
network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
</pre>

[neutron]部分,设定访问参数:
<pre>[neutron]
...
url = http://controller:9696
auth_strategy = keystone
admin_auth_url = http://controller:35357/v2.0
admin_tenant_name = service
admin_username = neutron
admin_password = NEUTRON_PASS
</pre>
NEUTRON_PASS为创建neutron用户时使用的密码。

完成安装

  1. 重启计算服务:

# service nova-compute restart

  1. 重启OVS agent:

# service neutron-plugin-openvswitch-agent restart

验证操作

在controller节点上执行如下操作:

  1. 启动admin证书:
    $ source admin-openrc.sh
  2. 显示agent列表,验证neutron agent已成功启动:
    <pre>$ neutron agent-list
idagent_typehostaliveadmin_state_upbinary
03586491-fbf0-495f-93d9-77704ffdba61Open vSwitch agentcompute:-)Trueneutron-openvswitch-agent
2be5bff5-2d4b-4308-9d8e-218f86f0884eDHCP agentnetworkxxxTrueneutron-dhcp-agent
35e5874c-0e45-44b1-95e5-f5ac94a1b9d5L3 agentnetworkxxxTrueneutron-l3-agent
7debcbec-b316-490e-baa1-1a6bb74fcbbbOpen vSwitch agentnetworkxxxTrueneutron-openvswitch-agent
c35af91b-9f6b-4632-bc10-aa67c8a75ae1Metadata agentnetworkxxxTrueneutron-metadata-agent

+--------------------------------------+--------------------+---------+-------+----------------+---------------------------+</pre>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值