2
回答
用Haproxy来做PostgreSQL的负载均衡
滴滴云服务器,限时包月0.9元,为开发者而生>>>   

@kenyon_君羊 你好,想跟你请教个问题:我看了您写的“用Haproxy来做PostgreSQL的负载均衡”这篇文章,系统rhel-server-7.1-x86_64-dvd,postgresql9.4.5 haproxy1.6.3

问题1:怎么看出来必须要创建haproxy的数据库?

问题2:haproxy -f /etc/haproxy/haproxy.cfg

报错[WARNING] 298/044123 (27692) : config : proxy 'postgresql' has no 'bind' directive. Please declare it as a backend if this was intended.

systemctl status haproxy.service

报错haproxy.service - SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments.
   Loaded: loaded (/etc/rc.d/init.d/haproxy)
   Active: failed (Result: exit-code) since Tue 2016-10-25 04:43:46 EDT; 11s ago
  Process: 27717 ExecStart=/etc/rc.d/init.d/haproxy start (code=exited, status=203/EXEC)


Oct 25 04:43:46 haproxy.localdomain systemd[1]: Starting SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited ...ts....
Oct 25 04:43:46 haproxy.localdomain systemd[1]: haproxy.service: control process exited, code=exited status=203
Oct 25 04:43:46 haproxy.localdomain systemd[1]: Failed to start SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly ...ents..
Oct 25 04:43:46 haproxy.localdomain systemd[1]: Unit haproxy.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.

另外两个数据库服务器都是LOG:  could not receive data from client: Connection reset by peer

举报
顶部