haproxy -f /usr/local/etc/haproxy/haproxy.cfg 执行失败

来源:4-3 数据库负载均衡

创业通讯社

2022-01-22

不知道什么缘故,如下提示:

haproxy@31a679ee8b9c:/$ haproxy -f /usr/local/etc/haproxy/haproxy.cfg
[NOTICE] (20) : haproxy version is 2.5.1-86b093a
[NOTICE] (20) : path to executable is /usr/local/sbin/haproxy
[ALERT] (20) : config : parsing [/usr/local/etc/haproxy/haproxy.cfg:57]: Missing LF on last line, file might have been truncated at position 20.
[ALERT] (20) : config : Error(s) found in configuration file : /usr/local/etc/haproxy/haproxy.cfg
[ALERT] (20) : config : Fatal errors found in configuration.

写回答

1回答

创业通讯社

提问者

2022-01-22

在haproxy.cfg文件中最后一行直接换行保存后,再执行没有这个问题,新的问题又出来了:

haproxy@0c695af9da08:/$ [NOTICE]   (20) : haproxy version is 2.5.1-86b093a

[NOTICE]   (20) : path to executable is /usr/local/sbin/haproxy

[ALERT]    (20) : [haproxy.main()] Cannot chroot(/usr/local/etc/haproxy).

2
4
cloverxixi
你好,我遇到了同样的问题,请教下需要怎么调整呢
2022-10-27
共4条回复

Docker环境下的企业级前后端分离项目部署与运维

手把手带你学会项目分布式集群部署,让你的系统不再惧怕宕机

2459 学习 · 1018 问题

查看课程