修复CentOS 下haproxy 工作目录

pull/29/head
jmgao 2017-12-15 16:26:37 +08:00
parent 5c2a151b2b
commit a37ce501e0
2 changed files with 5 additions and 1 deletions

View File

@ -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 后验证

View File

@ -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