This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-15. For the latest, interactive version please visit https://mariadb.com/kb/.

only saved the latest 2 binary log files

Hi, I met strange thing, please help to check, thanks very much. I not configured expire_logs_days at configuration file /etc/my.cnf.d/server.cnf, and get value=0 (default) thru checking “show variables like 'expire_logs_days';” why only saved the latest 2 binary log files if master and salve sync normal ? and why all binary log files will always be saved if replication error happen ?

MariaDB [(none)]> status -------------- mysql Ver 15.1 Distrib 10.3.11-MariaDB, for Linux (x86_64) using readline 5.1

MariaDB [(none)]> show variables like '%log_bin%'; +---------------------------------+----------------------------------------------+

Variable_nameValue

+---------------------------------+----------------------------------------------+

log_binON
log_bin_basename/appdata/mysql/xxxx-0-bin
log_bin_compressOFF
log_bin_compress_min_len256
log_bin_index/appdata/mysql/xxxx-0-bin.index
log_bin_trust_function_creatorsOFF
sql_log_binON

+---------------------------------+----------------------------------------------+ 7 rows in set (0.003 sec)

MariaDB [(none)]> show master status\G; ***** 1. row ***** File: xxxx-0-bin.000003 Position: 84488115 Binlog_Do_DB: Binlog_Ignore_DB: 1 row in set (0.002 sec)

ERROR: No query specified

MariaDB [(none)]> show binary logs\G; ***** 1. row ***** Log_name: xxxx-0-bin.000002 File_size: 1073741902 ***** 2. row ***** Log_name: xxxx-0-bin.000003 File_size: 84545824 2 rows in set (0.003 sec)

ERROR: No query specified

MariaDB [(none)]>

[root@xxxx-0 ]# ls -l /appdata/mysql/ total 1341236 ...... -rw-rw----. 1 mysql mysql 1073741902 Feb 22 05:25 xxxx-0-bin.000002 -rw-rw----. 1 mysql mysql 106483175 Feb 22 11:39 xxxx-0-bin.000003 -rw-rw----. 1 mysql mysql 66 Feb 22 11:15 xxxx-0-bin.index ...... [root@xxxx-0 ]# [root@xxxx-0 ]# cd /appdata/mysql/ [root@xxxx-0 mysql]# cat xxxx-0-bin.index ./xxxx-0-bin.000002 ./xxxx-0-bin.000003 [root@xxxx-0 mysql]#

br David

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.