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>linux

  1. 使上述變化生效:

# sysctl -p數據庫

安裝網絡服務組件

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

配置網絡服務的通用組件

編輯# vi /etc/neutron/neutron.conf文件:網絡

[database]部分,註釋掉connection選項,由於compute節點不須要直接訪問數據庫。app

[DEFAULT]部分,設定RabbitMQ的訪問選項:
<pre>[DEFAULT]
...
rpc_backend = rabbit
rabbit_host = controller
rabbit_password = RABBIT_PASS
</pre>
RABBIT_PASS爲RabbitMQ guest帳戶的密碼。ide

[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選項是直接代替它們的。oop

[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>url

[DEFAULT]部分,開啓「詳細輸出日誌」選項:
<pre>[DEFAULT]
...
verbose = True
</pre>.net

設定Modular Layer 2(ML2)plug-in

編輯# vi /etc/neutron/plugins/ml2/ml2_conf.ini文件:3d

[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
id agent_type host alive admin_state_up binary
03586491-fbf0-495f-93d9-77704ffdba61 Open vSwitch agent compute :-) True neutron-openvswitch-agent
2be5bff5-2d4b-4308-9d8e-218f86f0884e DHCP agent network xxx True neutron-dhcp-agent
35e5874c-0e45-44b1-95e5-f5ac94a1b9d5 L3 agent network xxx True neutron-l3-agent
7debcbec-b316-490e-baa1-1a6bb74fcbbb Open vSwitch agent network xxx True neutron-openvswitch-agent
c35af91b-9f6b-4632-bc10-aa67c8a75ae1 Metadata agent network xxx True neutron-metadata-agent

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

相關文章
相關標籤/搜索