用Haproxy来做PostgreSQL的负载均衡

沉默的世界 发布于 2016/10/25 17:41
阅读 960
收藏 0

@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

加载中
0
kenyon_君羊
kenyon_君羊

1.没有必须要创建proxy的库,只是建了个proxy的用户

2.看着像是网络问题

kenyon_君羊
kenyon_君羊
回复 @沉默的世界 : mysql我有遇到过,重启下slave搞定
沉默的世界
之前的问题我已解决,谢谢
沉默的世界
回复@kenyon_君羊 : 您这边有没有遇到过数据库几天不工作,然后在主机上添加数据,备机上数据没有流复制过去的现象
0
狂奔的蜗牛_

could not receive data from client: Connection reset by peer这个是什么原因?

返回顶部
顶部