0

Apologize for my English. I'm very new to database administration. I've been trying to set up MariaDB replication server by following this document.

The only data that I need to replicate is in a table called

mysql.general_log

Basically all I want is that my replica server has the same data that my master server has in

mysql.general_log

here is my setting in a master server.

log-bin = /var/log/mysql-bin.log
server_id=1
log-basename=master1
binlog-format=mixed
bind-address        =  my public IP address
binlog_do_db=mysql
binlog_do_db=test2

and here is my setting slave server

during my #1st attempt, I used this setting.

server-id = 2
replicate_do_table=mysql.general_log

#2nd attempt

server-id = 2
replicate_do_db = mysql

#3rd attempt

server-id = 2
replicate_rewrite_db = mysql->mysql_archived

and here is my slave server status

MariaDB [(none)]> show slave status\G;
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: my master IP address
                  Master_User: ds_slave
                  Master_Port: 3306
                Connect_Retry: 10
              Master_Log_File: master1-bin.000004
          Read_Master_Log_Pos: 329
               Relay_Log_File: mysqld-relay-bin.000029
                Relay_Log_Pos: 619
        Relay_Master_Log_File: master1-bin.000004
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 329
              Relay_Log_Space: 1208
              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: 1
               Master_SSL_Crl:
           Master_SSL_Crlpath:
                   Using_Gtid: No
                  Gtid_IO_Pos:
      Replicate_Do_Domain_Ids:
  Replicate_Ignore_Domain_Ids:
                Parallel_Mode: conservative
1 row in set (0.00 sec)

all of these configurations don't work on mysql.general_log table but works fine on other tables. any ideas for solutions or workaround? I've been frustrating for 3 days :( :(

Thank you for your help.

  • I would hope that the general and slow logs are not replicated -- after all, each server is potentially generating its own information for those logs. What is your ultimate goal? Maybe we can help you find a workaround. – Rick James Jan 6 at 17:42
  • Thank you for your reply basically, my general_log table is growing so fast. and I have limited space in my cloud hard drive. So, I need somewhere else to store those data and clear out my general_log table. So, I chose replication because (1)It is easy to start/stop synchronization by use SET sql_log_bin = 0 or 1. and clear out the data in master. and (2) I'll need to access those data later to analyze my application performance. – tanawat yakit Jan 6 at 18:03
  • The general log does grow fast. The slowlog does not, and it provides a much better view into performance. Use long_query_time=1. See pt-query-digest for a summarization tool. – Rick James Jan 6 at 21:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.