openstack高可用:neutron高可用(控制+网络)
neutron-server高可用
neutron-server 11.3.1 NEUTRON-SERVER在NODE2的安装
yuminstall openstack-neutron openstack-neutron-ml2 python-neutronclient 11.3.2 NEUTRON-SERVER在NODE2的配置
将node1的neutron配置拷贝到node2: [root@lxp-node2 etc]# scp192.168.129.130:/etc/neutron.tar.bz2 ./ # tar jxvf neutron.tar.bz2 1. 修改/etc/neutron/neutron.conf
修改前: [root@lxp-node2 neutron]# grep 192 ./ -r ./plugins/ml2/openvswitch_agent.ini:local_ip=192.168.129.130 ->192.168.129.131 ./metadata_agent.ini:nova_metadata_ip =192.168.129.130 -> 192.168.129.131 ./api-paste.ini:identity_uri=http://192.168.129.130:35357->192.168.129.139:35362 ./api-paste.ini:auth_uri=http://192.168.129.130:5000/v2.0->192.168.129.139:5005 ./neutron.conf:nova_admin_auth_url=http://192.168.129.130:5000/v2.0 ->192.168.129.139:5005 ./neutron.conf:connection =mysql://neutron:11be293368c044cb@192.168.129.139/neutron ./neutron.conf:rabbit_host = 192.168.129.130 ./neutron.conf:rabbit_hosts ="192.168.129.130:5672, 192.168.129.131:5672" [root@lxp-node2 neutron]# grep port ./neutron.conf |grep -v '^#' bind_port = 9696 :不用改,这里haproxy监听的时候使用9701即可,neutron还是使用本身的port notify_nova_on_port_status_changes = True notify_nova_on_port_data_changes = True report_interval = 30 rabbit_port = 5672 修改后(node2): [root@lxp-node2 neutron]# grep 192 ./ -r ./plugins/ml2/openvswitch_agent.ini:local_ip =192.168.129.131 ./metadata_agent.ini:auth_url =http://192.168.129.139:5005/v2.0 ./metadata_agent.ini:nova_metadata_ip = 192.168.129.131 ./api-paste.ini:identity_uri=http://192.168.129.139:35362 ./api-paste.ini:auth_uri=http://192.168.129.139:5005/v2.0 ./neutron.conf:nova_admin_auth_url =http://192.168.129.139:5005/v2.0 ./neutron.conf:connection =mysql://neutron:11be293368c044cb@192.168.129.139/neutron ./neutron.conf:rabbit_host =192.168.129.130 ./neutron.conf:rabbit_hosts ="192.168.129.130:5672, 192.168.129.131:5672" Node1: [root@lxp-node1 neutron(keystone_admin)]#grep 192 ./ -r ./plugins/ml2/openvswitch_agent.ini:local_ip=192.168.129.130 ./neutron.conf:nova_admin_auth_url =http://192.168.129.139:5005/v2.0 ./neutron.conf:connection =mysql://neutron:11be293368c044cb@192.168.129.139/neutron ./neutron.conf:rabbit_host =192.168.129.130 ./neutron.conf:rabbit_hosts ="192.168.129.130:5672, 192.168.129.131:5672" ./metadata_agent.ini:auth_url =http://192.168.129.139:5005/v2.0 ./metadata_agent.ini:nova_metadata_ip =192.168.129.130 ./api-paste.ini:identity_uri=http://192.168.129.139:35362 ./api-paste.ini:auth_uri=http://192.168.129.139:5005/v2.0 OK 2. 修改/etc/nova/nova.conf
[neutron]字段: [neutron] service_metadata_proxy=True metadata_proxy_shared_secret=41094d17a9f44191 url=http://192.168.129.130:9696 -> 192.168.129.139:9701 admin_username=neutron admin_password=9aabaad5de0f4d05 admin_tenant_name=services region_name=RegionOne admin_auth_url=http://192.168.129.139:5005/v2.0 auth_strategy=keystone ovs_bridge=br-int extension_sync_interval=600 timeout=30 default_tenant_id=default 其他地方不用改 Node1做同样的修改 3. 修改/etc/neutron/plugins/ml2/:
[root@lxp-node2 ml2]# grep 192 ./ -r ./openvswitch_agent.ini:local_ip=192.168.129.130 其他都不用改 Node1做同样的修改 11.3.3 NEUTRON-SERVER的HAPROXY端口监听
192.168.129.139:9701 ->192.168.129.130:9696 listen neutron_server bind 192.168.129.139:9701 balance source option tcpka option tcplog server lxp-node1 192.168.129.130:9696 check inter 2000 rise 2 fall 5 server lxp-node2 192.168.129.131:9696 check inter 2000 rise 2 fall 5 11.3.4 NEUTRON-SERVER的数据库修改
CONFIG_NEUTRON_DB_PW=11be293368c044cb MariaDB [(none)]> GRANT ALL PRIVILEGESON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY '11be293368c044cb'; MariaDB [(none)]> GRANT ALL PRIVILEGESON neutron.* TO 'neutron'@'%' IDENTIFIED BY '11be293368c044cb'; MariaDB [(none)]> FLUSH PRIVILEGES; 修改数据库的endpoint,其他应该都不用修改 # openstack role add --project service--user neutron admin # openstack role add --project services--user neutron admin # openstack role add --project admin --userneutron admin 删除老的neutron endpoint: [root@lxp-node1 haproxy(keystone_admin)]#openstack endpoint list +----------------------------------+-----------+--------------+--------------+ | ID | Region | Service Name | Service Type | +----------------------------------+-----------+--------------+--------------+ | ef777d9e65434cb1a24555144c78fd99 |RegionOne | nova | compute | | 5469eeed12ae42449977bb3541c7039e |RegionOne | cinderv2 | volumev2 | | 301027ac65ef4ee2a7994275f3a91427 |RegionOne | cinder | volume | | 74b982dfb27248039c271102624a4d51 | RegionOne| glance | image | | 055dec6b53284b83a0668a023fa14092 |RegionOne | keystone | identity | | 3a1233801b714c918db081e76c327bfe |RegionOne | nova_ec2 | ec2 | | af697a2b04cd4d49b7a236aea77b162f | RegionOne | neutron | network | | 9447b7514cf348a290832b48fe9d8141 |RegionOne | novav3 | computev3 | | f1ebdf7630114073899230654a2256d1 |RegionOne | ceilometer | metering | +----------------------------------+-----------+--------------+--------------+ # openstack endpoint deleteaf697a2b04cd4d49b7a236aea77b162f 创建新的endpoint: openstackendpoint create \ --regionRegionOne \ network +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | id | b4f27b9c36f14b0e87076db9d47dbddf | | region | RegionOne | | service_id | 7ec1f922618c494e932f230d18875937 | | service_name | neutron | | service_type | network | +--------------+----------------------------------+ [root@lxp-node1 haproxy(keystone_admin)]# 11.3.5 重启HAPROXY,重启NEUTRON-SERVER及NEUTRON其他服务,重启NOVA,检查服务
Node1: systemctl restart haproxy # systemctlenable neutron-server.service # systemctl restartneutron-server.service
# systemctlenable openvswitch.service # systemctl restartopenvswitch.service # systemctlenable neutron-openvswitch-agent.service neutron-l3-agent.service neutron-dhcp-agent.serviceneutron-metadata-agent.service neutron-ovs-cleanup.service # systemctl restartneutron-openvswitch-agent.service neutron-l3-agent.service neutron-dhcp-agent.serviceneutron-metadata-agent.service systemctlrestart openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service 查看服务: [root@lxp-node1 haproxy(keystone_admin)]#ps -A |grep ha 43603 ? 00:00:00 haproxy-systemd 43604 ? 00:00:00 haproxy 43612 ? 00:00:14 haproxy [root@lxp-node1 haproxy(keystone_admin)]#ps -A |grep neu \ 43950 ? 00:00:04 neutron-server 43992 ? 00:00:00 neutron-server 43993 ? 00:00:00 neutron-server 43994 ? 00:00:02 neutron-server 43995 ? 00:00:02 neutron-server 44458 ? 00:00:02 neutron-l3-agen 44473 ? 00:00:00 neutron-rootwra 44477 ? 00:00:05 neutron-openvsw 44490 ? 00:00:03 neutron-rootwra 44528 ? 00:00:00 neutron-rootwra 44649 ? 00:00:02 neutron-dhcp-ag 44732 ? 00:00:02 neutron-metadat 44763 ? 00:00:00 neutron-metadat 44764 ? 00:00:00 neutron-metadat [root@lxp-node1 haproxy(keystone_admin)]#ps -A |grep nova 1293 ? 00:00:13nova-novncproxy 1303 ? 00:00:31 nova-cert 1305 ? 00:00:31nova-consoleaut 45087 ? 00:00:10 nova-conductor 45090 ? 00:00:10 nova-scheduler 45091 ? 00:00:12 nova-api 45253 ? 00:00:02 nova-conductor 45255 ? 00:00:02 nova-conductor 45289 ? 00:00:00 nova-api 45290 ? 00:00:00 nova-api 45311 ? 00:00:00 nova-api 45312 ? 00:00:00 nova-api 45329 ? 00:00:00 nova-api 45330 ? 00:00:00 nova-api Node2: [root@lxp-node1 ~]# systemctl restarthaproxy [root@lxp-node2 haproxy]# systemctl enableneutron-server.service Created symlink from/etc/systemd/system/multi-user.target.wants/neutron-server.service to/usr/lib/systemd/system/neutron-server.service. [root@lxp-node2 haproxy]# systemctl restart neutron-server.service [root@lxp-node2 haproxy]# systemctl enableopenvswitch.service [root@lxp-node2 haproxy]# systemctl restart openvswitch.service [root@lxp-node2 haproxy]# systemctl enableneutron-openvswitch-agent.service neutron-l3-agent.serviceneutron-dhcp-agent.service neutron-metadata-agent.serviceneutron-ovs-cleanup.service [root@lxp-node2 haproxy]# systemctl restartneutron-openvswitch-agent.service neutron-l3-agent.serviceneutron-dhcp-agent.service neutron-metadata-agent.service [root@lxp-node2 haproxy]# systemctl restartopenstack-nova-api.service openstack-nova-scheduler.serviceopenstack-nova-conductor.service [root@lxp-node2 haproxy]# ps -A |grep ha 41797 ? 00:00:00 haproxy-systemd 41798 ? 00:00:00 haproxy 41800 ? 00:00:08 haproxy [root@lxp-node2 haproxy]# [root@lxp-node2 haproxy]# ps -A |grepneutron 41916 ? 00:00:14 neutron-server 42090 ? 00:00:00 neutron-server 42091 ? 00:00:00 neutron-server 42092 ? 00:00:07 neutron-server 42094 ? 00:00:02 neutron-server 42687 ? 00:00:07 neutron-l3-agen 42698 ? 00:00:10 neutron-openvsw 42727 ? 00:00:03 neutron-dhcp-ag 42752 ? 00:00:02 neutron-rootwra 42758 ? 00:00:04 neutron-metadat 42808 ? 00:00:00 neutron-rootwra 42870 ? 00:00:00 neutron-metadat 42871 ? 00:00:00 neutron-metadat [root@lxp-node2 haproxy]# ps -A |grep nova 1282 ? 00:00:13nova-novncproxy 1292 ? 00:00:40nova-consoleaut 1293 ? 00:00:37 nova-cert 43426 ? 00:00:09 nova-scheduler 43540 ? 00:00:07 nova-conductor 43676 ? 00:00:08 nova-api 43705 ? 00:00:05 nova-conductor 43706? 00:00:02 nova-conductor 43783 ? 00:00:00 nova-api 43784 ? 00:00:00 nova-api 43870 ? 00:00:00 nova-api 43871 ? 00:00:00 nova-api 43942 ? 00:00:00 nova-api 43943 ? 00:00:00 nova-api 检查服务: [root@lxp-node1 haproxy(keystone_admin)]#nova service-list +----+------------------+-----------+----------+---------+-------+----------------------------+-----------------+ | Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason | +----+------------------+-----------+----------+---------+-------+----------------------------+-----------------+ | 1 | nova-consoleauth | lxp-node1 | internal | enabled | up | 2016-05-22T12:28:10.000000 | - | | 2 | nova-scheduler | lxp-node1 |internal | enabled | up |2016-05-22T12:28:07.000000 | - | | 3 | nova-conductor | lxp-node1 |internal | enabled | up |2016-05-22T12:28:10.000000 | - | | 5 | nova-compute | lxp-node3 |nova | enabled | up | 2016-05-22T12:28:02.000000 | - | | 6 | nova-cert | lxp-node1 |internal | enabled | up |2016-05-22T12:28:07.000000 | - | | 8 | nova-consoleauth | lxp-node2 | internal | enabled | up | 2016-05-22T12:28:02.000000 | - | | 10 | nova-conductor | lxp-node2 | internal | enabled | up | 2016-05-22T12:28:07.000000 | - | | 11 | nova-cert | lxp-node2 | internal | enabled |up | 2016-05-22T12:28:02.000000 |- | | 12 | nova-scheduler | lxp-node2 | internal | enabled | up | 2016-05-22T12:28:02.000000 | - | +----+------------------+-----------+----------+---------+-------+----------------------------+-----------------+ 所有服务运行正常: [root@lxp-node1 haproxy(keystone_admin)]#neutron agent-list +--------------------------------------+--------------------+-----------+-------+----------------+---------------------------+ | id |agent_type | host | alive | admin_state_up | binary | +--------------------------------------+--------------------+-----------+-------+----------------+---------------------------+ | 0b226d7f-4bdf-4155-a5ef-8617a8273351 |Open vSwitch agent | lxp-node3 | :-) |True |neutron-openvswitch-agent | | 25c14556-a2d7-4215-abb9-448c81293b5b |Open vSwitch agent | lxp-node2 | :-) |True |neutron-openvswitch-agent | | 35f4fb4e-f110-417d-b7d4-1f1657e22d11 |Metadata agent | lxp-node2 | :-) | True | neutron-metadata-agent | | 5cdf535f-b69c-4e4c-88f2-f8e1364f410d |DHCP agent | lxp-node2 | :-) | True | neutron-dhcp-agent | | 5e5ea273-0c9d-495f-b9f1-510c1fbd3049 |DHCP agent | lxp-node1 | :-) | True | neutron-dhcp-agent | | 7478599d-952b-49c2-8f8e-57c37061e717 | L3agent | lxp-node1 | :-) | True | neutron-l3-agent | | 849d2442-58a6-4a84-a951-f2d10bc182cb |Metadata agent | lxp-node1 | :-) | True | neutron-metadata-agent | | a61201be-34a9-47d2-b651-e3e6a79bd0c5 | L3agent | lxp-node2 | :-) | True | neutron-l3-agent | | ef59a3d1-cd18-4fac-bdf0-7df1cdb10588 |Open vSwitch agent | lxp-node1 | :-) |True |neutron-openvswitch-agent | +--------------------------------------+--------------------+-----------+-------+----------------+---------------------------+ 11.3.6 NEUTRON-SERVER的高可用验证
[root@lxp-node1 haproxy(keystone_admin)]#neutron agent-list +--------------------------------------+--------------------+-----------+-------+----------------+---------------------------+ | id |agent_type | host | alive | admin_state_up | binary | +--------------------------------------+--------------------+-----------+-------+----------------+---------------------------+ | 0b226d7f-4bdf-4155-a5ef-8617a8273351 |Open vSwitch agent | lxp-node3 | :-) |True |neutron-openvswitch-agent | | 25c14556-a2d7-4215-abb9-448c81293b5b |Open vSwitch agent | lxp-node2 | :-) |True |neutron-openvswitch-agent | | 35f4fb4e-f110-417d-b7d4-1f1657e22d11 |Metadata agent | lxp-node2 | :-) | True | neutron-metadata-agent | | 5cdf535f-b69c-4e4c-88f2-f8e1364f410d |DHCP agent | lxp-node2 | :-) | True | neutron-dhcp-agent | | 5e5ea273-0c9d-495f-b9f1-510c1fbd3049 |DHCP agent | lxp-node1 | :-) | True | neutron-dhcp-agent | | 7478599d-952b-49c2-8f8e-57c37061e717 | L3agent | lxp-node1 | :-) | True | neutron-l3-agent | | 849d2442-58a6-4a84-a951-f2d10bc182cb |Metadata agent | lxp-node1 | :-) | True | neutron-metadata-agent | | a61201be-34a9-47d2-b651-e3e6a79bd0c5 | L3agent | lxp-node2 | :-) | True | neutron-l3-agent | | ef59a3d1-cd18-4fac-bdf0-7df1cdb10588 |Open vSwitch agent | lxp-node1 | :-) | True | neutron-openvswitch-agent | +--------------------------------------+--------------------+-----------+-------+----------------+---------------------------+ Neutron节点OK,暂时不必验证 12. 网络节点高可用配置
Neutron各种agent 4599 ? 00:00:00neutron-metadat 4619 ? 00:00:31neutron-openvsw 4620 ? 00:00:12neutron-dhcp-ag 4667 ? 00:00:01neutron-rootwra 这里已经在控制节点中全部修改,不用再做高可用配置 只需要验证是否高可用即可 12.1 网络节点高可用验证:单点故障验证
[root@lxp-node1 haproxy(keystone_admin)]#neutron agent-list +--------------------------------------+--------------------+-----------+-------+----------------+---------------------------+ | id |agent_type | host | alive | admin_state_up | binary | +--------------------------------------+--------------------+-----------+-------+----------------+---------------------------+ | 0b226d7f-4bdf-4155-a5ef-8617a8273351 |Open vSwitch agent | lxp-node3 | :-) |True |neutron-openvswitch-agent | | 25c14556-a2d7-4215-abb9-448c81293b5b |Open vSwitch agent | lxp-node2 | :-) |True |neutron-openvswitch-agent | | 35f4fb4e-f110-417d-b7d4-1f1657e22d11 |Metadata agent | lxp-node2 | :-) | True | neutron-metadata-agent | | 5cdf535f-b69c-4e4c-88f2-f8e1364f410d |DHCP agent | lxp-node2 | :-) | True | neutron-dhcp-agent | | 5e5ea273-0c9d-495f-b9f1-510c1fbd3049 |DHCP agent | lxp-node1 | :-) | True | neutron-dhcp-agent | | 7478599d-952b-49c2-8f8e-57c37061e717 | L3agent | lxp-node1 | :-) | True | neutron-l3-agent | | 849d2442-58a6-4a84-a951-f2d10bc182cb |Metadata agent | lxp-node1 | :-) | True | neutron-metadata-agent | | a61201be-34a9-47d2-b651-e3e6a79bd0c5 | L3agent | lxp-node2 | :-) | True | neutron-l3-agent | | ef59a3d1-cd18-4fac-bdf0-7df1cdb10588 |Open vSwitch agent | lxp-node1 | :-) | True | neutron-openvswitch-agent | +--------------------------------------+--------------------+-----------+-------+----------------+---------------------------+ Neutron节点OK,暂时不必验证
http://www.chongchonggou.com/g_56926821.html
|