Linux
輪換 binlog 後 MySQL 複製關閉
我有以下問題。我已經成功設置了主副本(基於行)。它已經執行了2-3個小時。bin-log 旋轉後 -> mysql-bin.index 文件在 master 上損壞。
這是顯示主日誌;
顯示主日誌\G
*************************** 1. row *************************** Log_name: mysql-bin.000001 File_size: 27682022 *************************** 2. row *************************** Log_name: mysqld Ver 5.1.73-5-beget-log for debian-linux-gnu on x86_64 ((LTD BeGet)) File_size: 0 *************************** 3. row *************************** Log_name: or its affiliates File_size: 0 *************************** 4. row *************************** Log_name: or its affiliates. All rights reserved. File_size: 0 4 rows in set (0.00 sec)
master上mysql的配置文件:
cat /etc/mysql/my.cnf | grep -v -E "^$" | grep -v -E "^#" [mysqld] event_scheduler = 1 interactive_timeout = 30 set-variable = wait_timeout=30 user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /home/mysql tmpdir = /home/tmpfs server_id = 1 log-bin = mysql-bin binlog-do-db = somedb binlog-format = row skip-external-locking bind-address = 0.0.0.0 default-character-set = UTF8 innodb_file_per_table = 1 max_allowed_packet = 128M thread_stack = 512K thread_cache_size = 64 myisam-recover = BACKUP thread_concurrency = 48 max_user_connections = 100 max_connections = 200 back_log = 500 join_buffer_size = 4M read_buffer_size = 4M read_rnd_buffer_size = 8M sort_buffer_size = 4M myisam_sort_buffer_size = 512M query_cache_limit = 4M query_cache_size = 128M tmp_table_size = 5000M max_heap_table_size = 5000M key_buffer = 128M max_connect_errors = 65000 max_error_count = 65000 key_buffer_size = 102M open_files_limit = 1040000 table_open_cache = 10000 table_definition_cache = 100000
mysql-bin.index 文件包含 mysqld –help 的輸出
顯示從屬狀態有以下錯誤:
Master_Log_File: mysql-bin.000002 Read_Master_Log_Pos: 4 Relay_Log_File: mysqld-relay-bin.000003 Relay_Log_Pos: 152 Relay_Master_Log_File: mysql-bin.000002 Last_IO_Errno: 1236 Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file' Last_SQL_Errno: 0 Last_SQL_Error:
mysql版本:
mysql -V mysql Ver 14.14 Distrib 5.1.73, for debian-linux-gnu (x86_64) using readline 5.1
我在錯誤日誌中沒有發現任何奇怪的東西。其實我不知道如何調試這個。任何幫助將不勝感激。
好的,回答我自己的問題。這是我們在 MySQL 伺服器中發現的一個錯誤。簡單來說,我們有 nagios 檢查,看起來像
mysqld –verbose –help 2>&1 >&-
好的,問題來了,標準輸出已關閉。mysql 將輸出列印到之前打開的索引文件中。
我們為此案例打開了錯誤: https ://bugs.launchpad.net/percona-server/+bug/1401547
修復很簡單,只需刪除 >&-,所以我們沒有關閉標準輸出,但它仍然是奇怪的行為。