备注:当killall haproxy启动服务后发现配置文件还没有生效,就需要删除pidfile(目录:/var/run/haproxy.pid) 文件就,然后可以启动服务了。

启动haproxy 命令 /usr/local/haproxy/sbin/haproxy -f /usr/local/haproxy/haproxy.cfg

如果发现如下错误:

ALERT] 195/134522 (16200) : parsing [/usr/local/haproxy/haproxy.cfg:34] : 'listen' cannot handle unexpected argument '0.0.0.0:80'.
[ALERT] 195/134522 (16200) : parsing [/usr/local/haproxy/haproxy.cfg:34] : please use the 'bind' keyword for listening addresses.
[ALERT] 195/134522 (16200) : parsing [/usr/local/haproxy/haproxy.cfg:40] : 'listen' cannot handle unexpected argument '0.0.0.0:3838'.
[ALERT] 195/134522 (16200) : parsing [/usr/local/haproxy/haproxy.cfg:40] : please use the 'bind' keyword for listening addresses.
[ALERT] 195/134522 (16200) : parsing [/usr/local/haproxy/haproxy.cfg:46] : 'listen' cannot handle unexpected argument '0.0.0.0:4140'.
[ALERT] 195/134522 (16200) : parsing [/usr/local/haproxy/haproxy.cfg:46] : please use the 'bind' keyword for listening addresses.
[ALERT] 195/134522 (16200) : Error(s) found in configuration file : /usr/local/haproxy/haproxy.cfg
[WARNING] 195/134522 (16200) : config : proxy 'payserver' has no 'bind' directive. Please declare it as a backend if this was intended.
[WARNING] 195/134522 (16200) : config : missing timeouts for proxy 'payserver'.
   | While not properly invalid, you will certainly encounter various problems
   | with such a configuration. To fix this, please ensure that all following
   | timeouts are set to a non-zero value: 'client', 'connect', 'server'.
[WARNING] 195/134522 (16200) : config : proxy 'payserver2' has no 'bind' directive. Please declare it as a backend if this was intended.
[WARNING] 195/134522 (16200) : config : missing timeouts for proxy 'payserver2'.
   | While not properly invalid, you will certainly encounter various problems
   | with such a configuration. To fix this, please ensure that all following
   | timeouts are set to a non-zero value: 'client', 'connect', 'server'.
[WARNING] 195/134522 (16200) : config : proxy 'payserver3' has no 'bind' directive. Please declare it as a backend if this was intended.
[WARNING] 195/134522 (16200) : config : missing timeouts for proxy 'payserver3'.
   | While not properly invalid, you will certainly encounter various problems
   | with such a configuration. To fix this, please ensure that all following
   | timeouts are set to a non-zero value: 'client', 'connect', 'server'.
[ALERT] 195/134522 (16200) : Fatal errors found in configuration.
解决方案:找到自己的haprox.cfg文件,查看文件(备注:网上有人给的是如下这种写法的,不知道为什么运行不报错,反正我的运行报错)
########test配置#################
isten payserver 0.0.0.0:80
 mode http
 stats enable
 balance roundrobin
 server s1 192.168.1.11:6013
 server s2 192.168.1.11:7013
listen payserver2 0.0.0.0:8011
 mode http
 stats enable
 balance roundrobin
 server s1 192.168.1.11:6014
 server s2 192.168.1.11:7014

将上面 listen 后面的内容改为:

listen payserver

  bind 0.0.0.0:80

就可以解决语法错误,让haproxy正常运行

Mar 5, 2016 keepalived、haproxy、mycat的下载安装配置运行,rsyslog的配置运行与测试,简单的haproxy健康检查,haproxy监控,系统访问测试,切换过程的影响,和部署过程的注意事项 refere
haproxy+keepalived的高可用负载部署 环境介绍: ubuntu;腾讯云;172.27.0.11(master)172.27.0.11(backup)172.27.0.26(腾讯云控制台申请的虚拟ip) 在172.27.0.9上部署haproxy 下载解压以及安装 wget http://download.openpkg.org/components/cache/haprox...
本文介绍如何安装虚拟机VMware以及如果在虚拟机上安装Linux系统以及Linux安装完毕之后的基础配置 需要准备的东西有VMware以及Linux镜像文件 二、下载安装VMware https://my.vmware.com/en/web/vmware/info/slug/desktop_end_user_computing/vmware_workstat... http://blog.csdn.net/onlyanyz/article/details/45009697 https://www.cnblogs.com/fendou-999/p/3822028.html 2、IndentationE...
Bug整理 执行nginx -s reload重启nginx nginx: [error] invalid PID number "" in "/run/nginx.pid" nginx -c /etc/nginx/nginx.conf 官方文档: http://cbonte.github.io/haproxy-dconv/ http://cbonte.github.io/haproxy-dconv/2.1/configuration.html HAProxy配置文件haproxy.cfg由两大部分组成,分别是global和proxies部分,配置文件对缩进没有要求 global:全局配置段 进程及安全配置相关的参数 性能调整相关参数 Debug参数 proxies:代理配置段 defaults:为fronten
2. 问题解决 (1) 一开始我以为是pytorch版本的问题,于是转移到笔记上,发现还是这个问题; (2) 又查看了之前写的其他模型,并没有发现类似这种写法有什么问题,于是复制了其他模型的一个层,在新模型去调用该层。发现没有问题!于是详细对比这者的区别: 发现 init 写错 HAProxy状态页配置项 stats enable #基于默认的参数启用stats page stats hide-version #将状态页haproxy版本隐藏 stats refresh <delay> #设定自动刷新时间间隔,默认不自动刷新,以秒为单位 stats uri <prefix> #自定义stats page