十二、neutron控制节点集群

目录

一、neutron安装

1.创建数据库

2.创建用户以及端点

3.安装相关模块

4.配置nova.conf

5.配置metadata_agent.ini

6.配置ml2_conf.ini

7.配置linuxbridge_agent.ini

8.配置dhcp_agent.ini

9.配置neutron.conf

10.配置l3_agent.ini

11.同步数据库

12.haproxy配置

13.启动服务

二、安装其他节点neutron

1.安装模块

2.同步配置

3.修改配置

4.重启相关服务


 

   

neutron集群和其他服务的集群一样,可以先安装一台neutron服务,然后将本台neutron服务配置,同步到其他neutron节点,这里先安装zcontrollera1节点,即以下所有步骤都在zcontrollera1节点执行。

一、neutron安装

1.创建数据库

**1q2w3e4r是neutron数据库的密码

mysql -h vip -uroot -p -e "
CREATE DATABASE neutron;
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY '1q2w3e4r';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY '1q2w3e4r';
flush privileges;
"

2.创建用户以及端点

** neutron用户的密码是1q2w3e4r

. admin-openrc
openstack user create --domain default --password=1q2w3e4r neutron
openstack role add --project service --user neutron admin

openstack service create --name neutron --description "OpenStack Networking" network
openstack endpoint create --region RegionOne network public http://vip:9696
openstack endpoint create --region RegionOne network internal http://vip:9696
openstack endpoint create --region RegionOne network admin http://vip:9696

3.安装相关模块

yum install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables -y

4.配置nova.conf

[neutron]
url = http://vip:9696
auth_url = http://vip:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron用户的密码
service_metadata_proxy = true
metadata_proxy_shared_secret = metadata

5.配置metadata_agent.ini

[DEFAULT]
nova_metadata_ip = vip
metadata_proxy_shared_secret = metadata

6.配置ml2_conf.ini

[ml2]
tenant_network_types = vlan
type_drivers = vlan,flat
mechanism_drivers = linuxbridge
extension_drivers = port_security

[ml2_type_flat]
flat_networks = provider

[securitygroup]
enable_ipset = True
#vlan
[ml2_type_valn]
network_vlan_ranges = provider:3001:4000

7.配置linuxbridge_agent.ini

[linux_bridge]
physical_interface_mappings = provider:当前节点管理网卡

[vxlan]
enable_vxlan = false
#local_ip = 10.2.1.20
#l2_population = true

[agent]
prevent_arp_spoofing = True

[securitygroup]
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
enable_security_group = True

8.配置dhcp_agent.ini

interface_driver = linuxbridge
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true

9.配置neutron.conf

[DEFAULT]
bind_port = 9696
bind_host = 当前节点ip
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = true
transport_url = rabbit://openstack:rabbit用户密码@rabbit部署节点1的ip:5672,rabbit部署节点2的ip:5672
auth_strategy = keystone
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true

[keystone_authtoken]
auth_uri = http://vip:5000
auth_url = http://vip:35357
memcached_servers = 缓存部署节点1的ip:11211,缓存部署节点2的ip:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron用户的密码

[nova]
auth_url = http://vip:35357
auth_type = password
project_domain_id = default
user_domain_id = default
region_name = RegionOne
project_name = service
username = nova
password = nova用户的密码

[database]
connection = mysql://neutron:nutron数据库的密码@vip:3306/neutron

[oslo_concurrency]
lock_path = /var/lib/neutron/tmp

10.配置l3_agent.ini

[DEFAULT]
interface_driver = linuxbridge

11.同步数据库

#同步数据库
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf \
  --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron

#检测数据
mysql -h vip -u neutron -p -e "use neutron;show tables;"

12.haproxy配置

echo '
#Neutron_API
listen Neutron_API_cluster
bind 10.27.31.154:9696
balance source
option tcpka
option tcplog
server neutron部署节点1的ip neutron部署节点1的ip:9696 check inter 2000 rise 2 fall 5
server neutron部署节点2的ip neutron部署节点2的ip:9696 check inter 2000 rise 2 fall 5
'>>/etc/haproxy/haproxy.cfg

13.启动服务

#启动haproxy服务
systemctl restart haproxy.service
netstat -antp|grep haproxy

#重启相关服务
systemctl restart openstack-nova-api.service

#启动neutron
systemctl enable neutron-server.service \
  neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
  neutron-metadata-agent.service
systemctl restart neutron-server.service \
  neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
  neutron-metadata-agent.service

二、安装其他节点neutron

1.安装模块

ssh 要安装neutron节点的ip 'yum install -y openstack-neutron openstack-neutron-ml2 \
 openstack-neutron-linuxbridge python-neutronclient ebtables ipset'

2.同步配置

rsync -avzP -e 'ssh -p 22' /etc/nova/* 要安装的neutron节点ip:/etc/nova/
rsync -avzP -e 'ssh -p 22' /etc/neutron/* 要安装的neutron节点ip:/etc/neutron/
rsync -avzP -e 'ssh -p 22' /etc/haproxy/* 要安装的neutron节点ip:/etc/haproxy/

3.修改配置

**将每个节点下的nova.conf中以下配置修改成自己节点的IP
my_ip = 当前节点的IP地址
osapi_compute_listen = 当前节点的IP地址
metadata_listen = 当前节点的IP地址

**将每个节点下的neutron.conf中以下配置修改成自己节点的IP
bind_host = 当前节点的ip

4.重启相关服务

ssh 要配置neutron节点的IP "systemctl restart haproxy openstack-nova-api.service"

ssh 要配置neutron节点的IP "systemctl enable neutron-server.service \
neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
neutron-metadata-agent.service"


ssh 要配置neutron节点的IP "systemctl start neutron-server.service \
neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
neutron-metadata-agent.service"

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值