-
-
Save haproxytechblog/3be3351f1cead3fc919c6edbe7f77430 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ haproxy -f /path/to/haproxy.cfg -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults | |
mode http | |
timeout client 10000ms | |
timeout connect 3000ms | |
timeout server 10000ms | |
frontend fe_test | |
bind *:8080 | |
default_backend be_test | |
backend be_test | |
server my_server 127.0.0.1:8000 chekc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ haproxy -f /tmp/test.cfg -c | |
Configuration file is valid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ps | |
PID TTY TIME CMD | |
3219 pts/4 00:00:00 bash | |
20940 pts/4 00:00:00 ps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ haproxy -f /tmp/test.cfg -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[NOTICE] (14686) : haproxy version is 2.4.2-1ppa1~focal | |
[NOTICE] (14686) : path to executable is /usr/sbin/haproxy | |
[ALERT] (14686) : parsing [/tmp/test.cfg:12] : 'server server1' : unknown keyword 'chekc'; did you mean 'check' maybe ?. | |
[ALERT] (14686) : Error(s) found in configuration file : /tmp/test.cfg | |
[ALERT] (14686) : Fatal errors found in configuration. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ haproxy -f /etc/haproxy/haproxy.cfg -c | |
Configuration file is valid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
haproxy -f /path/to/haproxy.cfg -c | |
if [ $? -eq 0 ]; then | |
echo OK | |
else | |
echo FAIL | |
fi | |
FAIL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment