基本上就是标题。我正在努力将我们现有的haproxy从1.5升级到最新版本。正因为如此,我正在设置一个测试用例,以确保我们的旧设置能够在其上工作。但是,当我尝试运行它时,我会得到以下错误:
[NOTICE] (28948) : haproxy version is 2.4.1-1ce7d49
[NOTICE] (28948) : path to executable is /home/user/test/usr/local/sbin/haproxy
[ALERT] (28948) : parsing [test.cfg:22]: Missing LF on last line, file might have been truncated at position 68.
[ALERT] (28948) : Error(s) found in configuration file : test.cfg
[ALERT] (28948) : Fatal errors found in configuration.
我试着查过了,但在错误上找不到任何东西。我已经检查了我的配置文件,它使用的是正确的Unix格式。此外,我的测试配置也适用于较早版本的HAProxy。
global
stats timeout 30s
user root
group root
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
frontend http_front
bind *:9090
default_backend http_back
backend http_back
balance roundrobin
server test.server.com 127.0.0.1:8000
此外,我做了以下工作来安装haproxy:
tar xvf haproxy-2.4.1.tar.gz
cd haproxy-2.4.1
#vi to Makefile and set PREFIX to PREFIX = /home/user/test/usr/local
make TARGET=linux-glibc
make install
关于我的配置文件有什么特别之处吗?还是我在安装过程中错过了什么?
发布于 2021-11-14 05:38:58
我也有同样的问题,我试着用编辑器。但是,这不管用。我可以通过增加一个新的行来解决这个问题。我使用了回声命令,它起作用了。
echo "" >> /etc/hapee-2.2/hapee-lb.cfg
https://stackoverflow.com/questions/68350378
复制相似问题