Solved

Problem with my cluster Centreon


Userlevel 2
Badge +8

Hi, Im currently trying to do a Centreon cluster, with the centreon documentation two nodes.

I’m able to do the master and slave replication, so if I ve a host in the master and the master goes down and my slave become the master I can see the host on the centreon interface.

But when I do the reserve, so adding a host in my slave when my master is down, then I set my master to up, and I come to see the host on the master the replication is not done i can’t see the host on the master.

To conclude replication master to slave OK but replication slave to master NOT OK

If you have any ideas what is going on tell me 🙂 thanks .

 

Salut, j’essaye actuellement de faire un cluster Centreon, avec la documentation Centreon deux nœuds.Je suis capable de faire la réplication maître et esclave, donc si j'ai un hôte dans le maître et que le maître tombe en panne et que mon esclave devient le maître, je peux voir l'hôte sur l'interface centreon.Mais quand je fais la l’inverse, donc ajouter un host dans mon slave quand mon master est down, puis je mets mon master en up, et je ne vois pas l'hôte sur le maître.Pour conclure réplication maître vers esclave OK mais réplication esclave vers maître PAS OKSi vous avez des idées sur ce qui se passe, dites-le moi 🙂 merci.
icon

Best answer by Kriko 3 June 2022, 11:09

View original

34 replies

Userlevel 2
Badge +8

Hum: Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).

This error is not normal.

Could you show me your /etc/hosts on both server ?

 

Ya sure:
[root@centreon-slave my.cnf.d]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.137.174 centreon-master.local centreon-master
192.168.137.173 centreon-slave.local centreon-slave

 

[root@centreon-master my.cnf.d]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.137.173 centreon-slave.local centreon-slave
192.168.137.174 centreon-master.local centreon-master
 

I have retry the script replication, and I have noticed that when the slave is the master and the master is the slave the replication status is OK, but when the master is the master and the slave is the slave the replication is turning into Warning

 

WHEN THE SLAVE IS THE MASTER, AND THE MASTER IS THE SLAVE.

MARIADB ON SLAVE:

[root@centreon-slave my.cnf.d]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 56
Server version: 10.5.15-MariaDB-log MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> SHOW SLAVE STATUS \G
*************************** 1. row ***************************
                Slave_IO_State:
                   Master_Host: centreon-slave
                   Master_User: centreon-repl
                   Master_Port: 3306
                 Connect_Retry: 60
               Master_Log_File: mysql-bin.000004
           Read_Master_Log_Pos: 342
                Relay_Log_File: mysql-relay-bin.000001
                 Relay_Log_Pos: 4
         Relay_Master_Log_File: mysql-bin.000004
              Slave_IO_Running: No
             Slave_SQL_Running: Yes
               Replicate_Do_DB:
           Replicate_Ignore_DB:
            Replicate_Do_Table:
        Replicate_Ignore_Table:
       Replicate_Wild_Do_Table:
   Replicate_Wild_Ignore_Table: centreon.session
                    Last_Errno: 0
                    Last_Error:
                  Skip_Counter: 0
           Exec_Master_Log_Pos: 342
               Relay_Log_Space: 256
               Until_Condition: None
                Until_Log_File:
                 Until_Log_Pos: 0
            Master_SSL_Allowed: No
            Master_SSL_CA_File:
            Master_SSL_CA_Path:
               Master_SSL_Cert:
             Master_SSL_Cipher:
                Master_SSL_Key:
         Seconds_Behind_Master: NULL
 Master_SSL_Verify_Server_Cert: No
                 Last_IO_Errno: 1593
                 Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
                Last_SQL_Errno: 0
                Last_SQL_Error:
   Replicate_Ignore_Server_Ids:
              Master_Server_Id: 2
                Master_SSL_Crl:
            Master_SSL_Crlpath:
                    Using_Gtid: No
                   Gtid_IO_Pos:
       Replicate_Do_Domain_Ids:
   Replicate_Ignore_Domain_Ids:
                 Parallel_Mode: conservative
                     SQL_Delay: 0
           SQL_Remaining_Delay: NULL
       Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
              Slave_DDL_Groups: 0
Slave_Non_Transactional_Groups: 0
    Slave_Transactional_Groups: 0
1 row in set (0.000 sec)

MariaDB [(none)]> SHOW MASTER STATUS \G
*************************** 1. row ***************************
            File: mysql-bin.000005
        Position: 342
    Binlog_Do_DB: centreon,centreon_storage
Binlog_Ignore_DB:
1 row in set (0.000 sec)
 

 

MARIADB ON MASTER:

[root@centreon-master my.cnf.d]# mysql -u root -p                               Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 811
Server version: 10.5.15-MariaDB-log MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> SHOW SLAVE STATUS \G
Empty set (0.001 sec)

MariaDB [(none)]> SHOW MASTER STATUS \G
*************************** 1. row ***************************
            File: mysql-bin.000023
        Position: 638031
    Binlog_Do_DB: centreon,centreon_storage
Binlog_Ignore_DB:
1 row in set (0.000 sec)

 

PCS STATUS:

[root@centreon-slave my.cnf.d]# pcs status
Cluster name: centreon_cluster
Stack: corosync
Current DC: centreon-slave (version 1.1.23-1.el7_9.1-9acf116022) - partition with quorum
Last updated: Mon May 30 15:38:02 2022
Last change: Mon May 30 15:33:35 2022 by root via cibadmin on centreon-slave

2 nodes configured
14 resource instances configured

Online: [ centreon-master centreon-slave ]

Full list of resources:

 Master/Slave Set: ms_mysql-master [ms_mysql]
     Masters: [ centreon-master ]
     Slaves: [ centreon-slave ]
 Clone Set: php-clone [php]
     Started: [ centreon-master centreon-slave ]
 Clone Set: cbd_rrd-clone [cbd_rrd]
     Started: [ centreon-master centreon-slave ]
 Resource Group: centreon
     http       (systemd:httpd24-httpd):        Started centreon-master
     gorgone    (systemd:gorgoned):     Started centreon-master
     centreon_central_sync      (systemd:centreon-central-sync):        Started centreon-master
     cbd_central_broker (systemd:cbd-sql):      Started centreon-master
     centengine (systemd:centengine):   Started centreon-master
     centreontrapd      (systemd:centreontrapd):        Started centreon-master
     snmptrapd  (systemd:snmptrapd):    Started centreon-master
 centreon-vip   (ocf:💓IPaddr2):       Started centreon-master

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
 

SCRIPT STATUS:


[root@centreon-slave my.cnf.d]# /usr/share/centreon-ha/bin/mysql-check-status.sh
Connection Status 'centreon-master' [ok]
Connection Status 'centreon-slave' [ok]
Slave Thread Status [warning]
Error reports:
    A Replication thread is down on 'centreon-slave'.
Position Status [ok]
 

WHEN THE MASTER IS THE MASTER, AND THE SLAVE IS THE SLAVE.

BUT WHEN ITS THE SLAVE THE MASTER REPLICATION IS OK:

[root@centreon-master my.cnf.d]# pcs status
Cluster name: centreon_cluster
Stack: corosync
Current DC: centreon-slave (version 1.1.23-1.el7_9.1-9acf116022) - partition with quorum
Last updated: Mon May 30 16:07:00 2022
Last change: Mon May 30 15:53:58 2022 by root via cibadmin on centreon-master

2 nodes configured
14 resource instances configured

Online: [ centreon-master centreon-slave ]

Full list of resources:

 Master/Slave Set: ms_mysql-master [ms_mysql]
     Masters: [ centreon-slave ]
     Slaves: [ centreon-master ]
 Clone Set: php-clone [php]
     Started: [ centreon-master centreon-slave ]
 Clone Set: cbd_rrd-clone [cbd_rrd]
     Started: [ centreon-master centreon-slave ]
 Resource Group: centreon
     http       (systemd:httpd24-httpd):        Started centreon-slave
     gorgone    (systemd:gorgoned):     Started centreon-slave
     centreon_central_sync      (systemd:centreon-central-sync):        Started centreon-slave
     cbd_central_broker (systemd:cbd-sql):      Started centreon-slave
     centengine (systemd:centengine):   Started centreon-slave
     centreontrapd      (systemd:centreontrapd):        Started centreon-slave
     snmptrapd  (systemd:snmptrapd):    Started centreon-slave
 centreon-vip   (ocf::heartbeat:IPaddr2):       Started centreon-slave

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
 

SCRIPT STATUS:

[root@centreon-slave my.cnf.d]# /usr/share/centreon-ha/bin/mysql-check-status.sh
Connection Status 'centreon-master' [OK]
Connection Status 'centreon-slave' [OK]
Slave Thread Status [OK]
Position Status [OK]
 

Userlevel 5
Badge +16

So it’s good now ? 

Userlevel 2
Badge +8

So it’s good now ? 

It seem to be good, but Is it normal that we dont see the same database on the master as on the slave and vice versa ? Also they don’t have the same “mysql.bin00000” ?

Userlevel 2
Badge +8

[root@centreon-slave ~]# /usr/share/centreon-ha/bin/mysql-check-status.sh
Connection Status 'centreon-master' [OK]
Connection Status 'centreon-slave' [OK]
Slave Thread Status [KO]
Error reports:
    A Replication thread is down on 'centreon-slave'.SQL Thread is stopped because of an error (error=' Error 'Table 'centreon_storage.mod_open_tickets' doesn't exist in engine' on query. Default database: 'centreon_storage'. Query: 'INSERT INTO mod_open_tickets (`timestamp`, `user`)').
Position Status [OK]
 

 

I’have also this problem, on my master postfix mail works and the ticketing also. But on my slave It don’t work. Do I need to install and configure postfix and open tickets and my slave or the replication normally replicate it ?

Userlevel 5
Badge +16

Hello o/
 

Check your private message ;-)

Userlevel 2
Badge +8

Hello o/
 

Check your private message ;-)

Hello ! 

 

I sent you somes messages :)

Userlevel 5
Badge +16

Problem solve \o/

few errors:

  • missing ssh key exchanges
  • vip_centreon wasn’t in centreon group resource
Badge +2

Hi @Kriko  can you please give me more details about the solution for this issue ?

1 . missing ssh key exchanges   . Which keys from which user I need to check ?
2. vip_centreon wasn’t in centreon group resource . How can I check that ? 

 

root@FRSDCENT1V001:10:33:22[CENTRAL-01]/tmp/centreon-autodisco#pcs status
Cluster name: centreon_cluster
Cluster Summary:
  * Stack: corosync
  * Current DC: FRSDCENT1V003 (version 2.1.2-4.el8_6.2-ada5c3b36e2) - partition with quorum
  * Last updated: Tue Feb 13 10:45:15 2024
  * Last change:  Mon Feb 12 17:09:15 2024 by root via crm_resource on FRSDCENT1V001
  * 4 nodes configured
  * 21 resource instances configured

Node List:
  * Online: [ FRSDCENT1V001 FRSDCENT1V002 FRSDCENT1V003 FRSDCENT1V004 ]

Full List of Resources:
  * Clone Set: ms_mysql-clone [ms_mysql] (promotable):
    * Masters: [ FRSDCENT1V003 ]
    * Slaves: [ FRSDCENT1V004 ]
    * Stopped: [ FRSDCENT1V001 FRSDCENT1V002 ]
  * vip_mysql   (ocf::heartbeat:IPaddr2):        Started FRSDCENT1V003
  * Clone Set: php-clone [php]:
    * Started: [ FRSDCENT1V001 FRSDCENT1V002 ]
    * Stopped: [ FRSDCENT1V003 FRSDCENT1V004 ]
  * Clone Set: cbd_rrd-clone [cbd_rrd]:
    * Started: [ FRSDCENT1V001 FRSDCENT1V002 ]
    * Stopped: [ FRSDCENT1V003 FRSDCENT1V004 ]
  * Resource Group: centreon:
    * vip       (ocf::heartbeat:IPaddr2):        Started FRSDCENT1V001
    * http      (systemd:httpd):         Started FRSDCENT1V001
    * gorgone   (systemd:gorgoned):      Started FRSDCENT1V001
    * centreon_central_sync     (systemd:centreon-central-sync):         Started FRSDCENT1V001
    * cbd_central_broker        (systemd:cbd-sql):       Started FRSDCENT1V001
    * centengine        (systemd:centengine):    Started FRSDCENT1V001
    * centreontrapd     (systemd:centreontrapd):         Started FRSDCENT1V001
    * snmptrapd (systemd:snmptrapd):     Started FRSDCENT1V001

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled

 

 

Thank you vey much

Badge +2

@Xavier   Can you give me some details about this issue as well ? PLease !  😊

I need to fix this asap .

Reply