haproxy随机udp监听端口的目的是什么?

问题描述 投票:-1回答:1

当我启动haproxy服务器时,它总是启动一个随机的UDP端口。这个UDP端口用于什么?我可以将它设置为静态端口吗?

以下是haproxy.cfg文件内容:

global

log         127.0.0.1 local2

chroot      /var/lib/haproxy
pidfile     /var/run/haproxy.pid
maxconn     4000
user        haproxy
group       haproxy
daemon

stats socket /var/lib/haproxy/stats

defaults
mode                    http
log                     global
option                  httplog
option                  dontlognull
option http-server-close
option forwardfor       except 127.0.0.0/8
option                  redispatch
retries                 3
timeout http-request    10s
timeout queue           1m
timeout connect         10s
timeout client          1m
timeout server          1m
timeout http-keep-alive 10s
timeout check           10s
maxconn                 3000

frontend  main *:5000
acl url_static       path_beg       -i /static /images /javascript 
/stylesheets
acl url_static       path_end       -i .jpg .gif .png .css .js

use_backend static          if url_static
default_backend             app


backend static
balance     roundrobin
server      static 127.0.0.1:4331 check

backend app
balance     roundrobin
server  app1 127.0.0.1:5001 check
server  app2 127.0.0.1:5002 check
server  app3 127.0.0.1:5003 check
server  app4 127.0.0.1:5004 check

以下是netstat结果;

# netstat -anp| grep udp | grep haproxy
udp        0      0 0.0.0.0:43367           0.0.0.0:*                           3067/haproxy

非常感谢!

haproxy
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.