在OpenStack学习的第十五天,我们将重点学习如何在计算节点上安装和配置网络服务。以下是详细的步骤和注意事项。

1. 安装必要的组件

首先,我们需要安装计算节点所需的网络服务组件。这些组件包括openstack-neutron-linuxbridgeebtablesipset。使用yum进行安装:

bash复制代码
 yum install openstack-neutron-linuxbridge ebtables ipset

2. 配置Neutron服务

2.1 编辑Neutron配置文件

接下来,编辑/etc/neutron/neutron.conf文件,进行必要的配置:

  • [database]部分,注释所有connection项,因为计算节点不直接访问数据库。
  • [DEFAULT]部分,配置RabbitMQ消息队列访问权限:
ini复制代码
 [DEFAULT]  
 
 ...  
 
 transport_url = rabbit://openstack:RABBIT_PASS@controller

RABBIT_PASS替换为你在RabbitMQ中为openstack用户选择的密码。

  • [DEFAULT][keystone_authtoken]部分,配置认证服务访问:
ini复制代码
 [DEFAULT]  
 
 ...  
 
 auth_strategy = keystone  
 
  
 
 [keystone_authtoken]  
 
 ...  
 
 auth_uri = http://controller:5000  
 
 auth_url = http://controller:35357  
 
 memcached_servers = controller:11211  
 
 auth_type = password  
 
 project_domain_name = default  
 
 user_domain_name = default  
 
 project_name = service  
 
 username = neutron  
 
 password = NEUTRON_PASS

NEUTRON_PASS替换为你在认证服务中为neutron用户选择的密码。

  • [oslo_concurrency]部分,配置锁路径:
ini复制代码
 [oslo_concurrency]  
 
 ...  
 
 lock_path = /var/lib/neutron/tmp
  • [oslo_messaging_rabbit]部分,配置RabbitMQ消息队列的连接:
ini复制代码
 [oslo_messaging_rabbit]  
 
 ...  
 
 rpc_backend = rabbit  
 
 rabbit_host = 192.168.141.170  
 
 rabbit_userid = openstack  
 
 rabbit_password = openstack
2.2 配置Linuxbridge代理

修改配置文件/etc/neutron/plugins/ml2/linuxbridge_agent.ini

  • [linux_bridge]部分,将公共虚拟网络和公共物理网络接口对应起来:
ini复制代码
 [linux_bridge]  
 
 physical_interface_mappings = provider:PROVIDER_INTERFACE_NAME

PROVIDER_INTERFACE_NAME替换为底层的物理公共网络接口。

  • [vxlan]部分,禁止VXLAN覆盖网络:
ini复制代码
 [vxlan]  
 
 enable_vxlan = False
  • [securitygroup]部分,启用安全组并配置Linux桥接iptables防火墙驱动:
ini复制代码
 [securitygroup]  
 
 ...  
 
 enable_security_group = True  
 
 firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

3. 配置计算服务使用网络服务

修改/etc/nova/nova.conf文件,在[neutron]部分配置访问参数:

ini复制代码
 [neutron]  
 
 ...  
 
 url = http://controller:9696  
 
 auth_url = http://controller:35357  
 
 auth_type = password  
 
 project_domain_name = default  
 
 user_domain_name = default  
 
 region_name = RegionOne  
 
 project_name = service  
 
 username = neutron  
 
 password = NEUTRON_PASS

NEUTRON_PASS替换为你在认证服务中为neutron用户选择的密码。

4. 重启服务和验证

  • 重启计算服务:
bash复制代码
 systemctl restart openstack-nova-compute.service
  • 启动Linuxbridge代理并配置它开机自启动:
bash复制代码
 systemctl enable neutron-linuxbridge-agent.service  
 
 systemctl start neutron-linuxbridge-agent.service
  • 验证服务是否正常运行,获取admin账号权限并检查服务的状态。