mirror of https://github.com/easzlab/kubeasz.git
修复CentOS 下haproxy 工作目录
parent
5c2a151b2b
commit
a37ce501e0
|
@ -205,6 +205,7 @@ vrrp_instance VI-kube-master {
|
|||
```
|
||||
+ vrrp_script 定义了监测haproxy进程的脚本,利用shell 脚本`killall -0 haproxy` 进行检测进程是否存活,如果进程不存在,根据`weight -30`设置将主节点优先级降低30,这样原先备节点将变成主节点。
|
||||
+ vrrp_instance 定义了vrrp组,包括优先级、使用端口、router_id、心跳频率、检测脚本、虚拟地址VIP等
|
||||
+ 特别注意 `virtual_router_id` 标识了一个 VRRP组,在同网段下必须唯一,否则出现 `Keepalived_vrrp: bogus VRRP packet received on eth0 !!!`类似报错
|
||||
|
||||
#### 配置keepalived备节点 [keepalived-backup.conf.j2](../roles/lb/templates/keepalived-backup.conf.j2)
|
||||
``` bash
|
||||
|
@ -224,7 +225,7 @@ vrrp_instance VI-kube-master {
|
|||
}
|
||||
}
|
||||
```
|
||||
+ 备节点的配置类似主节点,除了优先级和检测脚本
|
||||
+ 备节点的配置类似主节点,除了优先级和检测脚本,其他如 `virtual_router_id` `advert_int` `virtual_ipaddress`必须与主节点一致
|
||||
|
||||
### 启动 keepalived 和 haproxy 后验证
|
||||
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
- name: 创建haproxy配置目录
|
||||
file: name=/etc/haproxy state=directory
|
||||
|
||||
- name: 创建haproxy工作目录
|
||||
file: name=/run/haproxy state=directory
|
||||
|
||||
- name: 配置 haproxy
|
||||
template: src=haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg
|
||||
|
||||
|
|
Loading…
Reference in New Issue