我正在尝试在 Ubuntu 14.04 上设置双站点 haproxy (1.5.10)。
当我service heartbeat restart
在 eartha 上执行此操作时,两台机器都短暂地变为绿色;然后 earthb 变为黄色 -> 红色!
当我service heartbeat restart
在 earthb 上执行此操作时,两台机器都短暂地变为绿色;然后 eartha 变为黄色 -> 红色!
就好像一台机器的重新启动会导致另一台机器停止运行???
所有防火墙目前均已禁用。
设置如下:
虚拟 IP:131.43.93.207
厄莎:131.43.93.212 (eth0),10.100.100.71 (eth1)
地球:131.43.93.214 (eth0),10.100.100.72 (eth1)
这是 eartha 的配置(earthb 的镜像):
配置文件
eth0 Link encap:Ethernet HWaddr 08:00:27:21:32:a0
inet addr:131.43.93.212 Bcast:131.43.93.255 Mask:255.255.254.0
inet6 addr: fe80::a00:27ff:fe11:25a0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:926969 errors:0 dropped:0 overruns:0 frame:0
TX packets:358004 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:105321152 (105.3 MB) TX bytes:70526466 (70.5 MB)
eth0:0 Link encap:Ethernet HWaddr 08:00:27:21:32:a0
inet addr:131.43.93.207 Bcast:131.43.93.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth1 Link encap:Ethernet HWaddr 08:00:27:21:32:a1
inet addr:10.100.100.71 Bcast:10.100.100.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe11:25a1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:95069 errors:0 dropped:0 overruns:0 frame:0
TX packets:73007 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:27324681 (27.3 MB) TX bytes:24610741 (24.6 MB)
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
# Default ciphers to use on SSL-enabled listening sockets.
# For more information, see ciphers(1SSL).
ssl-default-bind-ciphers kEECDH+aRSA+AES:kRSA+AES:+AES256:RC4-SHA:!kEDH:!LOW:!EXP:!MD5:!aNULL:!eNULL
ssl-default-bind-options no-sslv3
tune.ssl.default-dh-param 2048
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
listen pithos
bind 131.43.93.207:80
bind 131.43.93.207:443 ssl crt /etc/apache2/ssl/combined.pem ciphers TLSv1+HIGH:!SSLv2:RC4+MEDIUM:!aNULL:!eNULL:!3DES:@STRENGTH
mode http
stats enable
stats uri /haproxy?stats
stats realm Strictly\ Private
stats auth admin:xxx
balance roundrobin
option http-server-close
timeout http-keep-alive 3000
option forwardfor
cookie JSESSIONID insert
server eartha 131.43.93.212:8080 cookie eartha check
server earthb 131.43.93.214:8080 cookie earthb check
redirect scheme https code 302 if !{ ssl_fc }
/etc/ha.d/haresources
eartha IPaddr::131.43.93.207/24/eth0 apache2
/etc/ha.d/ha.cf
watchdog /dev/watchdog
logfile /var/log/ha-log
debugfile /var/log/ha-debug
deadtime 5
warntime 10
initdead 15
bcast eth1
auto_failback on
node eartha
node earthb