openstack controller ha测试环境搭建记录(十二)——配置neutron(计算节点)

在计算节点配置内核参数:
vi /etc/sysctl.conf
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0

在计算节点使内核参数立即生效:
sysctl -p

在计算节点安装软件:
yum install -y openstack-neutron-ml2 openstack-neutron-openvswitch

在计算节点修改配置文件:
openstack-config --set /etc/neutron/neutron.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/neutron/neutron.conf DEFAULT rabbit_password 123456
openstack-config --set /etc/neutron/neutron.conf DEFAULT rabbit_hosts controller1:5672,controller2:5672,controller3:5672
openstack-config --set /etc/neutron/neutron.conf DEFAULT rabbit_retry_interval 1
openstack-config --set /etc/neutron/neutron.conf DEFAULT rabbit_retry_backoff 2
openstack-config --set /etc/neutron/neutron.conf DEFAULT rabbit_max_retries 0
openstack-config --set /etc/neutron/neutron.conf DEFAULT rabbit_durable_queues true
openstack-config --set /etc/neutron/neutron.conf DEFAULT rabbit_ha_queues true

openstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_uri http://myvip:5000/v2.0
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken identity_uri http://myvip:35357
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken admin_user neutron
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken admin_tenant_name service
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken admin_password 123456

openstack-config --set /etc/neutron/neutron.conf DEFAULT core_plugin ml2
openstack-config --set /etc/neutron/neutron.conf DEFAULT service_plugins router
openstack-config --set /etc/neutron/neutron.conf DEFAULT allow_overlapping_ips True
openstack-config --set /etc/neutron/neutron.conf DEFAULT verbose True

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers flat,gre
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types gre
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers openvswitch
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_flat flat_networks external
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_gre tunnel_id_ranges 1:1000
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup enable_security_group True
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup enable_ipset True
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ovs local_ip 10.0.0.31
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ovs enable_tunneling True
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini agent tunnel_types gre

在计算节点启动服务:
systemctl enable openvswitch.service
systemctl start openvswitch.service

在计算节点修改配置文件:
openstack-config --set /etc/nova/nova.conf DEFAULT network_api_class nova.network.neutronv2.api.API
openstack-config --set /etc/nova/nova.conf DEFAULT security_group_api neutron
openstack-config --set /etc/nova/nova.conf DEFAULT linuxnet_interface_driver nova.network.linux_net.LinuxOVSInterfaceDriver
openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
openstack-config --set /etc/nova/nova.conf neutron url http://myvip:9696
openstack-config --set /etc/nova/nova.conf neutron auth_strategy keystone
openstack-config --set /etc/nova/nova.conf neutron admin_auth_url http://myvip:35357/v2.0
openstack-config --set /etc/nova/nova.conf neutron admin_tenant_name service
openstack-config --set /etc/nova/nova.conf neutron admin_username neutron
openstack-config --set /etc/nova/nova.conf neutron admin_password 123456

在计算节点创建符号链接、拷贝等操作:
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini

cp /usr/lib/systemd/system/neutron-openvswitch-agent.service \
  /usr/lib/systemd/system/neutron-openvswitch-agent.service.orig
sed -i ‘s,plugins/openvswitch/ovs_neutron_plugin.ini,plugin.ini,g‘ \
  /usr/lib/systemd/system/neutron-openvswitch-agent.service

重启相关服务:
systemctl restart openstack-nova-compute.service
systemctl enable neutron-openvswitch-agent.service
systemctl start neutron-openvswitch-agent.service

验证:
source admin-openrc.sh
neutron agent-list

+--------------------------------------+--------------------+----------+-------+----------------+---------------------------+
| id                                   | agent_type         | host     | alive | admin_state_up | binary                    |
+--------------------------------------+--------------------+----------+-------+----------------+---------------------------+
| afdc8ccd-d997-41ca-8176-59b47b90cf87 | Metadata agent     | network  | :-)   | True           | neutron-metadata-agent    |
| b70c7a39-9aae-4fb4-8be1-f4ac7a127004 | Open vSwitch agent | compute1 | :-)   | True           | neutron-openvswitch-agent |
| b934acfb-8a10-424b-8510-2c692adbadd3 | DHCP agent         | network  | :-)   | True           | neutron-dhcp-agent        |
| bb530231-b099-455d-8cbd-72c782a6514e | Open vSwitch agent | network  | :-)   | True           | neutron-openvswitch-agent |
| c21e8af8-0db9-4aaa-b7c6-788109fd23c7 | L3 agent           | network  | :-)   | True           | neutron-l3-agent          |
+--------------------------------------+--------------------+----------+-------+----------------+---------------------------+

时间: 2024-10-17 00:49:39

openstack controller ha测试环境搭建记录(十二)——配置neutron(计算节点)的相关文章

openstack controller ha测试环境搭建记录(二)——配置corosync和pacemaker

corosync.conf请备份再编辑:# vi /etc/corosync/corosync.conf totem {        version: 2 token: 10000        token_retransmits_before_loss_const: 10        secauth: off        rrp_mode: active interface {                ringnumber: 0                bindnetaddr

openstack controller ha测试环境搭建记录(一)——操作系统准备篇

为了初步了解openstack controller ha的工作原理,搭建测试环境进行学习. 在学习该方面知识时,当前采用的操作系统版本是centos 7.1 x64.首先在ESXi中建立2台用于测试的虚机,最小化安装完成centos,配置IP分别为10.0.0.12.10.0.0.13,主机名分别为controller2.controller3. 关闭防火墙:# systemctl stop firewalld# systemctl disable firewalld 修改主机名:# host

openstack controller ha测试环境搭建记录(四)——配置mysql数据库集群

内容正式开始前,我已经在集群中添加了新的节点controller1(IP地址为10.0.0.14). 安装软件:# yum install -y mariadb-galera-server xinetd rsync 创建用于健康检查的用户:# systemctl start mysqld.service# mysql -e "CREATE USER 'clustercheck'@'localhost' IDENTIFIED BY '123456';"# systemctl stop m

openstack controller ha测试环境搭建记录(十四)——配置cinder(存储节点)

先简述cinder存储节点的配置:  1.IP地址是10.0.0.41:  2.主机名被设置为block1:  3.所有节点的hosts文件已添加相应条目:  4.已经配置了ntp时间同步:  5.已安装lvm2,并设置为开机自动启动:  6.已经挂载了新的存储设备/dev/sdb. 在存储节点执行下列命令:pvcreate /dev/sdb1vgcreate cinder-volumes /dev/sdb1 在存储节点和计算节点执行df命令:# df -hFilesystem         

openstack controller ha测试环境搭建记录(十五)——创建实例

# source demo-openrc.sh # ssh-keygenGenerating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_rsa):Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /root/.ssh

openstack controller ha测试环境搭建记录(六)——配置keystone

在所有节点的hosts文件添加:10.0.0.10 myvip 在所有节点安装# yum install -y openstack-keystone python-keystoneclient# yum install -y openstack-utils 在所有节点设置keystone.conf文件使用mysql集群地址:# openstack-config --set /etc/keystone/keystone.conf database connection mysql://keysto

openstack controller ha测试环境搭建记录(十三)——配置cinder(控制节点)

在任一控制节点创建用户:mysql -u root -pCREATE DATABASE cinder;GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY '123456';GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY '123456'; 在任一控制节点创建相关用户:source admin-openrc.shkeystone u

openstack controller ha测试环境搭建记录(三)——配置haproxy

haproxy.cfg请备份再编辑:# /etc/haproxy/haproxy.cfg global    chroot /var/lib/haproxy    daemon    group haproxy    maxconn 4000    pidfile /var/run/haproxy.pid    user haproxy defaults    log global    maxconn 4000    option redispatch    retries 3    time

openstack controller ha测试环境搭建记录(十一)——配置neutron(网络节点)

在网络节点配置内核参数:vi /etc/sysctl.confnet.ipv4.ip_forward=1net.ipv4.conf.all.rp_filter=0net.ipv4.conf.default.rp_filter=0 在网络节点使内核参数立即生效:sysctl -p 在网络节点安装软件:yum install -y openstack-neutron openstack-neutron-ml2 openstack-neutron-openvswitch 在网络节点修改配置文件:ope