[syslog-ng] reconnect DB session after timeout

Balazs Scheidler bazsi at balabit.hu
Thu Jul 14 09:32:26 CEST 2011


On Mon, 2011-06-27 at 14:02 +0200, Gergely Nagy wrote:
> "Marcus Groß" <Mgsyslog at gmx.de> writes:
> 
> > Hi,
> >
> > I'm running syslog-ng v. 3.2.4 on SLES 10. There are three defined MySQL DB destinations.
> > Everything is running fine, until the MySQL server resets the connection(s) after a defined idle time if no
> > messages are send to this database.
> > The problem is that syslog-ng doesn't reconnect the disconnected connection  ;)
> >
> > I have to restart syslog-ng to bring it back to life.
> >
> > Is there any posssibility to reopen the DB connection instead of disabling the idle timeout on the MySQL side?
> >
> > syslog-ng[4904]: Error running SQL query; type='mysql', host='snsanmg8429', port='', user='syslog', database='SysLog', error='20
> > 06: MySQL server has gone away', query='CREATE TABLE SysLog_Brocade_2011_06_09 (Host varchar(255), Facility varchar(255), Priority varchar(255), Level varchar
> > (45), Date varchar(45), Program varchar(255), Message varchar(700))'
> >
> > syslog-ng[4904]: Error creating table, giving up; table='SysLog_Brocade_2011_06_09'
> > syslog-ng[4904]: Error checking table, disconnecting from database, trying again shortly; time_reopen='60'
> 
> It should retry in 60 seconds. Are you sure it doesn't?
> 
> (As far as I remember, you can change that value to be shorter, with
> time_reopen(5) for example.)
> 

yeah, it should do that, however the reconnection mechanism is triggered
by actual messages. Since the one which triggered table creation wasn't
INSERTed, it should be retried automatically. 

-- 
Bazsi




More information about the syslog-ng mailing list