我正在为我们的服务器设置HAProxy,并且在尝试启动它时遇到了问题。当我从/etc/init.d调用haproxy脚本时,它仅告诉我它无法启动:
Starting haproxy: [FAILED]
在运行命令haproxy -db -f /etc/haproxy/haproxy.cfg
时,我得到以下信息:
[WARNING] 023/125320 (15540) : parsing [/etc/haproxy/haproxy.cfg:19] : 'option httplog' not usable with frontend 'https' (needs 'mode http'). Falling back to 'option tcplog'.
[WARNING] 023/125320 (15540) : [haproxy.main()] Failed to drop supplementary groups. Using 'gid'/'group' without 'uid'/'user' is generally useless.
[ALERT] 023/125320 (15540) : [haproxy.main()] Cannot set gid 7058355.
选项httplog,我可以轻松解决,但是我不知道supplementary groups
警告或cannot set gid
警报来自何处。由于传统的环境需求,我正在使用haproxy的1.6.7版,并具有以下配置文件:
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
#debug
#quiet
user <User name here. Already checked that user exists on server>
group <Group name here. Already checked that group exists on server and that user is part of it>
defaults
log global
mode http
retries 3
timeout client 50s
timeout connect 5s
timeout server 50s
option dontlognull
option httplog
option redispatch
balance roundrobin
# Set up application listeners here.
listen admin
bind 127.0.0.1:22002
mode http
stats uri /
frontend http
maxconn 2000
bind 0.0.0.0:4000
default_backend servers-http
frontend https
mode tcp
maxconn 2000
bind 0.0.0.0:4001
default_backend servers-https
backend servers-http
server <Server Name Here> <IP Address Here>:4002 weight 1 maxconn 100 check
backend servers-https
mode tcp
server <Server Name Here> <IP Address Here>:4003 weight 1 maxconn 100 check
option ssl-hello-chk
我真的不确定从这儿去哪里。
我想出了这个特殊问题。我需要将用户和所有者设置为root。
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
#debug
#quiet
user root
group root