1.Nginx不再赘述
2.Keepalived
配置
! Configuration File for keepalived
global_defs {
notification_email {
acassen@firewall.loc
服务器托管网 failover@firewall.loc
sysadmin@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 192.168.200.1
smtp_connect_timeout 30
router_id LVS_DEVEL
vrrp_skip_check_adv_addr
vrrp_strict
vrrp_garp_interval 0
vrrp_gna_interval 0
}
vrrp_instance VI_1 {
state MASTER
interface ens3
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
198.10.51.2
}
}
三个文件:
3.HA
配置
global
log 127.0.0.1 local0 info
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 1020 # See also: ulimit -n
user haproxy
group haproxy
daemon
# turn on stats unix socket
stats socket /var/lib/haproxy/stats.sock mode 600 level admin
stats timeout 2m
defaults
mode tcp
log global
option dontlognull
option redispatch
timeout http-request 服务器托管网 10s
retries 3
timeout queue 45s
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 1020
listen status
mode http
bind *:8070
stats enable
stats uri /admin?stats
stats realm Haproxy Statistics
stats auth admin:admin
stats admin if TRUE
frontend nginx-8089web
bind *:8090
default_backend nginx-8089web
backend nginx-8089web
option httpchk HEAD /check.txt HTTP/1.0
balance roundrobin
server web01 198.10.51.110:18090 weight 3 check inter 5s rise 2 fall 3
server web02 198.10.51.111:18090 weight 3 check inter 5s rise 2 fall 3
参考资料:
1.https://blog.csdn.net/qq18346342939/article/details/127093139
2.https://www.jianshu.com/p/584f964d54d0
3.https://blog.51cto.com/u_710020/5680204
4.https://www.56dr.com/info/4123.html
5.https://blog.csdn.net/cnskylee/article/details/131591733
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net
相关推荐: 「Qt中文教程指南」如何创建基于Qt Widget的应用程序(四)
Qt是目前最先进、最完整服务器托管网的跨平台C++开发工具。它不仅完全实现了一次编写,所有平台无差别运行,更提供了几乎所有开发过程中需要用到的工具。如今,Qt已被运用于超过70个行业、数千家企业,支持数百万设备及应用。 本文描述了如何使用Qt Creator创…