Hi Jeremy, On Fri, Oct 02, 2009 at 03:37:21PM +1000, Jeremy Lee wrote:
> Yes, that's right, the MySQL database is on another machine from pmaccd. I > know this isn't the recommended setup, but (a) the machines are co-located This is not true. A modular design is generally the way to go for bigger installations. The following step is to cluster the modules if required. Both scenarios are indeed supported. RTT of 70ms doesn't look impressive but will definitely work. > Generally it works very well. But this morning, after running perfectly > all night, pmacctd started dying with the following message: > > INFO: connection lost to 'default-mysql'; closing connection. > INFO: no more plugins active. Shutting down. > > [ ... ] > > Is there a way to get the mysql plugin to automatically reconnect to the > server when this happens? I can't seem to find an option anywhere... The connection to the database is not persistent; every time the SQL cache scanner kicks in (sql_refresh_time), a new connection to the database is made. Now, the above message can mean two things: a) you are running into pmacct crashing; in such a case look for a coredump around and if you find one send it over to me (privately); if coredumps are not created on your system because of ulimit: fix that, give it another try, see if you can spot the coredump and same as before. b) it could be a MySQL issue; hence enable debug and see if more verbosity helps troubleshooting. To enable debug: "debug: true" in your configuration file. > Second, I'm noticing that when the mysql plugin connects to the database, > it's not using the 'base' IP address of eth0, but rather one of the other > IP interfaces like "eth0:2031". Worse, it seems to bind to a semi-random > IP, and will occasionally switch between runs. The mysql_real_connect(), part of the MySQL API, doesn't allow to specify an IP address to use for originating a TCP connection to a remote database. Hence pmacct can do nothing about it; if there is a knob to be configured on the MySQL side of the things, that can be very likely in your my.cnf MySQL configuration file. If you are successful in this, let us know - it could be good to know for other people. I traditionally totally second Karl's and Wim's position of: "PostgreSQL rocks"; although i'm not sure PostgreSQL would do any better in the same pants. Cheers, Paolo _______________________________________________ pmacct-discussion mailing list http://www.pmacct.net/#mailinglists