I am trying to setup a second syslog-ng server that will be part of a load balanced cluster. When the 2nd server tries to connect to my mssql database, it tries to run the CREATE TABLE commands which fails because the table already exists since the first syslog-ng server already created them. How do I tell the 2nd server not to try the CREATE TABLE stuff so it will start working? Shawn Cannon IT Professional http://www.shawncannon.com Contact Me <http://www.linkedin.com/pub/shawn-cannon/5/84/81a> LinkedIn<http://www.linkedin.com/pub/shawn-cannon/5/84/81a> <http://www.facebook.com/rolltidega72> Facebook<http://www.facebook.com/rolltidega72> <http://twitter.com/rolltidega> Twitter <http://twitter.com/rolltidega> My blog: My thoughts on VMworld… a week later…<http://www.shawncannon.com/?p=19>
It will only try to create the table if it thinks it doesnt already exist. It determines if it exists by doing `select * from <table> where 0=1`. You must be able to perform this query using the same credentials syslog-ng is using. It doesnt matter that it wont return any rows, it just cant generate an error. -Patrick Sent: Thu Jan 20 2011 10:39:37 GMT-0700 (Mountain Standard Time) From: Shawn Cannon <shawn@shawncannon.com> To: Syslog-ng users' and developers' mailing list <syslog-ng@lists.balabit.hu> Subject: [syslog-ng] Syslog-ng error
I am trying to setup a second syslog-ng server that will be part of a load balanced cluster. When the 2nd server tries to connect to my mssql database, it tries to run the CREATE TABLE commands which fails because the table already exists since the first syslog-ng server already created them. How do I tell the 2nd server not to try the CREATE TABLE stuff so it will start working?
Shawn Cannon
IT Professional
http://www.shawncannon.com <http://www.shawncannon.com/>
Contact Me <http://www.linkedin.com/pub/shawn-cannon/5/84/81a> LinkedIn <http://www.linkedin.com/pub/shawn-cannon/5/84/81a> <http://www.facebook.com/rolltidega72> Facebook <http://www.facebook.com/rolltidega72> <http://twitter.com/rolltidega> Twitter <http://twitter.com/rolltidega> My blog: My thoughts on VMworld… a week later… <http://www.shawncannon.com/?p=19>
------------------------------------------------------------------------
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.campin.net/syslog-ng/faq.html
On Thu, Jan 20, 2011 at 12:39:37PM -0500, Shawn Cannon wrote:
I am trying to setup a second syslog-ng server that will be part of a load balanced cluster. When the 2nd server tries to connect to my mssql database, it tries to run the CREATE TABLE commands which fails because the table already exists since the first syslog-ng server already created them. How do I tell the 2nd server not to try the CREATE TABLE stuff so it will start working?
Shawn Cannon
IT Professional
There is a dont-create-tables option in newer syslog-ngs which will fix this one. dont-create-tables: Enable this flag to prevent syslog-ng OSE from creating non-existing database tables automatically. The syslog-ng OSE application typically has to create tables if you use macros in the table names. Available in syslog-ng OSE version 3.2 and later. http://www.balabit.com/sites/default/files/documents/syslog-ng-ose-v3.2-guid... HTH, Matthew.
Thanks. It ended up that I needed to make the SQL user default to that database, even though I already have the database specified in the config file. No big deal, just annoying that it seems to ignore the database setting. Shawn Cannon IT Professional http://www.shawncannon.com Contact Me <http://www.linkedin.com/pub/shawn-cannon/5/84/81a> LinkedIn<http://www.linkedin.com/pub/shawn-cannon/5/84/81a> <http://www.facebook.com/rolltidega72> Facebook<http://www.facebook.com/rolltidega72> <http://twitter.com/rolltidega> Twitter <http://twitter.com/rolltidega> On Thu, Jan 20, 2011 at 1:35 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
On Thu, Jan 20, 2011 at 12:39:37PM -0500, Shawn Cannon wrote:
I am trying to setup a second syslog-ng server that will be part of a load balanced cluster. When the 2nd server tries to connect to my mssql database, it tries to run the CREATE TABLE commands which fails because the table already exists since the first syslog-ng server already created them. How do I tell the 2nd server not to try the CREATE TABLE stuff so it will start working?
Shawn Cannon
IT Professional
There is a dont-create-tables option in newer syslog-ngs which will fix this one.
dont-create-tables: Enable this flag to prevent syslog-ng OSE from creating non-existing database tables automatically. The syslog-ng OSE application typically has to create tables if you use macros in the table names. Available in syslog-ng OSE version 3.2 and later.
http://www.balabit.com/sites/default/files/documents/syslog-ng-ose-v3.2-guid...
HTH, Matthew.
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.campin.net/syslog-ng/faq.html
On Thu, Jan 20, 2011 at 01:46:26PM -0500, Shawn Cannon wrote:
Thanks. It ended up that I needed to make the SQL user default to that database, even though I already have the database specified in the config file. No big deal, just annoying that it seems to ignore the database setting.
Shawn Cannon
IT Professional
I think you mentioned this one previously. It's probably a libdbi issue that needs to be sorted out, because it doesn't happen to me using mysql, the database argument to the sql driver does the job. Matthew.
Maybe I did. I have so much going on I forgot about it. :-( Shawn Cannon IT Professional http://www.shawncannon.com Contact Me <http://www.linkedin.com/pub/shawn-cannon/5/84/81a> LinkedIn<http://www.linkedin.com/pub/shawn-cannon/5/84/81a> <http://www.facebook.com/rolltidega72> Facebook<http://www.facebook.com/rolltidega72> <http://twitter.com/rolltidega> Twitter <http://twitter.com/rolltidega> My blog: My thoughts on VMworld… a week later…<http://www.shawncannon.com/?p=19> On Thu, Jan 20, 2011 at 1:50 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
On Thu, Jan 20, 2011 at 01:46:26PM -0500, Shawn Cannon wrote:
Thanks. It ended up that I needed to make the SQL user default to that database, even though I already have the database specified in the config file. No big deal, just annoying that it seems to ignore the database setting.
Shawn Cannon
IT Professional
I think you mentioned this one previously. It's probably a libdbi issue that needs to be sorted out, because it doesn't happen to me using mysql, the database argument to the sql driver does the job.
Matthew.
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.campin.net/syslog-ng/faq.html
Hi, we have already encountered this problem a few weeks ago. See the following thread: [syslog-ng] Microsoft SQL connect issue My summary from this thread: "Hm... You are right, it seems that syslog-ng tries to connect to the database that is the default for the specified user in config. However, I've checked it in syslog-ng source, and syslog-ng uses the same code for all database types for connecting and passes the name of database properly and in case of other databases it works, too. So, it is a bug, but not in syslog-ng but in freetds or libdbi. Report a bug on it, please, and we will check if we can fix it" 2011.01.20. 19:46 keltezéssel, Shawn Cannon írta:
Thanks. It ended up that I needed to make the SQL user default to that database, even though I already have the database specified in the config file. No big deal, just annoying that it seems to ignore the database setting.
Shawn Cannon
IT Professional
http://www.shawncannon.com <http://www.shawncannon.com/>
Contact Me <http://www.linkedin.com/pub/shawn-cannon/5/84/81a> LinkedIn <http://www.linkedin.com/pub/shawn-cannon/5/84/81a> <http://www.facebook.com/rolltidega72> Facebook <http://www.facebook.com/rolltidega72> <http://twitter.com/rolltidega> Twitter <http://twitter.com/rolltidega>
On Thu, Jan 20, 2011 at 1:35 PM, Matthew Hall <mhall@mhcomputing.net <mailto:mhall@mhcomputing.net>> wrote:
On Thu, Jan 20, 2011 at 12:39:37PM -0500, Shawn Cannon wrote: > I am trying to setup a second syslog-ng server that will be part of a load > balanced cluster. When the 2nd server tries to connect to my mssql > database, it tries to run the CREATE TABLE commands which fails because the > table already exists since the first syslog-ng server already created them. > How do I tell the 2nd server not to try the CREATE TABLE stuff so it will > start working? > > Shawn Cannon > > IT Professional > > http://www.shawncannon.com
There is a dont-create-tables option in newer syslog-ngs which will fix this one.
dont-create-tables: Enable this flag to prevent syslog-ng OSE from creating non-existing database tables automatically. The syslog-ng OSE application typically has to create tables if you use macros in the table names. Available in syslog-ng OSE version 3.2 and later.
http://www.balabit.com/sites/default/files/documents/syslog-ng-ose-v3.2-guid...
HTH, Matthew. ______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.campin.net/syslog-ng/faq.html
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.campin.net/syslog-ng/faq.html
-- pzolee
Sent: Thu Jan 20 2011 11:35:41 GMT-0700 (Mountain Standard Time) From: Matthew Hall <mhall@mhcomputing.net> To: Syslog-ng users' and developers' mailing list <syslog-ng@lists.balabit.hu> Subject: Re: [syslog-ng] Syslog-ng error
On Thu, Jan 20, 2011 at 12:39:37PM -0500, Shawn Cannon wrote:
I am trying to setup a second syslog-ng server that will be part of a load balanced cluster. When the 2nd server tries to connect to my mssql database, it tries to run the CREATE TABLE commands which fails because the table already exists since the first syslog-ng server already created them. How do I tell the 2nd server not to try the CREATE TABLE stuff so it will start working?
Shawn Cannon
IT Professional
There is a dont-create-tables option in newer syslog-ngs which will fix this one.
The big problem with this solution is that if the table check failed, then inserting it will also fail. The only case this would solve is if the user doesnt have select perms, but does have insert perms. -Patrick
On Thu, Jan 20, 2011 at 12:26:10PM -0700, Patrick H. wrote:
The big problem with this solution is that if the table check failed, then inserting it will also fail. The only case this would solve is if the user doesnt have select perms, but does have insert perms.
-Patrick
Indeed it could be a problem but so is leaving it enabled in many cases. Personally I find the auto-creation mostly useless and try to avoid it. Because it won't take care of cases like special auto-incrementing ID columns, storage engine, tablespace, and other special stuff. So I would generally recommend making a proper table, and backing up its schema, and storing this with a backup of the syslog-ng configuration. Matthew.
Sent: Thu Jan 20 2011 14:33:16 GMT-0700 (Mountain Standard Time) From: Matthew Hall <mhall@mhcomputing.net> To: Syslog-ng users' and developers' mailing list <syslog-ng@lists.balabit.hu> Subject: Re: [syslog-ng] Syslog-ng error
On Thu, Jan 20, 2011 at 12:26:10PM -0700, Patrick H. wrote:
The big problem with this solution is that if the table check failed, then inserting it will also fail. The only case this would solve is if the user doesnt have select perms, but does have insert perms.
-Patrick
Indeed it could be a problem but so is leaving it enabled in many cases. Personally I find the auto-creation mostly useless and try to avoid it.
Because it won't take care of cases like special auto-incrementing ID columns, storage engine, tablespace, and other special stuff.
So I would generally recommend making a proper table, and backing up its schema, and storing this with a backup of the syslog-ng configuration.
Matthew.
So, make sure the table already exists and there isnt a problem :-P -Patrick
On Thu, 2011-01-20 at 13:33 -0800, Matthew Hall wrote:
On Thu, Jan 20, 2011 at 12:26:10PM -0700, Patrick H. wrote:
The big problem with this solution is that if the table check failed, then inserting it will also fail. The only case this would solve is if the user doesnt have select perms, but does have insert perms.
-Patrick
Indeed it could be a problem but so is leaving it enabled in many cases. Personally I find the auto-creation mostly useless and try to avoid it.
Because it won't take care of cases like special auto-incrementing ID columns, storage engine, tablespace, and other special stuff.
auto-incrementing IDs should certainly be possible, although storage engine and tablespace ain't. can you paste a complete CREATE TABLE command that should be possible with automatic creation? I'm not that much into various SQL implementations to see where things should go. Thanks.
So I would generally recommend making a proper table, and backing up its schema, and storing this with a backup of the syslog-ng configuration.
-- Bazsi
participants (5)
-
Balazs Scheidler
-
Matthew Hall
-
Patrick H.
-
Shawn Cannon
-
Zoltán Pallagi