This is an automated email from the ASF dual-hosted git repository.

luzhijing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git


The following commit(s) were added to refs/heads/master by this push:
     new dcfd34e496 [Load-balance]Added Haproxy proxy usage guide (#633)
dcfd34e496 is described below

commit dcfd34e49640ded8a5ba0ba9f12c5daa158b9c50
Author: wudongliang <46414265+donglian...@users.noreply.github.com>
AuthorDate: Mon May 13 10:18:27 2024 +0800

    [Load-balance]Added Haproxy proxy usage guide (#633)
---
 .../cluster-management/load-balancing.md           | 131 ++++++++++++++++++++
 .../cluster-management/load-balancing.md           | 132 +++++++++++++++++++++
 .../cluster-management/load-balancing.md           | 132 +++++++++++++++++++++
 .../cluster-management/load-balancing.md           | 132 +++++++++++++++++++++
 .../cluster-management/load-balancing.md           | 116 ++++++++++++++++++
 .../cluster-management/load-balancing.md           | 115 ++++++++++++++++++
 6 files changed, 758 insertions(+)

diff --git a/docs/admin-manual/cluster-management/load-balancing.md 
b/docs/admin-manual/cluster-management/load-balancing.md
index 416899024e..2c65e20f88 100644
--- a/docs/admin-manual/cluster-management/load-balancing.md
+++ b/docs/admin-manual/cluster-management/load-balancing.md
@@ -638,3 +638,134 @@ mysql> desc dwd_product_live;
 40 rows in set (0.06 sec)
 ```
 
+
+## Haproxy way
+HAProxy is a free and open source software written in C language that provides 
high availability, load balancing, and application proxy based on TCP and HTTP.
+
+### Install
+1. Download HAProxy
+
+   download link: https://src.fedoraproject.org/repo/pkgs/haproxy/
+
+2. Unzip
+   ```
+   tar -zxvf haproxy-2.6.15.tar.gz -C /opt/
+   mv haproxy-2.6.15 haproxy
+   ```
+
+3. Compile
+
+   Enter the haproxy directory
+   ```
+   yum install gcc gcc-c++ -y
+
+   make TARGET=linux-glibc PREFIX=/usr/local/haproxy
+
+   make install PREFIX=/usr/local/haproxy
+   ```
+
+### Configuration
+1. Configure the haproxy.conf file
+
+   vim /etc/rsyslog.d/haproxy.conf
+   ```
+   $ModLoad imudp 
+   $UDPServerRun 514
+   local0.* /usr/local/haproxy/logs/haproxy.log
+   &~
+   ```
+
+2. Enable remote logging
+
+   vim /etc/sysconfig/rsyslog
+
+   `SYSLOGD_OPTIONS="-c 2 -r -m 0" `
+
+   Parameter analysis:
+
+   - -c 2 Use compatibility mode, default is -c 5. -r turns on remote logging
+
+   - -m 0 mark timestamp. The unit is minutes. When it is 0, it means the 
function is disabled.
+
+3. Make changes effective
+
+   `systemctl restart rsyslog`
+
+
+4. Edit load balancing file
+
+   vim /usr/local/haproxy/haproxy.cfg
+
+   ```
+   #
+   # haproxy is deployed on 172.16.0.3, this machine, and is used to proxy 
172.16.0.8, 172.16.0.6, 172.16.0.4, the three machines where fe is deployed.
+   #
+   
+   global
+   maxconn         2000
+   ulimit-n        40075
+   log             127.0.0.1 local0 info
+   uid             200
+   gid             200
+   chroot          /var/empty
+   daemon
+   group           haproxy
+   user            haproxy
+   
+   
+   defaults
+   # Global log configuration
+   log global
+   mode http
+   retries 3          # health examination. If the connection fails three 
times, the server is considered unavailable, mainly through the subsequent 
check.
+   option redispatch  # Redirect to other healthy servers after service 
becomes unavailable
+   # Timeout configuration
+   timeout connect 5000
+   timeout client 5000
+   timeout server 5000
+   timeout check 2000
+   
+   frontend agent-front
+   bind *:9030             # Translation port on proxy machine
+   mode tcp
+   default_backend forward-fe
+   
+   backend forward-fe
+   mode tcp
+   balance roundrobin
+   server fe-1 172.16.0.8:9030 weight 1 check inter 3000 rise 2 fall 3
+   server fe-2 172.16.0.4:9030 weight 1 check inter 3000 rise 2 fall 3
+   server fe-3 172.16.0.6:9030 weight 1 check inter 3000 rise 2 fall 3
+   
+   listen http_front              # haproxy client page
+   bind *:8888                    # IP address of HAProxy WEB
+   mode http
+   log 127.0.0.1 local0 err
+   option httplog
+   stats uri /haproxy             # The url of the customized page (that is, 
the address when accessing is: 172.16.0.3:8888/haproxy)
+   stats auth admin:admin         # Control panel account password Account: 
admin
+   stats refresh 10s
+   stats enable
+   ```
+
+### Start up
+
+1. Start service
+
+   ` /opt/haproxy/haproxy -f /usr/local/haproxy/haproxy.cfg`
+
+2. Check service status
+
+   `netstat -lnatp | grep -i haproxy`
+
+3. WEB access
+
+   ip:8888/haproxy
+
+   Login password: admin: admin  
+
+   Note: The WEB login port, account, and password need to be configured in 
the haproxy.cfg file
+
+4. Test whether the port conversion is successful
+
+   `mysql -h 172.16.0.3 -uroot -P3307 -p`
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/cluster-management/load-balancing.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/cluster-management/load-balancing.md
index e1eff8e424..6f0e03d92e 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/cluster-management/load-balancing.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/cluster-management/load-balancing.md
@@ -674,3 +674,135 @@ mysql> show databases;
    如果在 `Host` 列看到的真实的客户端 IP,则说明验证成功。否则,只能看到代理服务的 IP 地址。
 
    同时,在 fe.audit.log 中也会记录真实的客户端 IP。
+
+
+## Haproxy 方式
+HAProxy是一个使用C语言编写的自由及开放源代码软件,其提供高可用性、负载均衡,以及基于TCP和HTTP的应用程序代理。
+
+### 安装
+1. 下载 HAProxy
+
+   下载地址:https://src.fedoraproject.org/repo/pkgs/haproxy/
+
+2. 解压
+   ```
+   tar -zxvf haproxy-2.6.15.tar.gz -C /opt/
+   mv haproxy-2.6.15 haproxy
+   ```
+
+3. 编译
+
+   进入到 haproxy 目录中
+   ```
+   yum install gcc gcc-c++ -y
+
+   make TARGET=linux-glibc PREFIX=/usr/local/haproxy
+
+   make install PREFIX=/usr/local/haproxy
+   ```
+
+### 配置
+1. 配置 haproxy.conf 文件
+
+   vim /etc/rsyslog.d/haproxy.conf
+   ```
+   $ModLoad imudp 
+   $UDPServerRun 514
+   local0.* /usr/local/haproxy/logs/haproxy.log
+   &~
+   ```
+
+2. 开启远程日志
+
+   vim /etc/sysconfig/rsyslog
+
+   `SYSLOGD_OPTIONS="-c 2 -r -m 0" `
+
+   参数解析:
+
+   - -c 2 使用兼容模式,默认是 -c 5。 -r 开启远程日志
+
+   - -m 0 标记时间戳。单位是分钟,为0时,表示禁用该功能
+
+3. 使修改生效
+
+   `systemctl restart rsyslog`
+
+
+4. 编辑负载均衡文件
+
+   vim /usr/local/haproxy/haproxy.cfg
+
+   ```
+   #
+   # haproxy 部署在 172.16.0.3,这台机器上,用来代理 172.16.0.8,172.16.0.6,172.16.0.4 这三台部署 
fe 的机器
+   #
+   
+   global
+   maxconn         2000
+   ulimit-n        40075
+   log             127.0.0.1 local0 info
+   uid             200
+   gid             200
+   chroot          /var/empty
+   daemon
+   group           haproxy
+   user            haproxy
+   
+   
+   defaults
+   # 应用全局的日志配置
+   log global
+   mode http
+   retries 3          # 健康检查。3次连接失败就认为服务器不可用,主要通过后面的check检查
+   option redispatch  # 服务不可用后重定向到其他健康服务器
+   # 超时配置
+   timeout connect 5000
+   timeout client 5000
+   timeout server 5000
+   timeout check 2000
+   
+   frontend agent-front
+   bind *:9030             # 代理机器上的转换端口
+   mode tcp
+   default_backend forward-fe
+   
+   backend forward-fe
+   mode tcp
+   balance roundrobin
+   server fe-1 172.16.0.8:9030 weight 1 check inter 3000 rise 2 fall 3
+   server fe-2 172.16.0.4:9030 weight 1 check inter 3000 rise 2 fall 3
+   server fe-3 172.16.0.6:9030 weight 1 check inter 3000 rise 2 fall 3
+   
+   listen http_front              # haproxy的客户页面
+   bind *:8888                    # HAProxy WEB 的IP地址
+   mode http
+   log 127.0.0.1 local0 err
+   option httplog
+   stats uri /haproxy             # 自定义页面的 url(即访问时地址为:172.16.0.3:8888/haproxy)
+   stats auth admin:admin         # 控制面板账号密码 账号:admin
+   stats refresh 10s
+   stats enable
+   ```
+
+### 启动
+
+1. 启动服务
+
+   ` /opt/haproxy/haproxy -f /usr/local/haproxy/haproxy.cfg`
+
+2. 查看服务状态
+
+   `netstat -lnatp | grep -i haproxy`
+
+3. WEB 访问
+
+   ip:8888/haproxy
+
+   登陆密码:admin : admin
+
+   注意:WEB 登陆的端口、账户、密码需要在 haproxy.cfg 文件中配置
+
+4. 测试端口是否转换成功
+
+   `mysql -h 172.16.0.3 -uroot -P3307 -p`
\ No newline at end of file
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/admin-manual/cluster-management/load-balancing.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/admin-manual/cluster-management/load-balancing.md
index 3ed1ccfdc4..aa07c63d5c 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/admin-manual/cluster-management/load-balancing.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/admin-manual/cluster-management/load-balancing.md
@@ -665,3 +665,135 @@ mysql> desc dwd_product_live;
 +-----------------+---------------+------+-------+---------+---------+
 40 rows in set (0.06 sec)
 ```
+
+
+## Haproxy 方式
+HAProxy是一个使用C语言编写的自由及开放源代码软件,其提供高可用性、负载均衡,以及基于TCP和HTTP的应用程序代理。
+
+### 安装
+1. 下载 HAProxy
+
+   下载地址:https://src.fedoraproject.org/repo/pkgs/haproxy/
+
+2. 解压
+   ```
+   tar -zxvf haproxy-2.6.15.tar.gz -C /opt/
+   mv haproxy-2.6.15 haproxy
+   ```
+
+3. 编译
+
+   进入到 haproxy 目录中
+   ```
+   yum install gcc gcc-c++ -y
+
+   make TARGET=linux-glibc PREFIX=/usr/local/haproxy
+
+   make install PREFIX=/usr/local/haproxy
+   ```
+
+### 配置
+1. 配置 haproxy.conf 文件
+
+   vim /etc/rsyslog.d/haproxy.conf
+   ```
+   $ModLoad imudp 
+   $UDPServerRun 514
+   local0.* /usr/local/haproxy/logs/haproxy.log
+   &~
+   ```
+
+2. 开启远程日志
+
+   vim /etc/sysconfig/rsyslog
+
+   `SYSLOGD_OPTIONS="-c 2 -r -m 0" `
+
+   参数解析:
+
+    - -c 2 使用兼容模式,默认是 -c 5。 -r 开启远程日志
+
+    - -m 0 标记时间戳。单位是分钟,为0时,表示禁用该功能
+
+3. 使修改生效
+
+   `systemctl restart rsyslog`
+
+
+4. 编辑负载均衡文件
+
+   vim /usr/local/haproxy/haproxy.cfg
+
+   ```
+   #
+   # haproxy 部署在 172.16.0.3,这台机器上,用来代理 172.16.0.8,172.16.0.6,172.16.0.4 这三台部署 
fe 的机器
+   #
+   
+   global
+   maxconn         2000
+   ulimit-n        40075
+   log             127.0.0.1 local0 info
+   uid             200
+   gid             200
+   chroot          /var/empty
+   daemon
+   group           haproxy
+   user            haproxy
+   
+   
+   defaults
+   # 应用全局的日志配置
+   log global
+   mode http
+   retries 3          # 健康检查。3次连接失败就认为服务器不可用,主要通过后面的check检查
+   option redispatch  # 服务不可用后重定向到其他健康服务器
+   # 超时配置
+   timeout connect 5000
+   timeout client 5000
+   timeout server 5000
+   timeout check 2000
+   
+   frontend agent-front
+   bind *:9030             # 代理机器上的转换端口
+   mode tcp
+   default_backend forward-fe
+   
+   backend forward-fe
+   mode tcp
+   balance roundrobin
+   server fe-1 172.16.0.8:9030 weight 1 check inter 3000 rise 2 fall 3
+   server fe-2 172.16.0.4:9030 weight 1 check inter 3000 rise 2 fall 3
+   server fe-3 172.16.0.6:9030 weight 1 check inter 3000 rise 2 fall 3
+   
+   listen http_front              # haproxy的客户页面
+   bind *:8888                    # HAProxy WEB 的IP地址
+   mode http
+   log 127.0.0.1 local0 err
+   option httplog
+   stats uri /haproxy             # 自定义页面的 url(即访问时地址为:172.16.0.3:8888/haproxy)
+   stats auth admin:admin         # 控制面板账号密码 账号:admin
+   stats refresh 10s
+   stats enable
+   ```
+
+### 启动
+
+1. 启动服务
+
+   ` /opt/haproxy/haproxy -f /usr/local/haproxy/haproxy.cfg`
+
+2. 查看服务状态
+
+   `netstat -lnatp | grep -i haproxy`
+
+3. WEB 访问
+
+   ip:8888/haproxy
+
+   登陆密码:admin : admin
+
+   注意:WEB 登陆的端口、账户、密码需要在 haproxy.cfg 文件中配置
+
+4. 测试端口是否转换成功
+
+   `mysql -h 172.16.0.3 -uroot -P3307 -p`
\ No newline at end of file
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/admin-manual/cluster-management/load-balancing.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/admin-manual/cluster-management/load-balancing.md
index e1eff8e424..3489fbe7fa 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/admin-manual/cluster-management/load-balancing.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/admin-manual/cluster-management/load-balancing.md
@@ -674,3 +674,135 @@ mysql> show databases;
    如果在 `Host` 列看到的真实的客户端 IP,则说明验证成功。否则,只能看到代理服务的 IP 地址。
 
    同时,在 fe.audit.log 中也会记录真实的客户端 IP。
+
+
+## Haproxy 方式
+HAProxy是一个使用C语言编写的自由及开放源代码软件,其提供高可用性、负载均衡,以及基于TCP和HTTP的应用程序代理。
+
+### 安装
+1. 下载 HAProxy
+
+   下载地址:https://src.fedoraproject.org/repo/pkgs/haproxy/
+
+2. 解压
+   ```
+   tar -zxvf haproxy-2.6.15.tar.gz -C /opt/
+   mv haproxy-2.6.15 haproxy
+   ```
+
+3. 编译
+
+   进入到 haproxy 目录中
+   ```
+   yum install gcc gcc-c++ -y
+
+   make TARGET=linux-glibc PREFIX=/usr/local/haproxy
+
+   make install PREFIX=/usr/local/haproxy
+   ```
+
+### 配置
+1. 配置 haproxy.conf 文件
+   
+   vim /etc/rsyslog.d/haproxy.conf
+   ```
+   $ModLoad imudp 
+   $UDPServerRun 514
+   local0.* /usr/local/haproxy/logs/haproxy.log
+   &~
+   ```
+   
+2. 开启远程日志
+
+   vim /etc/sysconfig/rsyslog
+
+   `SYSLOGD_OPTIONS="-c 2 -r -m 0" `
+
+   参数解析:
+
+   - -c 2 使用兼容模式,默认是 -c 5。 -r 开启远程日志
+
+   - -m 0 标记时间戳。单位是分钟,为0时,表示禁用该功能
+
+3. 使修改生效
+
+   `systemctl restart rsyslog`
+
+   
+4. 编辑负载均衡文件
+
+   vim /usr/local/haproxy/haproxy.cfg
+   
+   ```
+   #
+   # haproxy 部署在 172.16.0.3,这台机器上,用来代理 172.16.0.8,172.16.0.6,172.16.0.4 这三台部署 
fe 的机器
+   #
+   
+   global
+   maxconn         2000
+   ulimit-n        40075
+   log             127.0.0.1 local0 info
+   uid             200
+   gid             200
+   chroot          /var/empty
+   daemon
+   group           haproxy
+   user            haproxy
+   
+   
+   defaults
+   # 应用全局的日志配置
+   log global
+   mode http
+   retries 3          # 健康检查。3次连接失败就认为服务器不可用,主要通过后面的check检查
+   option redispatch  # 服务不可用后重定向到其他健康服务器
+   # 超时配置
+   timeout connect 5000
+   timeout client 5000
+   timeout server 5000
+   timeout check 2000
+   
+   frontend agent-front
+   bind *:9030             # 代理机器上的转换端口
+   mode tcp
+   default_backend forward-fe
+   
+   backend forward-fe
+   mode tcp
+   balance roundrobin
+   server fe-1 172.16.0.8:9030 weight 1 check inter 3000 rise 2 fall 3
+   server fe-2 172.16.0.4:9030 weight 1 check inter 3000 rise 2 fall 3
+   server fe-3 172.16.0.6:9030 weight 1 check inter 3000 rise 2 fall 3
+   
+   listen http_front              # haproxy的客户页面
+   bind *:8888                    # HAProxy WEB 的IP地址
+   mode http
+   log 127.0.0.1 local0 err
+   option httplog
+   stats uri /haproxy             # 自定义页面的 url(即访问时地址为:172.16.0.3:8888/haproxy)
+   stats auth admin:admin         # 控制面板账号密码 账号:admin
+   stats refresh 10s
+   stats enable
+   ```
+
+### 启动
+
+1. 启动服务
+
+   ` /opt/haproxy/haproxy -f /usr/local/haproxy/haproxy.cfg`
+
+2. 查看服务状态
+
+   `netstat -lnatp | grep -i haproxy`
+
+3. WEB 访问
+
+   ip:8888/haproxy
+
+   登陆密码:admin : admin 
+
+   注意:WEB 登陆的端口、账户、密码需要在 haproxy.cfg 文件中配置
+
+4. 测试端口是否转换成功
+
+   `mysql -h 172.16.0.3 -uroot -P3307 -p`
\ No newline at end of file
diff --git 
a/versioned_docs/version-2.0/admin-manual/cluster-management/load-balancing.md 
b/versioned_docs/version-2.0/admin-manual/cluster-management/load-balancing.md
index 161253307b..fc6a9eeb63 100644
--- 
a/versioned_docs/version-2.0/admin-manual/cluster-management/load-balancing.md
+++ 
b/versioned_docs/version-2.0/admin-manual/cluster-management/load-balancing.md
@@ -638,3 +638,119 @@ mysql> desc dwd_product_live;
 40 rows in set (0.06 sec)
 ```
 
+
+## Haproxy way
+HAProxy is a free and open source software written in C language that provides 
high availability, load balancing, and application proxy based on TCP and HTTP.
+
+### Install
+1. Download HAProxy
+
+   download link: https://src.fedoraproject.org/repo/pkgs/haproxy/
+
+2. Unzip
+   ```
+   tar -zxvf haproxy-2.6.15.tar.gz -C /opt/
+   mv haproxy-2.6.15 haproxy
+   ```
+
+3. Compile
+
+   Enter the haproxy directory
+   ```
+   yum install gcc gcc-c++ -y
+
+   make TARGET=linux-glibc PREFIX=/usr/local/haproxy
+
+   make install PREFIX=/usr/local/haproxy
+   ```
+
+### Configuration
+1. Configure the haproxy.conf file
+
+   vim /etc/rsyslog.d/haproxy.conf
+   ```
+   $ModLoad imudp 
+   $UDPServerRun 514
+   local0.* /usr/local/haproxy/logs/haproxy.log
+   &~
+   ```
+
+2. Enable remote logging
+
+   vim /etc/sysconfig/rsyslog
+
+   `SYSLOGD_OPTIONS="-c 2 -r -m 0" `
+
+   Parameter analysis:
+
+    - -c 2 Use compatibility mode, default is -c 5. -r turns on remote logging
+
+    - -m 0 mark timestamp. The unit is minutes. When it is 0, it means the 
function is disabled.
+
+3. Make changes effective
+
+   `systemctl restart rsyslog`
+
+
+4. Edit load balancing file
+
+   vim /usr/local/haproxy/haproxy.cfg
+
+   ```
+   #
+   # haproxy is deployed on 172.16.0.3, this machine, and is used to proxy 
172.16.0.8, 172.16.0.6, 172.16.0.4, the three machines where fe is deployed.
+   #
+   
+   global
+   maxconn         2000
+   ulimit-n        40075
+   log             127.0.0.1 local0 info
+   uid             200
+   gid             200
+   chroot          /var/empty
+   daemon
+   group           haproxy
+   user            haproxy
+   
+   
+   defaults
+   # Global log configuration
+   log global
+   mode http
+   retries 3          # health examination. If the connection fails three 
times, the server is considered unavailable, mainly through the subsequent 
check.
+   option redispatch  # Redirect to other healthy servers after service 
becomes unavailable
+   # Timeout configuration
+   timeout connect 5000
+   timeout client 5000
+   timeout server 5000
+   timeout check 2000
+   
+   frontend agent-front
+   bind *:9030             # Translation port on proxy machine
+   mode tcp
+   default_backend forward-fe
+   
+   backend forward-fe
+   mode tcp
+   balance roundrobin
+   server fe-1 172.16.0.8:9030 weight 1 check inter 3000 rise 2 fall 3
+   server fe-2 172.16.0.4:9030 weight 1 check inter 3000 rise 2 fall 3
+   server fe-3 172.16.0.6:9030 weight 1 check inter 3000 rise 2 fall 3
+   
+   listen http_front              # haproxy client page
+   bind *:8888                    # IP address of HAProxy WEB
+   mode http
+   log 127.0.0.1 local0 err
+   option httplog
+   stats uri /haproxy             # The url of the customized page (that is, 
the address when accessing is: 172.16.0.3:8888/haproxy)
+   stats auth admin:admin         # Control panel account password Account: 
admin
+   stats refresh 10s
+   stats enable
+   ```
+
+### Start up
+
+1. Start service
+
+   ` /opt/haproxy/haproxy -f /usr/local/haproxy/haproxy.cfg`
+
diff --git 
a/versioned_docs/version-2.1/admin-manual/cluster-management/load-balancing.md 
b/versioned_docs/version-2.1/admin-manual/cluster-management/load-balancing.md
index 416899024e..610b37def8 100644
--- 
a/versioned_docs/version-2.1/admin-manual/cluster-management/load-balancing.md
+++ 
b/versioned_docs/version-2.1/admin-manual/cluster-management/load-balancing.md
@@ -638,3 +638,118 @@ mysql> desc dwd_product_live;
 40 rows in set (0.06 sec)
 ```
 
+
+## Haproxy way
+HAProxy is a free and open source software written in C language that provides 
high availability, load balancing, and application proxy based on TCP and HTTP.
+
+### Install
+1. Download HAProxy
+
+   download link: https://src.fedoraproject.org/repo/pkgs/haproxy/
+
+2. Unzip
+   ```
+   tar -zxvf haproxy-2.6.15.tar.gz -C /opt/
+   mv haproxy-2.6.15 haproxy
+   ```
+
+3. Compile
+
+   Enter the haproxy directory
+   ```
+   yum install gcc gcc-c++ -y
+
+   make TARGET=linux-glibc PREFIX=/usr/local/haproxy
+
+   make install PREFIX=/usr/local/haproxy
+   ```
+
+### Configuration
+1. Configure the haproxy.conf file
+
+   vim /etc/rsyslog.d/haproxy.conf
+   ```
+   $ModLoad imudp 
+   $UDPServerRun 514
+   local0.* /usr/local/haproxy/logs/haproxy.log
+   &~
+   ```
+
+2. Enable remote logging
+
+   vim /etc/sysconfig/rsyslog
+
+   `SYSLOGD_OPTIONS="-c 2 -r -m 0" `
+
+   Parameter analysis:
+
+    - -c 2 Use compatibility mode, default is -c 5. -r turns on remote logging
+
+    - -m 0 mark timestamp. The unit is minutes. When it is 0, it means the 
function is disabled.
+
+3. Make changes effective
+
+   `systemctl restart rsyslog`
+
+
+4. Edit load balancing file
+
+   vim /usr/local/haproxy/haproxy.cfg
+
+   ```
+   #
+   # haproxy is deployed on 172.16.0.3, this machine, and is used to proxy 
172.16.0.8, 172.16.0.6, 172.16.0.4, the three machines where fe is deployed.
+   #
+   
+   global
+   maxconn         2000
+   ulimit-n        40075
+   log             127.0.0.1 local0 info
+   uid             200
+   gid             200
+   chroot          /var/empty
+   daemon
+   group           haproxy
+   user            haproxy
+   
+   
+   defaults
+   # Global log configuration
+   log global
+   mode http
+   retries 3          # health examination. If the connection fails three 
times, the server is considered unavailable, mainly through the subsequent 
check.
+   option redispatch  # Redirect to other healthy servers after service 
becomes unavailable
+   # Timeout configuration
+   timeout connect 5000
+   timeout client 5000
+   timeout server 5000
+   timeout check 2000
+   
+   frontend agent-front
+   bind *:9030             # Translation port on proxy machine
+   mode tcp
+   default_backend forward-fe
+   
+   backend forward-fe
+   mode tcp
+   balance roundrobin
+   server fe-1 172.16.0.8:9030 weight 1 check inter 3000 rise 2 fall 3
+   server fe-2 172.16.0.4:9030 weight 1 check inter 3000 rise 2 fall 3
+   server fe-3 172.16.0.6:9030 weight 1 check inter 3000 rise 2 fall 3
+   
+   listen http_front              # haproxy client page
+   bind *:8888                    # IP address of HAProxy WEB
+   mode http
+   log 127.0.0.1 local0 err
+   option httplog
+   stats uri /haproxy             # The url of the customized page (that is, 
the address when accessing is: 172.16.0.3:8888/haproxy)
+   stats auth admin:admin         # Control panel account password Account: 
admin
+   stats refresh 10s
+   stats enable
+   ```
+
+### Start up
+
+1. Start service
+
+   ` /opt/haproxy/haproxy -f /usr/local/haproxy/haproxy.cfg`


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to