Can't create cluster after deleting cluster.conf

Nov 20, 2020
10
0
6
51
Hi,

I created a cluster on upgraded mailgate server (from 6.x to latest 7.x) and tried to join a slave, but that did not work due to deny.hosts prohibiting all ssh connections. After fixing hosts.deny and testing that one server can ssh to another with user root and ssk keys - I stopped pmgsync.service on both servers, deleted /etc/pmg/cluster.conf and started pmgsync.service again on both servers. Web interface showed no clusters or cluster members on both nodes.

then I tried to create cluster again on primary node:

root@mailgate:/etc/pmg# pmgcm create
stop all services accessing the database
save new cluster configuration
update quarantine database
update statistic database
update greylist database
update localstat database
DBD::Pg::db do failed: ERROR: duplicate key value violates unique constraint "localstat_pkey" DETAIL: Key ("time", cid)=(1643803200, 1) already exists. at /usr/share/perl5/PMG/DBTools.pm line 937.

In web interface it shows that cluster is somehow created, but then when I try to add a slave node - it fails.

I'm not a postgresdb expert - is there any way to safely fix the duplicate in database? Would that fix the issue?

Cheers, Jan
 
pmgsync.service
that probably should have been pmgmirror and pmgtunnel service (those handle the cluster operations, pmgsync only makes sure that modifications to configs get put live)
In web interface it shows that cluster is somehow created, but then when I try to add a slave node - it fails.

could you share the logs of both nodes when trying to add the node?
 
that probably should have been pmgmirror and pmgtunnel service (those handle the cluster operations, pmgsync only makes sure that modifications to configs get put live)


could you share the logs of both nodes when trying to add the node?
uh, sorry, I had to fix my problem in a hurry, so I created a completely new 7.x PMG VM, copied configs from old one and created a cluster there. Old one is no longer existing :(