0

This question was formerly: "Mysql replication logs are filling disk and halting server". However, I'm asking the community if there is a command line trace or live log that I could tail -f and see queries being executed on a server.

Background:

We run a Drupal 7 instance on a load balanced set up with a mysql replication between the primary and failover box. I've come in on Mondays to find the failover machine completely full mysql-relay-bin.0000xxxx files.

Problem:

We suspect that something may be perhaps a bit overzealous with database writes and this is getting replicated over. Or, we frankly may have set up replication poorly.

Question:

Is there a utility by which I can tail the various queries that mysql is running on a particular database?

Master my.cnf

$ cat /etc/my.cnf 
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# sync
log-bin=mysql-bin
server-id=1
expire_logs_days = 1
max_binlog_size  = 100M
.
.
.
# sync config
log-bin = /var/log/mysql/mysql-bin.log
binlog_do_db=drupal
server-id=1 

Replicant (Slave) my.cnf

$ cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

server-id=2
master-host=xxx.xx.xx.xxx
master-user=slave_user
master-password=XXXXXXXXXXXXXXX
master-connect-retry=60
replicate-do-db=drupal
slave-skip-errors = 1062,1054
expire_logs_days = 2
max_binlog_size  = 100M
ssl

Drupal specific question asked at: https://drupal.stackexchange.com/questions/145451/

2
  • There is no question being asked and it is a double post from Drupal SE.
    – CharlieRB
    Jan 26 '15 at 20:43
  • Sorry I was editing both questions. I have two questions opened because I'm trying to tackle this from very different domains. If Drupal is not the problem; it may very well be my replication setup. In which case, I'm in need of help from those with a different skill set.
    – Rick
    Jan 26 '15 at 21:11

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.