haproxy的配置安裝
1、下載haproxy:
http://www.haproxy.org/
2、指定目錄安裝
mkdir -p /usr/local/haproxy
tar -xvf haproxy-1.4.tar.gz
make TARGET=linux26 PREFIX=/usr/local/haproxy #系統核心版本2.6
make install PREFIX=/usr/local/haproxy
3、調整配置檔案:
(192.168.1.32:20001-192.168.1.35:20001是node節點)
cat /etc/haproxy.cfg
global
# log 127.0.0.1 local3 debug
maxconn 20480
chroot /usr/local/haproxy
uid 0
gid 0
daemon
quiet
nbproc 4 #提升效能關鍵引數
pidfile /var/run/haproxy.pid
spread-checks 2
ulimit-n 82000
defaults
log global
timeout server 3s
timeout connect 3s
timeout client 30s
timeout http-request 3s
timeout queue 3s
mode tcp
balance static-rr
# balance roundrobin
# balance source
maxconn 10000
listen redis_cluster *:60001
mode tcp
balance static-rr
maxconn 10000
option httplog
option dontlognull
option logasap
option forwardfor
option httpclose
# option redis-check
server tm1 192.168.1.32:20001 weight 1 maxconn 10000 check inter 1s rise 2 fall 1
server tm2 192.168.1.33:20001 weight 1 maxconn 10000 check inter 1s rise 2 fall 1
server tm3 192.168.1.34:20001 weight 1 maxconn 10000 check inter 1s rise 2 fall 1
server tm4 192.168.1.35:20001 weight 1 maxconn 10000 check inter 1s rise 2 fall 1
listen admin_status
mode http
bind *:8083
option httplog
log global
stats enable
stats refresh 10s
# stats hide-version
stats realm Haproxy Statistics
stats uri /status
stats auth zhaogp:1234
stats admin if TRUE
4、啟動:
haproxy -D -f /etc/haproxy.cfg -p /var/run/haproxy.pid
5、監控:
檢視狀態:http://localhost:8083/status
使用者密碼:zhaogp/1234
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20625855/viewspace-1693421/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- saltstack之haproxy的安裝配置
- haproxy的安裝
- HAProxy負載均衡器的安裝及配置負載
- 在docker中haproxy的安裝以及mysql的負載均衡配置DockerMySql負載
- Linux Haproxy 安裝和部署Linux
- Centos7 haproxy1.7 安裝CentOS
- Haproxy--配置解析
- haproxy配置檔案詳解
- zabbix的安裝配置
- rsync的安裝配置
- sonar的配置安裝
- HIVE的安裝配置Hive
- ASM的安裝配置ASM
- statspack的安裝配置
- 本地windows搭建spark環境,安裝與詳細配置(jdk安裝與配置,scala安裝與配置,hadoop安裝與配置,spark安裝與配置)WindowsSparkJDKHadoop
- centos7 (阿里雲、linux) 單機spark的安裝與配置詳解(jdk安裝與配置,scala安裝與配置,hadoop安裝與配置,spark安裝與配置)CentOS阿里LinuxSparkJDKHadoop
- HAProxy、Nginx 配置 HTTP/2 完整指南NginxHTTP
- Flutter的安裝和配置Flutter
- VNC的安裝配置使用VNC
- JDK的安裝和配置JDK
- Hive的安裝與配置Hive
- mongodb的安裝配置,使用MongoDB
- PG的安裝與配置
- yum的安裝與配置
- rsync的安裝 和 配置
- Redis的安裝與配置Redis
- Nginx的安裝配置使用Nginx
- zabbix安裝—–nginx安裝和配置Nginx
- Zookeeper 安裝配置
- 【mongodb安裝配置】MongoDB
- ceph安裝配置
- ELK 安裝配置
- Prometheus安裝配置Prometheus
- MySQL安裝配置MySql
- SwitchOmega 安裝配置
- Hive安裝配置Hive
- JWT安裝配置JWT
- oracle安裝配置Oracle