[ZBX-3627] Zabbix server doesn't automatically reconnect to it's database server when the database server is on a separate host Created: 2011 Mar 18  Updated: 2017 May 30  Resolved: 2014 Sep 24

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 1.9.2 (alpha)
Fix Version/s: None

Type: Incident report Priority: Major
Reporter: Sergey Syreskin Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 1
Labels: postgresql
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Centos 5.5, PostgreSQL 8.4, Zabbix 1.9.3


Attachments: File zabbix.log.gz     File zabbix_server.log.gz    

 Description   

To reproduce the problem:
1) set up Zabbix server and database server on different hosts;
2) run the database server and Zabbix server, check that they work;
3) unplug the database server from network;
4) wait for e.g. 30 seconds;
5) plug the database server to the network;
6) see Zabbix server logs - it didn't try to reconnect to the database server.

It seems that when Zabbix server and database server reside on the same host,
the connection is reestablished automatically, but I am not sure.

This issue in particular makes trouble when database server is a high availability cluster.



 Comments   
Comment by Sergey Syreskin [ 2011 Mar 24 ]

I have re-checked Zabbix server behavior when Zabbix server and database server are on the same host - it doesn't differ from that, what is in case when they are on different hosts. That is Zabbix server never tries to reconnect to its back-end database server in case of a temporary connection loss.

Comment by Sergey Syreskin [ 2011 Mar 24 ]

Now this issue looks to me more like a feature request, not a bug.

Comment by Daniel Santos [ 2011 Jun 07 ]

This "feature" will be really appreciated. I'm unable to use my HA PostgreSQL cluster cause of this issue.

Comment by Stefan [ 2011 Oct 12 ]

when it will be fix?! its not a feature request its a very high BUG!!! .. EVERY Programm that use a DB-Backend can automatically reconnect!!

Comment by richlv [ 2011 Oct 13 ]

this seems to work just fine in latest versions. do you still see this problem ? if yes, what exactly appears in the zabbix server log when the database is available again ?

Comment by Sergey Syreskin [ 2011 Oct 13 ]

I stop Postgres while Zabbix is running. After I start Postgres, Zabbix starts to log errors. See the attached zabbix.log.gz.
PostgreSQL 8.4, Zabbix 1.8.9rc1.x-22144.

Comment by Aleksandrs Saveljevs [ 2011 Nov 09 ]

Zabbix server works very well for me: Zabbix pre-1.8.9, r23074, PostgreSQL 9.1. When I stop PostgreSQL, Zabbix server starts complaining, but when I start PostgreSQL again, database connection is recovered and it works fine.

Could you please describe what exactly makes you think that the connection is not recovered? I get the same errors as you posted in the log file when I stop PostgreSQL, but that's expected - they say that the database is not available.

Comment by Sergey Syreskin [ 2011 Nov 09 ]

In my case errors continue to appear in the log file after I start Postgres again.

Comment by Sergey Syreskin [ 2012 Aug 14 ]

This probably happens when PostgreSQL is stopped and then started immediately with the command like "service postgres stop; service postgres start".
I have attached a Zabbix log file (2012 Aug 14 16:18) for this case. In that log you can see that database errors still continue after PostgreSQL is started.

Comment by Alexander Vladishev [ 2012 Oct 31 ]

Cannot reproduce with latest trunk r31174 (pre-2.1.0), 1.9.6 and 1.9.2 with PostgreSQL 9.1.6 and 8.4.14.
Tested with remote and local connections to the database.

When I restart PostgreSQL server or stop and start again, database connection is recovered and it works fine.

Comment by Alexander Vladishev [ 2014 Sep 24 ]

I close the issue.

Generated at Sun Jun 15 13:52:30 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.