文档 . 2.4LTS
| yum -y install gcc openssl-devel pcre-devel systemd-devel |
| make -j 4 TARGET=linux-glibc \ |
| USE_OPENSSL=1 \ |
| USE_ZLIB=1 \ |
| USE_PCRE=1 \ |
| USE_SYSTEMD=1 |
| [root@localhost ~] |
| [Unit] |
| Description=haproxy seriver |
| Documentation=http://www.haproxy.org/ |
| After=network-online.target |
| Wants=network-online.target |
| |
| [Service] |
| ExecStartPre=/usr/local/sbin/haproxy -f /etc/haproxy/haproxy.cfg -c |
| ExecStart=/usr/local/sbin/haproxy -Ws -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid |
| ExecReload=/bin/kill -USR2 $MAINPID |
| Restart=always |
| RestartSec=15 |
| LimitNOFILE=65535 |
| OOMScoreAdjust=-999 |
| |
| [Install] |
| WantedBy=multi-user.target |
| [root@localhost ~] |
| global |
| log /dev/log local1 warning |
| chroot /var/lib/haproxy |
| user root |
| group root |
| daemon |
| nbproc 1 |
| |
| defaults |
| log global |
| timeout connect 5s |
| timeout client 10m |
| timeout server 10m |
| |
| listen kube-master |
| bind 0.0.0.0:6443 |
| mode tcp |
| option tcplog |
| option dontlognull |
| option dontlog-normal |
| balance roundrobin |
| server 10.4.7.10 10.4.7.10:8443 minconn 50 maxconn 500 check inter 1000 |
| server 10.4.7.11 10.4.7.11:8443 minconn 50 maxconn 500 check inter 1000 |
| server 10.4.7.12 10.4.7.12:8443 minconn 50 maxconn 500 check inter 1000 |
| listen registry |
| bind 0.0.0.0:5000 |
| mode tcp |
| option tcplog |
| option dontlognull |
| option dontlog-normal |
| balance roundrobin |
| server 55.3.107.81 55.3.107.81:5000 check inter 10s fall 2 rise 2 weight 1 |
| server 55.3.107.82 55.3.107.82:5000 check inter 10s fall 2 rise 2 weight 1 backup |
| |
| |
| listen haproxy-stats |
| bind 0.0.0.0:19000 |
| mode http |
| stats enable |
| stats uri /stats |
| stats realm Haproxy\ Statistics |
| stats auth admin:Cc1020304050! |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 葡萄城 AI 搜索升级:DeepSeek 加持,客户体验更智能
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏