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 5
Badge +16

Hello o/
 

When the “slave” is actually the master of the cluster, the replication is still up or not ?

 

What does a mysql-check-status.sh return you when you’re in this situation ? Also what is the output of a pcs status command

Userlevel 2
Badge +8

Hello o/
 

When the “slave” is actually the master of the cluster, the replication is still up or not ?

 

What does a mysql-check-status.sh return you when you’re in this situation ? Also what is the output of a pcs status command

 

For mysql-check-status.sh it says:

[root@centreon-master ~]# /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-master'.
Position Status [OK]
 

For pcs status:

[root@centreon-master ~]#  pcs status
Cluster name: centreon_cluster
Stack: corosync
Current DC: centreon-master (version 1.1.23-1.el7_9.1-9acf116022) - partition wi                                                                                                                                   th quorum
Last updated: Mon May 23 14:29:08 2022
Last change: Mon May 23 14:27:56 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
 

 

 

Userlevel 5
Badge +16

Here the issue :

Slave Thread Status [WARNING]
Error reports:
    A Replication thread is down on 'centreon-master'.
Position Status [OK]
 

The replication thread is down.
Now we need to figure out why.

 

could you show the server.cnf of your 2 servers ?

Userlevel 2
Badge +8

Here the issue :

Slave Thread Status [warning]
Error reports:
    A Replication thread is down on 'centreon-master'.
Position Status [ok]
 

The replication thread is down.
Now we need to figure out why.

 

could you show the server.cnf of your 2 servers ?

Thanks ! Yes I can show you:

THE SLAVE:

[root@centreon-slave my.cnf.d]# cat server.cnf
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#

# this is read by the standalone daemon and embedded servers

[server]
server-id=2 # SET TO 1 FOR MASTER AND 2 FOR SLAVE
read_only
log-bin=mysql-bin
binlog-do-db=centreon
binlog-do-db=centreon_storage
innodb_flush_log_at_trx_commit=1
sync_binlog=1
binlog_format=MIXED
slave_compressed_protocol=1
slave_parallel_mode=conservative
datadir=/var/lib/mysql
pid-file=/var/lib/mysql/mysql.pid

# Tuning standard Centreon
innodb_file_per_table=1
open_files_limit=32000
key_buffer_size=256M
sort_buffer_size=32M
join_buffer_size=4M
thread_cache_size=64
read_buffer_size=512K
read_rnd_buffer_size=256K
max_allowed_packet=64M
# Uncomment for 4 Go Ram
innodb_buffer_pool_size=512M
# Uncomment for 8 Go Ram
#innodb_buffer_pool_size=1G
# MariaDB strict mode will be supported soon
#sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

# this is only for the mysqld standalone daemon
[mysqld]

#
# * Galera-related settings
#
[galera]
# Mandatory settings
#wsrep_on=ON
#wsrep_provider=
#wsrep_cluster_address=
#binlog_format=row
#default_storage_engine=InnoDB
#innodb_autoinc_lock_mode=2
#
# Allow server to accept connections on all interfaces.
#
#bind-address=0.0.0.0
#
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0

# this is only for embedded server
[embedded]

# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]

# This group is only read by MariaDB-10.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.5]
 

AND THE MASTER:

[root@centreon-master ~]#  cd /etc/my.cnf.d/
[root@centreon-master my.cnf.d]# cat server.cnf
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#

# this is read by the standalone daemon and embedded servers

[server]
server-id=1 # SET TO 1 FOR MASTER AND 2 FOR SLAVE
read_only
log-bin=mysql-bin
binlog-do-db=centreon
binlog-do-db=centreon_storage
innodb_flush_log_at_trx_commit=1
sync_binlog=1
binlog_format=MIXED
slave_compressed_protocol=1
slave_parallel_mode=conservative
datadir=/var/lib/mysql
pid-file=/var/lib/mysql/mysql.pid

# Tuning standard Centreon
innodb_file_per_table=1
open_files_limit=32000
key_buffer_size=256M
sort_buffer_size=32M
join_buffer_size=4M
thread_cache_size=64
read_buffer_size=512K
read_rnd_buffer_size=256K
max_allowed_packet=64M
# Uncomment for 4 Go Ram
innodb_buffer_pool_size=512M
# Uncomment for 8 Go Ram
#innodb_buffer_pool_size=1G
# MariaDB strict mode will be supported soon
#sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

# this is only for the mysqld standalone daemon
[mysqld]

#
# * Galera-related settings
#
[galera]
# Mandatory settings
#wsrep_on=ON
#wsrep_provider=
#wsrep_cluster_address=
#binlog_format=row
#default_storage_engine=InnoDB
#innodb_autoinc_lock_mode=2
#
# Allow server to accept connections on all interfaces.
#
#bind-address=0.0.0.0
#
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0

# this is only for embedded server
[embedded]

# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]

# This group is only read by MariaDB-10.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.5]
 

Userlevel 5
Badge +16

Thank you for all the information.

Everything looks good.

When the issue occurs, you don’t have any log in /var/lib/mysql/something.err or /var/log/mysqld.log or /var/log/messages ?

Userlevel 2
Badge +8

Thank you for all the information.

Everything looks good.

When the issue occurs, you don’t have any log in /var/lib/mysql/something.err or /var/log/mysqld.log or /var/log/messages ?

You’re welcome !

in /var/lib/mysql I have :

[root@centreon-slave mysql]# cd /var/lib/mysql/
[root@centreon-slave mysql]# ls
aria_log.00000001  ibdata1            mysql             mysql-bin.000005  mysql-bin.000010  mysql-bin.000015        mysql-relay-bin.000004  mysql-relay-bin.000009
aria_log_control   ib_logfile0        mysql-bin.000001  mysql-bin.000006  mysql-bin.000011  mysql-bin.000016        mysql-relay-bin.000005  mysql-relay-bin.index
centreon           ibtmp1             mysql-bin.000002  mysql-bin.000007  mysql-bin.000012  mysql-bin.index         mysql-relay-bin.000006  mysql.sock
centreon_storage   master.info        mysql-bin.000003  mysql-bin.000008  mysql-bin.000013  mysql.pid               mysql-relay-bin.000007  performance_schema
ib_buffer_pool     multi-master.info  mysql-bin.000004  mysql-bin.000009  mysql-bin.000014  mysql-relay-bin.000003  mysql-relay-bin.000008  relay-log.info
 

in /var/log/mysqld.log I have:

220523 17:19:27 mysqld_safe mysqld from pid file /var/lib/mysql/mysql.pid ended
220525 09:14:38 mysqld_safe Starting mariadbd daemon with databases from /var/lib/mysql
2022-05-25  9:14:39 0 [Note] /usr/sbin/mariadbd (mysqld 10.5.15-MariaDB-log) starting as process 1677 ...
2022-05-25  9:14:40 0 [Note] InnoDB: Uses event mutexes
2022-05-25  9:14:40 0 [Note] InnoDB: Compressed tables use zlib 1.2.7
2022-05-25  9:14:40 0 [Note] InnoDB: Number of pools: 1
2022-05-25  9:14:40 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-05-25  9:14:40 0 [Note] InnoDB: Using Linux native AIO
2022-05-25  9:14:40 0 [Note] InnoDB: Initializing buffer pool, total size = 536870912, chunk size = 134217728
2022-05-25  9:14:40 0 [Note] InnoDB: Completed initialization of buffer pool
2022-05-25  9:14:40 0 [Note] InnoDB: 128 rollback segments are active.
2022-05-25  9:14:40 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-05-25  9:14:40 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-05-25  9:14:40 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-05-25  9:14:40 0 [Note] InnoDB: 10.5.15 started; log sequence number 23394228; transaction id 62313
2022-05-25  9:14:40 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-05-25  9:14:40 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-05-25  9:14:40 0 [Note] Server socket created on IP: '::'.
2022-05-25  9:14:41 0 [Note] Reading of all Master_info entries succeeded
2022-05-25  9:14:41 0 [Note] Added new Master_info '' to hash table
2022-05-25  9:14:41 0 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MariaDB server acts as a replica and has its hostname changed. Please use '--log-basename=#' or '--relay-log=mysql-relay-bin' to avoid this problem.
2022-05-25  9:14:41 0 [Note] /usr/sbin/mariadbd: ready for connections.
Version: '10.5.15-MariaDB-log'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
2022-05-25  9:14:42 0 [Note] InnoDB: Buffer pool(s) load completed at 220525  9:14:42
2022-05-25  9:14:44 16 [Note] Slave I/O thread: Start asynchronous replication to master 'centreon-repl@centreon-master:3306' in log 'mysql-bin.000013' at position 312082
2022-05-25  9:14:44 17 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000013' at position 238539, relay log './mysql-relay-bin.000004' position: 17767
2022-05-25  9:14:44 16 [Note] Slave I/O thread: connected to master 'centreon-repl@centreon-master:3306',replication started in log 'mysql-bin.000013' at position 312082
2022-05-25  9:14:44 17 [ERROR] Slave SQL: Error 'Duplicate entry '13' for key 'PRIMARY'' on query. Default database: 'centreon'. Query: 'INSERT INTO `centreon`.session (`session_id` , `user_id` , `last_reload`, `ip_address`) VALUES ('mr96aj8tfoe83gl0kap13hok88', 1, 1653318715, '192.168.137.1')', Gtid 0-1-11129, Internal MariaDB error code: 1062
2022-05-25  9:14:44 17 [Warning] Slave: Duplicate entry '13' for key 'PRIMARY' Error_code: 1062
2022-05-25  9:14:44 17 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000013' position 238539
2022-05-25  9:14:44 17 [Note] Slave SQL thread exiting, replication stopped in log 'mysql-bin.000013' at position 238539
2022-05-25  9:14:44 17 [Note] master was centreon-master:3306
2022-05-25  9:15:53 16 [ERROR] Error reading packet from server: Lost connection to server during query (server_errno=2013)
2022-05-25  9:15:53 16 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000014', position 188597
2022-05-25  9:15:53 16 [Note] master was centreon-master:3306
 

 

In var/log/messages I have :


May 25 09:35:01 centreon-slave crond: sendmail: fatal: parameter inet_interfaces: no local interface found for ::1
May 25 09:36:01 centreon-slave systemd: Started Session 32 of user root.
May 25 09:36:01 centreon-slave crond: sendmail: fatal: parameter inet_interfaces: no local interface found for ::1
May 25 09:37:01 centreon-slave systemd: Started Session 33 of user root.
May 25 09:37:01 centreon-slave crond: sendmail: fatal: parameter inet_interfaces: no local interface found for ::1
May 25 09:38:02 centreon-slave systemd: Started Session 34 of user root.
May 25 09:38:02 centreon-slave crond: sendmail: fatal: parameter inet_interfaces: no local interface found for ::1
May 25 09:39:01 centreon-slave systemd: Started Session 35 of user root.
May 25 09:39:01 centreon-slave crond: sendmail: fatal: parameter inet_interfaces: no local interface found for ::1
May 25 09:39:19 centreon-slave corosync[3803]: [TOTEM ] A processor failed, forming new configuration.
May 25 09:39:19 centreon-slave corosync[3803]: [TOTEM ] A new membership (192.168.137.173:113) was formed. Members
May 25 09:39:19 centreon-slave corosync[3803]: [CPG   ] downlist left_list: 0 received
May 25 09:39:19 centreon-slave corosync[3803]: [CPG   ] downlist left_list: 0 received
May 25 09:39:19 centreon-slave corosync[3803]: [QUORUM] Members[2]: 2 1
May 25 09:39:19 centreon-slave corosync[3803]: [MAIN  ] Completed service synchronization, ready to provide service.
May 25 09:40:01 centreon-slave systemd: Started Session 36 of user root.
May 25 09:40:01 centreon-slave crond: sendmail: fatal: parameter inet_interfaces: no local interface found for ::1
May 25 09:41:01 centreon-slave systemd: Started Session 37 of user root.
May 25 09:41:01 centreon-slave crond: sendmail: fatal: parameter inet_interfaces: no local interface found for ::1
 

And now I have:

[root@centreon-slave log]# /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:
    No slave (maybe because we cannot check a server).
Position Status [SKIP]
Error reports:
    Skip because we can't identify a unique slave.
 

pcs status:

 

[root@centreon-slave log]# pcs status
Cluster name: centreon_cluster
Stack: corosync
Current DC: centreon-master (version 1.1.23-1.el7_9.1-9acf116022) - partition with quorum
Last updated: Wed May 25 09:43:27 2022
Last change: Wed May 25 09:15:58 2022 by hacluster via crmd 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::heartbeat:IPaddr2):       Started centreon-master

Failed Resource Actions:
* centreon-vip_monitor_30000 on centreon-master 'not running' (7): call=61, status=complete, exitreason='',
    last-rc-change='Wed May 25 09:16:06 2022', queued=0ms, exec=0ms

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

 

Userlevel 5
Badge +16

Thank you again, crystal clear.

Here the “issue”:

2022-05-25  9:14:44 17 [ERROR] Slave SQL: Error 'Duplicate entry '13' for key 'PRIMARY'' on query. Default database: 'centreon'. Query: 'INSERT INTO `centreon`.session (`session_id` , `user_id` , `last_reload`, `ip_address`) VALUES ('mr96aj8tfoe83gl0kap13hok88', 1, 1653318715,

The table session is not well replicated for an unknown reason.

You can add in your server.cnf the following directive:

replicate-wild-ignore-table = centreon.session

 

Userlevel 2
Badge +8

Thank you again, crystal clear.

Here the “issue”:

2022-05-25  9:14:44 17 [ERROR] Slave SQL: Error 'Duplicate entry '13' for key 'PRIMARY'' on query. Default database: 'centreon'. Query: 'INSERT INTO `centreon`.session (`session_id` , `user_id` , `last_reload`, `ip_address`) VALUES ('mr96aj8tfoe83gl0kap13hok88', 1, 1653318715,

The table session is not well replicated for an unknown reason.

You can add in your server.cnf the following directive:

replicate-wild-ignore-table = centreon.session

 

So I add it on my two nodes Master and Slave ?

Userlevel 5
Badge +16

Yep sorry about the less of information.

Yup put it on both server.

And restart the synchronization using sync big db script and try some failover test :)

Userlevel 2
Badge +8

Yep sorry about the less of information.

Yup put it on both server.

And restart the synchronization using sync big db script and try some failover test :)

No problem !

What is the script “sync big db script”  this one “/usr/share/centreon-ha/bin/mysql-sync-bigdb.sh” ?

 

Userlevel 5
Badge +16

This is the script that used normally to set up the cluster: https://docs.centreon.com/docs/21.10/installation/installation-of-centreon-ha/installation-2-nodes/#synchronizing-the-databases-and-enabling-mariadb-replication

 

/usr/share/centreon-ha/bin/mysql-sync-bigdb.sh

 

Userlevel 2
Badge +8

This is the script that used normally to set up the cluster: https://docs.centreon.com/docs/21.10/installation/installation-of-centreon-ha/installation-2-nodes/#synchronizing-the-databases-and-enabling-mariadb-replication

 

/usr/share/centreon-ha/bin/mysql-sync-bigdb.sh

 

Ok i’ve done everything

server.cnf slave :

[root@centreon-slave my.cnf.d]# cat server.cnf
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#

# this is read by the standalone daemon and embedded servers

replicate-wild-ignore-table = centreon.session

[server]
server-id=2 # SET TO 1 FOR MASTER AND 2 FOR SLAVE
read_only
log-bin=mysql-bin
 

server.cnf master : 

[root@centreon-master my.cnf.d]# cat server.cnf
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#

# this is read by the standalone daemon and embedded servers

replicate-wild-ignore-table = centreon.session


[server]
server-id=1 # SET TO 1 FOR MASTER AND 2 FOR SLAVE
read_only
log-bin=mysql-bin
 

 

Then the script seems not working:

 

ON MASTER

[root@centreon-master my.cnf.d]# /usr/share/centreon-ha/bin/mysql-sync-bigdb.sh
MySQL datadir found: /var/lib/mysql
MySQL logbin files: mysql-bin
MySQL logbin localisation: /var/lib/mysql
MySQL relaylog files: mysql-relay-bin
MySQL relaylog localisation: /var/lib/mysql
Mount device 'datadir' found: /dev/mapper/centos-var_lib_mysql
Mount point 'datadir' found: /var/lib/mysql
Mount device 'log-bin' found: /dev/mapper/centos-var_lib_mysql
Mount point 'log-bin' found: /var/lib/mysql
VolumeGroup found: centos
LogicalVolume 'datadir' found:   /dev/centos/var_lib_mysql
LogicalVolume 'log-bin' found:   /dev/centos/var_lib_mysql
Free total size in VolumeGroup (Go): 5.01953
Connection to slave Server (verify mysql stopped): centreon-slave
mysql@centreon-slave's password:
ERROR: MySQL is launched or problem to connect to the server.

ON SLAVE:

[root@centreon-slave my.cnf.d]# /usr/share/centreon-ha/bin/mysql-sync-bigdb.sh
MySQL datadir found: /var/lib/mysql
MySQL logbin files: mysql-bin
MySQL logbin localisation: /var/lib/mysql
MySQL relaylog files: mysql-relay-bin
MySQL relaylog localisation: /var/lib/mysql
Mount device 'datadir' found: /dev/mapper/centos-var_lib_mysql
Mount point 'datadir' found: /var/lib/mysql
Mount device 'log-bin' found: /dev/mapper/centos-var_lib_mysql
Mount point 'log-bin' found: /var/lib/mysql
VolumeGroup found: centos
LogicalVolume 'datadir' found:   /dev/centos/var_lib_mysql
LogicalVolume 'log-bin' found:   /dev/centos/var_lib_mysql
Free total size in VolumeGroup (Go): 5.01953
Connection to slave Server (verify mysql stopped): centreon-master
mysql@centreon-master's password:
ERROR: MySQL is launched or problem to connect to the server.
 

I HAVE CHECK THE STATUS ON SLAVE it looks like it dont like the line I’ve add:

[root@centreon-slave my.cnf.d]# /usr/share/centreon-ha/bin/mysql-check-status.sh
error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
Connection Status 'centreon-master' [OK]
Error reports:
    error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
Connection Status 'centreon-slave' [OK]
Error reports:
    error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
Slave Thread Status [KO]
Error reports:
    No slave (maybe because we cannot check a server).
Position Status [SKIP]
Error reports:
    Skip because we can't identify a unique slave.
 

STATUS ON MASTER:

[root@centreon-master my.cnf.d]# /usr/share/centreon-ha/bin/mysql-check-status.sh
error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
Connection Status 'centreon-master' [OK]
Error reports:
    error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
Connection Status 'centreon-slave' [OK]
Error reports:
    error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
Slave Thread Status [KO]
Error reports:
    No slave (maybe because we cannot check a server).
Position Status [SKIP]
Error reports:
    Skip because we can't identify a unique slave.
 

 

THEN I VE TRIED:

ON MASTER
[root@centreon-master my.cnf.d]# systemctl restart mysql
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
[root@centreon-master my.cnf.d]#

 

ON SLAVE

[root@centreon-slave my.cnf.d]# systemctl restart mysql
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
[root@centreon-slave my.cnf.d]#
 

 

Userlevel 5
Badge +16

Are you used to the Centreon HA or not ?

This script should be executed only on your master server.

You can follow this proc to setup again the replicaiton: https://docs.centreon.com/docs/21.10/administration/centreon-ha/operating-guide/#restore-mariadb-master-slave-replication

Userlevel 2
Badge +8

Are you used to the Centreon HA or not ?

This script should be executed only on your master server.

You can follow this proc to setup again the replicaiton: https://docs.centreon.com/docs/21.10/administration/centreon-ha/operating-guide/#restore-mariadb-master-slave-replication

Its the first time i’m trying to making it work

 

It seem that it don’t like the new line i added:

[root@centreon-master my.cnf.d]# /usr/share/centreon-ha/bin/mysql-check-status.sh
error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
Connection Status 'centreon-master' [ok]
Error reports:
    error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
Connection Status 'centreon-slave' [ok]
Error reports:
    error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
Slave Thread Status [ko]
Error reports:
    No slave (maybe because we cannot check a server).
Position Status [skip]
Error reports:
    Skip because we can't identify a unique slave.
 

 

 

I tried the script again with your steps on the Centreon Documentation by stoping mysql on salve:

 

[root@centreon-master my.cnf.d]# /usr/share/centreon-ha/bin/mysql-sync-bigdb.sh
MySQL datadir found: /var/lib/mysql
MySQL logbin files: mysql-bin
MySQL logbin localisation: /var/lib/mysql
MySQL relaylog files: mysql-relay-bin
MySQL relaylog localisation: /var/lib/mysql
Mount device 'datadir' found: /dev/mapper/centos-var_lib_mysql
Mount point 'datadir' found: /var/lib/mysql
Mount device 'log-bin' found: /dev/mapper/centos-var_lib_mysql
Mount point 'log-bin' found: /var/lib/mysql
VolumeGroup found: centos
LogicalVolume 'datadir' found:   /dev/centos/var_lib_mysql
LogicalVolume 'log-bin' found:   /dev/centos/var_lib_mysql
Free total size in VolumeGroup (Go): 5.01953
Connection to slave Server (verify mysql stopped): centreon-slave
mysql@centreon-slave's password:
Stopping mariadbd:error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
.OK
Create LVM snapshot
  Reducing COW size <5,02 GiB down to maximum usable size 1004,00 MiB.
  Logical volume "dbbackupdatadir" created.
Start mariadbd: (/usr/bin/mysqld_safe --defaults-file=/etc/my.cnf.d/server.cnf --pid-file=/var/lib/mysql/mysql.pid --socket=/var/lib/mysql/mysql.sock --datadir=/var/lib/mysql --log-error=/var/log/mysqld.log --user=mysql --skip-slave-start)
.error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
Fatal error in defaults handling. Program aborted
WARNING: Defaults file '/etc/my.cnf.d/server.cnf' not found!
error: Found option without preceding group in config file: /etc/my.cnf.d/server.cnf at line: 10
Fatal error in defaults handling. Program aborted
WARNING: Defaults file '/etc/my.cnf.d/server.cnf' not found!
220525 12:05:00 mysqld_safe Logging to '/var/log/mysqld.log'.
220525 12:05:00 mysqld_safe Starting mariadbd daemon with databases from /var/lib/mysql
............................................................
ERROR: Can't start MySQL server

Userlevel 5
Badge +16

Yep sorry.
 

replicate-wild-ignore-table = centreon.session

Should be under [mysqld] session

Sorry about this.

Userlevel 2
Badge +8

Yep sorry.
 

replicate-wild-ignore-table = centreon.session

Should be under [mysqld] session

Sorry about this.

No problem I have change the line location and the script worked well !

[root@centreon-master my.cnf.d]# /usr/share/centreon-ha/bin/mysql-sync-bigdb.sh
MySQL datadir found: /var/lib/mysql
MySQL logbin files: mysql-bin
MySQL logbin localisation: /var/lib/mysql
MySQL relaylog files: mysql-relay-bin
MySQL relaylog localisation: /var/lib/mysql
Mount device 'datadir' found: /dev/mapper/centos-var_lib_mysql
Mount point 'datadir' found: /var/lib/mysql
Mount device 'log-bin' found: /dev/mapper/centos-var_lib_mysql
Mount point 'log-bin' found: /var/lib/mysql
VolumeGroup found: centos
LogicalVolume 'datadir' found:   /dev/centos/var_lib_mysql
LogicalVolume 'log-bin' found:   /dev/centos/var_lib_mysql
Free total size in VolumeGroup (Go): 4.03906
Connection to slave Server (verify mysql stopped): centreon-slave
mysql@centreon-slave's password:
Create LVM snapshot
  Reducing COW size <4,04 GiB down to maximum usable size 1004,00 MiB.
  Logical Volume "dbbackupdatadir" already exists in volume group "centos"
Start mariadbd: (/usr/bin/mysqld_safe --defaults-file=/etc/my.cnf.d/server.cnf --pid-file=/var/lib/mysql/mysql.pid --socket=/var/lib/mysql/mysql.sock --datadir=/var/lib/mysql --log-error=/var/log/mysqld.log --user=mysql --skip-slave-start)
.220525 12:20:02 mysqld_safe Logging to '/var/log/mysqld.log'.
220525 12:20:02 mysqld_safe Starting mariadbd daemon with databases from /var/lib/mysql
OK
Mount LVM snapshot
BinLog File =  mysql-bin.000014
BinLog Position =  2896143
Remove read_only on master
Delete Logbin and RelayLog files
mysql@centreon-slave's password:
Rsync in progress (exclude MySQL, mysql-bin, mysql-relay-bin)
mysql@centreon-slave's password:
sending incremental file list
./
aria_log.00000001
         32,768 100%   30.58MB/s    0:00:00 (xfr#1, to-chk=519/521)
aria_log_control
             52 100%   50.78kB/s    0:00:00 (xfr#2, to-chk=518/521)
ib_buffer_pool
         12,389 100%    5.91MB/s    0:00:00 (xfr#3, to-chk=517/521)
ib_logfile0
    100,663,296 100%   56.36MB/s    0:00:01 (xfr#4, to-chk=516/521)
ibdata1
     79,691,776 100%   30.86MB/s    0:00:02 (xfr#5, to-chk=515/521)
master.info
            112 100%    0.16kB/s    0:00:00 (xfr#6, to-chk=514/521)
relay-log.info
             34 100%    0.05kB/s    0:00:00 (xfr#7, to-chk=512/521)
centreon/acl_resources.ibd
         98,304 100%  135.79kB/s    0:00:00 (xfr#8, to-chk=490/521)
centreon/acl_resources_host_relations.ibd
        131,072 100%  180.79kB/s    0:00:00 (xfr#9, to-chk=484/521)
centreon/command.ibd
        163,840 100%  225.04kB/s    0:00:00 (xfr#10, to-chk=420/521)
centreon/cron_operation.ibd
         98,304 100%  134.64kB/s    0:00:00 (xfr#11, to-chk=384/521)
centreon/extended_host_information.ibd
        163,840 100%  223.46kB/s    0:00:00 (xfr#12, to-chk=323/521)
centreon/extended_service_information.ibd
        147,456 100%  200.00kB/s    0:00:00 (xfr#13, to-chk=321/521)
centreon/host.ibd
        245,760 100%  331.49kB/s    0:00:00 (xfr#14, to-chk=315/521)
centreon/host_service_relation.ibd
        180,224 100%  242.09kB/s    0:00:00 (xfr#15, to-chk=311/521)
centreon/host_template_relation.ibd
        114,688 100%  153.64kB/s    0:00:00 (xfr#16, to-chk=309/521)
centreon/mod_auto_disco_ht_rule_relation.ibd
        131,072 100%  174.86kB/s    0:00:00 (xfr#17, to-chk=283/521)
centreon/mod_auto_disco_inclusion_exclusion.ibd
        114,688 100%  152.80kB/s    0:00:00 (xfr#18, to-chk=281/521)
centreon/mod_auto_disco_macro.ibd
        114,688 100%  152.38kB/s    0:00:00 (xfr#19, to-chk=277/521)
centreon/mod_auto_disco_rule.ibd
        147,456 100%  195.12kB/s    0:00:00 (xfr#20, to-chk=275/521)
centreon/mod_ppm_host_service_relation.ibd
        131,072 100%  172.74kB/s    0:00:00 (xfr#21, to-chk=247/521)
centreon/mod_ppm_icons.ibd
        147,456 100%  193.55kB/s    0:00:00 (xfr#22, to-chk=245/521)
centreon/mod_ppm_pluginpack.ibd
        147,456 100%  193.03kB/s    0:00:00 (xfr#23, to-chk=241/521)
centreon/mod_ppm_pluginpack_dependency.ibd
        114,688 100%  149.93kB/s    0:00:00 (xfr#24, to-chk=237/521)
centreon/mod_ppm_pluginpack_host.ibd
        131,072 100%  170.89kB/s    0:00:00 (xfr#25, to-chk=235/521)
centreon/nagios_server.ibd
        114,688 100%  149.13kB/s    0:00:00 (xfr#26, to-chk=225/521)
centreon/ns_host_relation.ibd
        131,072 100%  169.99kB/s    0:00:00 (xfr#27, to-chk=223/521)
centreon/ods_view_details.ibd
        131,072 100%  169.54kB/s    0:00:00 (xfr#28, to-chk=221/521)
centreon/on_demand_macro_host.ibd
        114,688 100%  147.95kB/s    0:00:00 (xfr#29, to-chk=217/521)
centreon/on_demand_macro_service.ibd
        114,688 100%  147.56kB/s    0:00:00 (xfr#30, to-chk=215/521)
centreon/security_authentication_tokens.ibd
        180,224 100%  230.97kB/s    0:00:00 (xfr#31, to-chk=201/521)
centreon/security_token.ibd
        147,456 100%  188.48kB/s    0:00:00 (xfr#32, to-chk=199/521)
centreon/service.ibd
        229,376 100%  291.29kB/s    0:00:00 (xfr#33, to-chk=197/521)
centreon/session.ibd
        131,072 100%  166.02kB/s    0:00:00 (xfr#34, to-chk=187/521)
centreon/view_img.ibd
         98,304 100%  124.19kB/s    0:00:00 (xfr#35, to-chk=153/521)
centreon/view_img_dir_relation.ibd
        131,072 100%  164.95kB/s    0:00:00 (xfr#36, to-chk=149/521)
centreon_storage/centreon_acl.ibd
        131,072 100%  164.52kB/s    0:00:00 (xfr#37, to-chk=127/521)
centreon_storage/customvariables.ibd
        114,688 100%  143.41kB/s    0:00:00 (xfr#38, to-chk=121/521)
centreon_storage/data_bin#P#p20220519.ibd
        147,456 100%  183.91kB/s    0:00:00 (xfr#39, to-chk=118/521)
centreon_storage/data_bin#P#p20220520.ibd
        196,608 100%  243.96kB/s    0:00:00 (xfr#40, to-chk=117/521)
centreon_storage/data_bin#P#p20220524.ibd
        114,688 100%  141.77kB/s    0:00:00 (xfr#41, to-chk=113/521)
centreon_storage/data_bin#P#p20220526.ibd
        278,528 100%  340.43kB/s    0:00:00 (xfr#42, to-chk=111/521)
centreon_storage/hosts.ibd
        131,072 100%  159.60kB/s    0:00:00 (xfr#43, to-chk=90/521)
centreon_storage/index_data.ibd
        212,992 100%  255.84kB/s    0:00:00 (xfr#44, to-chk=80/521)
centreon_storage/instances.ibd
        114,688 100%  137.25kB/s    0:00:00 (xfr#45, to-chk=78/521)
centreon_storage/log_action.ibd
        147,456 100%  176.04kB/s    0:00:00 (xfr#46, to-chk=72/521)
centreon_storage/log_action_modification.ibd
        229,376 100%  272.84kB/s    0:00:00 (xfr#47, to-chk=70/521)
centreon_storage/logs#P#p20220519.ibd
      8,388,608 100%    8.76MB/s    0:00:00 (xfr#48, to-chk=33/521)
centreon_storage/logs#P#p20220520.ibd
        229,376 100%  244.54kB/s    0:00:00 (xfr#49, to-chk=32/521)
centreon_storage/logs#P#p20220524.ibd
        262,144 100%  277.36kB/s    0:00:00 (xfr#50, to-chk=28/521)
centreon_storage/logs#P#p20220526.ibd
        229,376 100%  241.12kB/s    0:00:00 (xfr#51, to-chk=26/521)
centreon_storage/metrics.ibd
        131,072 100%  137.49kB/s    0:00:00 (xfr#52, to-chk=20/521)
centreon_storage/modules.ibd
        114,688 100%  119.91kB/s    0:00:00 (xfr#53, to-chk=18/521)
centreon_storage/nagios_stats.ibd
         98,304 100%  102.56kB/s    0:00:00 (xfr#54, to-chk=16/521)
centreon_storage/services.ibd
        163,840 100%  170.21kB/s    0:00:00 (xfr#55, to-chk=8/521)
toto/
toto/db.opt
             65 100%    0.07kB/s    0:00:00 (xfr#56, to-chk=0/521)

sent 16,335,351 bytes  received 230,278 bytes  1,577,678.95 bytes/sec
total size is 226,429,809  speedup is 13.67
mysql@centreon-slave's password:
sending incremental file list
gtid_slave_pos.ibd
         98,304 100%   93.08MB/s    0:00:00 (xfr#1, to-chk=6/8)
innodb_index_stats.ibd
      9,437,184 100%  140.62MB/s    0:00:00 (xfr#2, to-chk=4/8)
innodb_table_stats.ibd
        131,072 100%    1.84MB/s    0:00:00 (xfr#3, to-chk=2/8)

sent 227,927 bytes  received 20,479 bytes  70,973.14 bytes/sec
total size is 9,824,971  speedup is 39.55
Umount and Delete LVM snapshot
  Logical volume "dbbackupdatadir" successfully removed
Start MySQL Slave
mysql@centreon-slave's password:
220525 12:20:22 mysqld_safe Logging to '/var/log/mysqld.log'.
220525 12:20:22 mysqld_safe Starting mariadbd daemon with databases from /var/lib/mysql
.OK
Start Replication
Id      User    Host    db      Command Time    State   Info    Progress
5       centreon-repl   centreon-master.local:33458     NULL    Query   0      starting show processlist        0.000
6       system user             NULL    Connect 0       Checking master versionNULL     0.000
7       system user             NULL    Slave_SQL       0       Slave has read all relay log; waiting for more updates  NULL    0.000
[root@centreon-master my.cnf.d]#
 

 

I HAVE CHECKED THE STATUS ON THE MASTER:


[root@centreon-master 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]
 

pcs status on MASTER:

[root@centreon-master my.cnf.d]# pcs status
Cluster name: centreon_cluster
Stack: corosync
Current DC: centreon-master (version 1.1.23-1.el7_9.1-9acf116022) - partition with quorum
Last updated: Wed May 25 12:22:40 2022
Last change: Wed May 25 09:15:58 2022 by hacluster via crmd 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]
     Stopped: [ centreon-master 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

Failed Resource Actions:
* ms_mysql_start_0 on centreon-slave 'unknown error' (1): call=117, status=complete, exitreason='',
    last-rc-change='Wed May 25 12:04:59 2022', queued=0ms, exec=2316ms
* ms_mysql_demote_0 on centreon-master 'not running' (7): call=130, status=complete, exitreason='',
    last-rc-change='Wed May 25 12:05:09 2022', queued=1ms, exec=65ms
* centreon-vip_monitor_30000 on centreon-master 'not running' (7): call=61, status=complete, exitreason='',
    last-rc-change='Wed May 25 09:16:06 2022', queued=0ms, exec=0ms

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
[root@centreon-master my.cnf.d]#
 

 

I HAVE CHECK THE STATUS ON MARIADB DATABASE:


[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 251
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)]>
MariaDB [(none)]>
MariaDB [(none)]> SHOW MASTER STATUS \G
*************************** 1. row ***************************
            File: mysql-bin.000015
        Position: 140743
    Binlog_Do_DB: centreon,centreon_storage
Binlog_Ignore_DB:
1 row in set (0.000 sec)

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

 

 

Userlevel 5
Badge +16

Try a:

pcs resource cleanup ms_mysql

 

Userlevel 2
Badge +8

oTry a:

pcs resource cleanup ms_mysql

 

On both nodes ?

Userlevel 5
Badge +16

Only one node.
the pcs command is global for all the nodes of the cluster :)

Userlevel 2
Badge +8

Only one node.
the pcs command is global for all the nodes of the cluster :)

Ok I did it on my MASTER node

I have these result:

 

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

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

MariaDB [(none)]> Ctrl-C -- exit!
Aborted

 


[root@centreon-master my.cnf.d]# pcs status
Cluster name: centreon_cluster
Stack: corosync
Current DC: centreon-master (version 1.1.23-1.el7_9.1-9acf116022) - partition with quorum
Last updated: Wed May 25 14:18:17 2022
Last change: Wed May 25 14:14:12 2022 by hacluster via crmd 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-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::heartbeat:IPaddr2):       Started centreon-master

Failed Resource Actions:
* centreon-vip_monitor_30000 on centreon-master 'not running' (7): call=61, status=complete, exitreason='',
    last-rc-change='Wed May 25 09:16:06 2022', queued=0ms, exec=0ms

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

 

[root@centreon-master 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

Looks better no ? :)

 

Userlevel 2
Badge +8

Looks better no ? :)

 

Ya thanks its working !! but, I have this problem how I solve it ?

Failed Resource Actions:
* centreon-vip_monitor_30000 on centreon-master 'not running' (7): call=61, status=complete, exitreason='',

 

and I have nothing on my slave currently:

 

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

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

Userlevel 5
Badge +16

Nothing on your slave ? :o

But the script  /usr/share/centreon-ha/bin/mysql-check-status.sh still return you OK output ?

About the failed actions, following the ouput, you can just do a:

pcs resource cleanup your_resource

This command remove the failed actions that may occurs when you do some operation like what we done without unmanaged the cluster :)

Userlevel 2
Badge +8

Nothing on your slave ? :o

But the script  /usr/share/centreon-ha/bin/mysql-check-status.sh still return you OK output ?

About the failed actions, following the ouput, you can just do a:

pcs resource cleanup your_resource

This command remove the failed actions that may occurs when you do some operation like what we done without unmanaged the cluster :)

The status says that there is a warning:

SCRIPT MYSQL CHECK STATUS ON SLAVE:

[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 [warning]
Error reports:
    A Replication thread is down on 'centreon-slave'.
Position Status [ok]
 

 

PCS STATUS ON SLAVE:

[root@centreon-slave ~]# 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 12:47:00 2022
Last change: Mon May 30 12:44:38 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
 

 

ON MARIADB SLAVE I HAVE:

[root@centreon-slave ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 300
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.000003
           Read_Master_Log_Pos: 342
                Relay_Log_File: mysql-relay-bin.000002
                 Relay_Log_Pos: 4
         Relay_Master_Log_File: mysql-bin.000003
              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: 1
           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 SLAVE STATUS ON MASTER I HAVE:

[root@centreon-master log]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3221
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.000 sec)

MariaDB [(none)]>
 

Userlevel 5
Badge +16

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 ?

Reply