Re: [pmacct-discussion] MySQL and Duplicate Primary Keys

2008-10-08 Thread Chris Wilson
Hi Paolo,

On Wed, 8 Oct 2008, Paolo Lucente wrote:

> Also, i see two different PIDs logging the duplication issue in your 
> email; whereas disabling the primary key the same tuple is written three 
> times; is it possible that there are multiple (3) concurrent pmacctd 
> instances running by mistake?

Sorry, I think you're right, there were multiple instances running :(

Thanks again for your help.

Cheers, Chris.
-- 
Aptivate | http://www.aptivate.org | Phone: +44 1223 760887
The Humanitarian Centre, Fenner's, Gresham Road, Cambridge CB1 2ES

Aptivate is a not-for-profit company registered in England and Wales
with company number 04980791.

___
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists


Re: [pmacct-discussion] MySQL and Duplicate Primary Keys

2008-10-08 Thread Paolo Lucente
Hi Chris,

it's very strange - but from the top of my head, i can't recall any issues
like the one described in pmacct 0.9.x; so, the problem could be unrelated
to the vintage of the version you are using. 

For the tuples that you have shown in the original email, it would be nice
to know whether bytes and packets counters are the same or not. Normally
the stamp_inserted field avoids such duplicates; can you, just for testing
purposes, increase both sql_history and sql_refresh_time to 2 mins and see
what happens?

Also, i see two different PIDs logging the duplication issue in your email;
whereas disabling the primary key the same tuple is written three times; is
it possible that there are multiple (3) concurrent pmacctd instances running
by mistake? 

Cheers,
Paolo


On Thu, Oct 02, 2008 at 11:40:36AM +0100, Chris Wilson wrote:
> Hi all,
> 
> I always get a lot of errors like this when using pmacct on a MySQL 
> database:
> 
> Oct  2 06:26:01 fen-fw pmacctd[16237]: ERROR ( default/mysql ): Duplicate 
> entry 
> '00-0-0-217.160.76.21-10.0.156.226-4949-33730-tcp-0-2008-10-0' for key 
> 1  
> Oct  2 06:26:01 fen-fw pmacctd[16239]: ERROR ( default/mysql ): Duplicate 
> entry 
> '00-0-0-217.160.76.21-10.0.156.226-4949-33730-tcp-0-2008-10-0' for key 
> 1  
> 
> (I didn't paste that line twice, there really are two identical lines in 
> the log).
> 
> After I delete the primary key, I get duplicate rows in the database, like 
> this:
> 
> mysql> select ip_src,ip_dst,src_port,dst_port,stamp_inserted from acct_v6 
> where ip_src="10.0.156.1" and ip_dst="10.0.156.210" and src_port=53 and 
> dst_port=56556 and stamp_inserted="2008-10-02 10:43:00";
> ++--+--+--+-+
> | ip_src | ip_dst   | src_port | dst_port | stamp_inserted  |
> ++--+--+--+-+
> | 10.0.156.1 | 10.0.156.210 |   53 |56556 | 2008-10-02 10:43:00 | 
> | 10.0.156.1 | 10.0.156.210 |   53 |56556 | 2008-10-02 10:43:00 | 
> | 10.0.156.1 | 10.0.156.210 |   53 |56556 | 2008-10-02 10:43:00 | 
> ++--+--+--+-+
> 3 rows in set (0.00 sec)
> 
> (I've omitted the other columns, but they really are all identical).
> 
> The configuration is:
> 
> aggregate: src_host, src_port, dst_host, dst_port, proto
> sql_history: 1m
> sql_history_roundoff: m
> sql_table_version: 6
> sql_refresh_time: 60
> sql_multi_values: 1024000
> sql_dont_try_update: true
> sql_optimize_clauses: true
> 
> Does anyone have any ideas about what might cause this? 
> 
> I'm using pmacct 0.9.1 on this server. I know it's old, but it's what 
> comes with Ubuntu Dapper.
> 
> Cheers, Chris.
> -- 
> Aptivate | http://www.aptivate.org | Phone: +44 1223 760887
> The Humanitarian Centre, Fenner's, Gresham Road, Cambridge CB1 2ES
> 
> Aptivate is a not-for-profit company registered in England and Wales
> with company number 04980791.




___
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists