Percona MySQL Replication - SLAVE is not replicating

Hi there,
MySQL replication is successful,but slave is not replicating(data is not transferred from master to slave).

Master - Percona MySQL 5.7.31-34-log
Slave - Percona MySQL 8.0.25-15

At slave :


mysql@slave > show slave status\G;
*************************** 1. row ***************************
                  Slave_IO_State: Waiting for master to send event
                  Master_Host: 192.168.2.1
                  Master_User: repl
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000814
          Read_Master_Log_Pos: 155348410
               Relay_Log_File: Mysql-Slave-relay-bin.000003
                Relay_Log_Pos: 2148867
        Relay_Master_Log_File: mysql-bin.000814
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table: stores.invoices,stores.products
      Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 155348410
              Relay_Log_Space: 2975223
              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: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 172311196
                  Master_UUID: 9358d4c5-183f-11eb-b59e-021da59478db
             Master_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp:
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set:
                Auto_Position: 0
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:
       Master_public_key_path:
        Get_master_public_key: 0
            Network_Namespace:
1 row in set, 1 warning (0.00 sec)

At Master …:


mysql> show master status ;
+------------------+-----------+--------------+------------------+-------------------+
| File             | Position  | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+-----------+--------------+------------------+-------------------+
| mysql-bin.000814 | 155348410 |              | mysql            |                   |
+------------------+-----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)

Config File of Slave


[client]
default-character-set          = utf8mb4

[mysql]

# CLIENT #
port                           = 3306
socket                         = /var/run/mysqld/mysqld.sock

[mysqld]

# GENERAL #

default-authentication-plugin=mysql_native_password

user                           = mysql
default-storage-engine         = InnoDB
socket                         = /var/run/mysqld/mysqld.sock
pid-file                       = /var/run/mysqld/mysqld.pid
basedir                      = /usr
tmpdir                         = /var/tmp
lc-messages-dir                = /usr/share/mysql

log_timestamps                 = SYSTEM

net-write-timeout              = 600
net-read-timeout               = 600
innodb-page-cleaners           = 8
performance-schema             = OFF

skip-slave-start
#read-only                      = ON
log-slave-updates              = ON

# MyISAM #
key-buffer-size                = 32M

# SAFETY #
max-allowed-packet             = 16M
max-connect-errors             = 1000000
sysdate-is-now                 = 1

# DATA STORAGE #
datadir                        = /var/lib/mysql/

# BINARY LOGGING #
server-id                      = 2
relay-log                      = /var/lib/mysql/Mysql-Slave-relay-bin
log-bin                        = /var/lib/mysql/mysql-bin


# Replication Tables 
replicate-do-table=stores.invoices
replicate-do-table=stores.products


# CACHES AND LIMITS #
tmp-table-size                 = 32M
max-heap-table-size            = 32M
query-cache-type               = 0
query-cache-size               = 0
max-connections                = 1000
thread-cache-size              = 50
# open-files-limit               = 9900
table-definition-cache         = 4096
table-open-cache               = 4096

# INNODB #
innodb-flush-method            = O_DIRECT
innodb-log-files-in-group      = 2
innodb-log-file-size           = 512M
innodb-flush-log-at-trx-commit = 2
innodb-file-per-table          = 1
#innodb-buffer-pool-size        = 12G
innodb-buffer-pool-size        = 20G
innodb-print-all-deadlocks     = ON

# LOGGING #
 log-error                      =  /var/log/error.log

lower-case-table-names         = 1
character-set-client-handshake = FALSE
character-set-server           = utf8mb4
collation-server               = utf8mb4_general_ci

#pxb
[xtrabackup]
target_dir = /etc/backups
1 Like

Hi @AneeshBabu

I see that you have a replication filter on two tables - this could be what is leading to no replication events being applied on the Percona Server for MySQL 8 replica:

1 Like

how do i replicate the 2 tables …? Any solution…?

1 Like

I assume you mean that data from the 2 tables is not present in the replica? Is it possible you are running binlog filters on the primary? check for binlog-do-db…

1 Like

Yes,data from 2 tables are not replicated from master to slave.

running this filter at master — > binlog-ignore-db = mysql
Not using this filter at master — > binlog-do-db

1 Like

The config looks good to me, the tables should be replicating. You can check the binary log contents on the primary with mysqlbinlog tool to make sure the transactions are being logged. Also check that you have the right position when doing the CHANGE MASTER to setup replication.

1 Like