How to delete relay-bin files

I need to delete/purge relay-bin files from mysql server. We don’t have any space left. We are not sure if we can delete the old relay-bin files or not. Looking for adivse on what is the best approach to delete/purge the files that has filled up the server space.
Here are the mysql db details

innodb_version: 5.5.33-rel31.1
protocol_version: 10
slave_type_conversions:
version: 5.5.33-31.1-log
version_comment: Percona Server (GPL), Release rel31.1, Revision 566
version_compile_machine: x86_64
version_compile_os: Linux

Regards
Anil

1 Like

@amereddy relay_logs are automatically purged after they have been processed by the SQL_thread. How is your replication lag? You can use STOP SLAVE; RESET SLAVE; START SLAVE; to delete the relay logs. Any needed logs will be re-downloaded from the master.

2 Likes

Thanks Matt. I have master(mysb02) and slave(mysdb04). The slave is down as it is 100% full and we could not add anymore space to /var mount. I can’t even start mysql service to execute the commands you have suggested. Is there anything else that I can do ?

Regards
Anil

1 Like

At that point you can just remove the relay logs manually. When you start mysql, slave status will be invalid, but you can just restart it.

1 Like

Thansk Matt. Is there is particular sequence I need to remove the relay logs ? I can safely start deleting the oldest one and go from there right ?

Regards
Anil

1 Like

Just delete them all. When you get mysql back up, just stop slave; start slave; and it should re-download any missing relay logs.

1 Like

Thanks Matt. that cleaned up the log files. Another question, I see is that

Slave_IO_State: waiting from master to send event
slave_io_running: yes
slave_sql_running: no

Not sure if I need to set anything or wait

Regards
Anil

1 Like

you need to stop slave; reset slave; start slave;

1 Like

Matt, Those are the commands I ran from your earlier suggestion.
Regards
Anil

1 Like

If you have this, then replication is not working and you need to see what the error is.

1 Like