云计算基础设施平台iaas(openstack)超级详细搭建(十九)Lbaas负载均衡

98 篇文章 19 订阅
49 篇文章 25 订阅

前面几篇博客已经介绍了如何去一步一步的搭建云平台,无论是执行脚本还是手动搭建,整个过程也是有些漫长
本篇博客将会介绍如何去做Lbaas负载均衡

Lbaas负载均衡

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

下面开始新增成员
在这里插入图片描述

在这里插入图片描述

下面新增监控
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

下面添加VIP
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

关联监控
在这里插入图片描述

绑定浮动ip
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

接下来可以使用我们的命令去查看我们的Lbaas有关情况和详情细节

[root@controller bin]# neutron agent-list
+-----------------------+--------------------+------------+-------------------+-------+----------------+-----------------------+
| id                    | agent_type         | host       | availability_zone | alive | admin_state_up | binary                |
+-----------------------+--------------------+------------+-------------------+-------+----------------+-----------------------+
| 4df7bdd9-fb4d-475d-97 | Metadata agent     | controller |                   | :-)   | True           | neutron-metadata-     |
| 87-9bb2b9ebfdd1       |                    |            |                   |       |                | agent                 |
| 6b0947ae-1af0-4f23    | Open vSwitch agent | compute    |                   | :-)   | True           | neutron-openvswitch-  |
| -a80c-4bb393006b7f    |                    |            |                   |       |                | agent                 |
| 6e5272b3-d348-410c-   | Metadata agent     | compute    |                   | :-)   | True           | neutron-metadata-     |
| b6f5-aba798fc6b1a     |                    |            |                   |       |                | agent                 |
| 75aff0be-81af-4d8a-a4 | L3 agent           | controller | nova              | :-)   | True           | neutron-l3-agent      |
| 73-037c6b9d840d       |                    |            |                   |       |                |                       |
| 9784d842-d2b6-46a6-b6 | DHCP agent         | controller | nova              | :-)   | True           | neutron-dhcp-agent    |
| a3-05f036778267       |                    |            |                   |       |                |                       |
| a3e77f5d-390c-4201-bc | Loadbalancer agent | controller |                   | :-)   | True           | neutron-lbaas-agent   |
| 16-f46a47551bcc       |                    |            |                   |       |                |                       |
| e944fb07-06e8-448c-   | Open vSwitch agent | controller |                   | :-)   | True           | neutron-openvswitch-  |
| bd70-be93e7ce1713     |                    |            |                   |       |                | agent                 |
+-----------------------+--------------------+------------+-------------------+-------+----------------+-----------------------+
[root@controller bin]# neutron lb-pool-show resourcepool
Unable to find pool with name or id 'resourcepool'
[root@controller bin]# neutron lb-pool-list
+--------------------------------------+---------------+----------+-------------+----------+----------------+--------+
| id                                   | name          | provider | lb_method   | protocol | admin_state_up | status |
+--------------------------------------+---------------+----------+-------------+----------+----------------+--------+
| a84b45ce-7fcf-4543-b207-2e489fa0722b | resource_pool | haproxy  | ROUND_ROBIN | HTTP     | True           | ACTIVE |
+--------------------------------------+---------------+----------+-------------+----------+----------------+--------+
[root@controller bin]# neutron lb-pool-show resource_pool
+------------------------+--------------------------------------------------------------------------------------------------------+
| Field                  | Value                                                                                                  |
+------------------------+--------------------------------------------------------------------------------------------------------+
| admin_state_up         | True                                                                                                   |
| description            | resource_pool                                                                                          |
| health_monitors        | 1b52b92e-dd44-4c43-98f5-4be55ae0cd01                                                                   |
| health_monitors_status | {"monitor_id": "1b52b92e-dd44-4c43-98f5-4be55ae0cd01", "status": "ACTIVE", "status_description": null} |
| id                     | a84b45ce-7fcf-4543-b207-2e489fa0722b                                                                   |
| lb_method              | ROUND_ROBIN                                                                                            |
| members                | 58044b7b-3bf9-4f19-9c44-2687b3508a3a                                                                   |
| name                   | resource_pool                                                                                          |
| protocol               | HTTP                                                                                                   |
| provider               | haproxy                                                                                                |
| status                 | ACTIVE                                                                                                 |
| status_description     |                                                                                                        |
| subnet_id              | 01655c52-a687-4d29-81df-15b15fa70d88                                                                   |
| tenant_id              | 7551518924a3446dad5827159148db8b                                                                       |
| vip_id                 | 5926749c-6994-45fe-97b3-5649ae0cb247                                                                   |
+------------------------+--------------------------------------------------------------------------------------------------------+
[root@controller bin]# neutron lb-vip-list
+--------------------------------------+------------------+----------+----------+----------------+--------+
| id                                   | name             | address  | protocol | admin_state_up | status |
+--------------------------------------+------------------+----------+----------+----------------+--------+
| 5926749c-6994-45fe-97b3-5649ae0cb247 | resource_poolVip | 10.0.0.4 | HTTP     | True           | ACTIVE |
+--------------------------------------+------------------+----------+----------+----------------+--------+
[root@controller bin]# neutron lb-vip-show resource_poolVip
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| address             | 10.0.0.4                             |
| admin_state_up      | True                                 |
| connection_limit    | -1                                   |
| description         | resource_poolV                       |
| id                  | 5926749c-6994-45fe-97b3-5649ae0cb247 |
| name                | resource_poolVip                     |
| pool_id             | a84b45ce-7fcf-4543-b207-2e489fa0722b |
| port_id             | fae1af3f-a88a-4969-8291-9b5a86b93362 |
| protocol            | HTTP                                 |
| protocol_port       | 80                                   |
| session_persistence |                                      |
| status              | ACTIVE                               |
| status_description  |                                      |
| subnet_id           | 01655c52-a687-4d29-81df-15b15fa70d88 |
| tenant_id           | 7551518924a3446dad5827159148db8b     |
+---------------------+--------------------------------------+

查看资源池的haproxy配置文件

[root@controller bin]# cat  /var/lib/neutron/lbaas/a84b45ce-7fcf-4543-b207-2e489fa0722b/conf 
global
        daemon
        user nobody
        group haproxy
        log /dev/log local0
        log /dev/log local1 notice
        stats socket /var/lib/neutron/lbaas/a84b45ce-7fcf-4543-b207-2e489fa0722b/sock mode 0666 level user
defaults
        log global
        retries 3
        option redispatch
        timeout connect 5000
        timeout client 50000
        timeout server 50000
frontend 5926749c-6994-45fe-97b3-5649ae0cb247
        option tcplog
        bind 10.0.0.4:80
        mode http
        default_backend a84b45ce-7fcf-4543-b207-2e489fa0722b
        option forwardfor
backend a84b45ce-7fcf-4543-b207-2e489fa0722b
        mode http
        balance roundrobin
        option forwardfor
        timeout check 20s
        option httpchk GET /
        http-check expect rstatus 200
        server 58044b7b-3bf9-4f19-9c44-2687b3508a3a 10.0.0.3:80 weight 5 check inter 30s fall 5[root@controller bin]# 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

抛物线.

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值