Standby Server DB Replication

Started by clifford, January 15, 2019, 06:00:53 AM

Previous topic - Next topic

clifford

Hi

I need a standby netxms server, i also want to ensure the secondary server has a 48 hours old data, i tried using mariadb delayed replication feature, with no success,

I ge the below error when the DB replicates

Last_SQL_Error: Error 'Duplicate entry '26022462' for key 'PRIMARY'' on query. Default database: 'netxms'. Query: 'INSERT INTO event_log (event_id,event_code,event_timestamp,event_source,zone_uin,dci_id,event_severity,event_message,root_event_id,user_tag,raw_data) VALUES (26022462,6,1547457625,166937,0,0,0,'Node status changed to NORMAL',0,'','\n   \"id\": 26022462,\n   \"code\": 6,\n   \"name\": \"SYS_NODE_NORMAL\",\n   \"timestamp\": 1547457625,\n   \"source\": 166937,\n   \"dci\": 0,\n   \"severity\": 0,\n   \"tag\": null,\n   \"message\": \"Node status changed to NORMAL\",\n   \"parameters\": [\n      {\n         \"name\": \"\",\n         \"value\": \"1\"\n      }\n   ]\n')'
  Replicate_Ignore_Server_Ids:


is there something i need to do to get this setup working?

And now i got the error

Last_SQL_Error: Error 'Duplicate entry '352689' for key 'PRIMARY'' on query. Default                                                                                                            database: 'netxms'. Query: 'INSERT INTO alarms (alarm_id,creation_time,last_change_time,source_obje                                                                                                           ct_id,zone_uin,source_event_code,message,original_severity,current_severity,alarm_key,alarm_state,ac                                                                                                           k_by,resolved_by,hd_state,hd_ref,repeat_count,term_by,timeout,timeout_event,source_event_id,ack_time                                                                                                           out,dci_id,alarm_category_ids) VALUES (352689,1547544189,1547544189,264663,0,5,'Interface \"Port9\"                                                                                                            changed state to DOWN (IP Addr: UNSPEC/0, IfIndex: 9)',2,2,'IF_DOWN_0x000409D7_9',0,0,0,0,'',1,0,0,4                                                                                                           3,26042528,0,0,'')'


Thanks

Clifford Dsouza

meshnet

i would down netxms daemon, then run nxdbmgr -d -f check

restart netxsd daemon, did it fix anything? no? down netxms daemon again.

enter your mysql console, and use the netxms database

then, remove that duplicate entry with a mysql query

Quotedelete from netxms.event_log where event_id = 26022462;

exit, 'check' netxms database, restart netxms daemon, if a similiar issue occurs for what seems like infinity, you can repeat, or clear out the table with truncate netxms.event_log