关于haproxy:HAProxy-190-移植指南openEuler-2003-LTS-SP1

HAProxy 1.9.0 移植指南(openEuler 20.03 LTS SP1)介绍简要介绍HAProxy是一个应用C语言编写的自在及凋谢源代码软件,其提供高可用性、负载平衡,以及基于TCP和HTTP的应用程序代理,反对虚拟主机,它是收费、疾速并且牢靠的一种解决方案。开发语言:C 一句话形容:Web负载平衡 倡议的版本倡议应用版本为“HAProxy 1.9.0”。 阐明: 本文档实用于HAProxy 1.9.0,其余版本的HAProxy移植步骤也可参考本文档。 环境要求硬件要求我的项目阐明服务器TaiShan 200服务器(型号2280)CPU鲲鹏920 5250处理器磁盘分区对磁盘分区无要求操作系统要求我的项目版本openEuler20.03 LTS SP1 aarch64Kernel4.19查看以后零碎版本信息 cat /etc/os-release 装置openEuler操作系统,请参考https://openeuler.org/zh/docs... 阐明:装置形式倡议抉择“Server with GUI”装置形式。 镜像站RPM形式装置若您的服务器能够拜访网络,执行 wget https://mirrors.huaweicloud.c... 命令下载RPM包。否则,请拜访 https://mirrors.huaweicloud.c... 下载RPM包并复制到服务器“/home”目录。 阐明:镜像站中的RPM包都是通过开源代码编译打包而成,而后将其上传到镜像站。 以本地下载RPM包并上传到服务器为例阐明安装操作 装置HAProxy rpm -ivh haproxy-1.9.0-1.el7.aarch64.rpm 查看装置目录 ls /usr/local/haproxy 运行和验证配置参数 a. 关上option-http_proxy.cfg文件 vi /usr/local/haproxy/conf/option-http_proxy.cfgb. 批改option-http_proxy.cfg为如下内容后,保留并退出文件 globalmaxconn 20000log 127.0.0.1 local0 infouid 0gid 0chroot /usr/local/haproxynbproc 4daemondefaultsmode httpretries 3timeout connect 10stimeout client 20stimeout server 30stimeout check 2sfrontend test-proxybind *:80mode httplog globaldefault_backend test-proxy-srvbackend test-proxy-srvbalance roundrobinoption http-server-closeoption httpchk GET /index.htmlhttp-check expect status 200server web1 IP1:PORT1 weight 3server web2 IP2:PORT2 weight 3配置文件示例参数阐明见下表。 ...

November 7, 2022 · 1 min · jiezi

关于haproxy:haproxy

yum install haproxy -yvi /etc/haproxy/haproxy.cfg<code>globallog 127.0.0.1 local3log-send-hostname public-haproxy-primarychroot /var/lib/haproxypidfile /var/run/haproxy.pidmaxconn 512000user haproxygroup haproxydaemon#first configure# turn on stats unix socketstats socket /var/lib/haproxy/stats level admin#second configure# turn on stats unix socketnbproc 8cpu-map 1 0cpu-map 2 1cpu-map 3 2cpu-map 4 3cpu-map 5 4cpu-map 6 5cpu-map 7 6cpu-map 8 7# turn on stats unix socketstats socket /var/lib/haproxy/stats.1 level admin process 1stats socket /var/lib/haproxy/stats.2 level admin process 2stats socket /var/lib/haproxy/stats.3 level admin process 3stats socket /var/lib/haproxy/stats.4 level admin process 4stats socket /var/lib/haproxy/stats.5 level admin process 5stats socket /var/lib/haproxy/stats.6 level admin process 6stats socket /var/lib/haproxy/stats.7 level admin process 7stats socket /var/lib/haproxy/stats.8 level admin process 8defaultsmode httplog globaloption httplogoption forwardforoption dontlognulloption redispatchretries 3timeout http-request 10stimeout queue 1mtimeout connect 10stimeout client 100mtimeout server 100mtimeout http-keep-alive 30stimeout check 10smaxconn 512000#-------------------------------------------------------------------------#frontend#-------------------------------------------------------------------------frontend mainbind *:80bind *:443 ssl crt /etc/pki/tls/private/xxx.pem crt /etc/pki/tls/private/xxx.pemdefault_backend app#-------------------------------------------------------------------------#backend#-------------------------------------------------------------------------backend appbalance roundrobinoption httpchk OPTIONS * HTTP/1.1\r\nHost:\ wwwserver app-node1 ip:80 checkserver app-node2 ip:80 checkserver app-node3 ip:80 check</code>/etc/init.d/haproxy start其它配置listen game-proxy-serverbind :30001-39999,:50001-58999,:843mode tcpserver game-servers x.x.x.x故障判断和操作:1、首先查看端口是否能telnet通,查看虚构ip绑定在那台机器上,ip a2、查看keepalived,haproxy日志3、重启keepalived,haproxy

March 1, 2021 · 1 min · jiezi