Guest User

Untitled

a guest
Nov 7th, 2017
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.40 KB | None | 0 0
  1. MariaDB [(none)]> SHOW SLAVE STATUSG
  2. --------------
  3. SHOW SLAVE STATUS
  4. --------------
  5.  
  6. *************************** 1. row ***************************
  7. Slave_IO_State:
  8. Master_Host: 127.0.0.1
  9. Master_User: replication
  10. Master_Port: 1234
  11. Connect_Retry: 60
  12. Master_Log_File: mysql-bin.000289
  13. Read_Master_Log_Pos: 342
  14. Relay_Log_File: mysqld-relay-bin.000002
  15. Relay_Log_Pos: 4
  16. Relay_Master_Log_File: mysql-bin.000289
  17. Slave_IO_Running: No
  18. Slave_SQL_Running: Yes
  19. Replicate_Do_DB: xxx_yyy,xxx_zzz
  20. Replicate_Ignore_DB:
  21. Replicate_Do_Table:
  22. Replicate_Ignore_Table:
  23. Replicate_Wild_Do_Table:
  24. Replicate_Wild_Ignore_Table:
  25. Last_Errno: 0
  26. Last_Error:
  27. Skip_Counter: 0
  28. Exec_Master_Log_Pos: 342
  29. Relay_Log_Space: 248
  30. Until_Condition: None
  31. Until_Log_File:
  32. Until_Log_Pos: 0
  33. Master_SSL_Allowed: No
  34. Master_SSL_CA_File:
  35. Master_SSL_CA_Path:
  36. Master_SSL_Cert:
  37. Master_SSL_Cipher:
  38. Master_SSL_Key:
  39. Seconds_Behind_Master: NULL
  40. Master_SSL_Verify_Server_Cert: No
  41. Last_IO_Errno: 1236
  42. 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'
  43. Last_SQL_Errno: 0
  44. Last_SQL_Error:
  45. Replicate_Ignore_Server_Ids:
  46. Master_Server_Id: 3
  47. Master_SSL_Crl:
  48. Master_SSL_Crlpath:
  49. Using_Gtid: No
  50. Gtid_IO_Pos:
  51. 1 row in set (0.00 sec)
  52.  
  53. root@master [818 18:54:22 /var/lib/mysql]# ls -l /var/lib/mysql/mysql-bin.000289
  54. -rw-rw---- 1 mysql mysql 1074010194 May 19 03:28 /var/lib/mysql/mysql-bin.000289
  55. root@master [819 18:54:29 /var/lib/mysql]# ls mysql-bin.00029*
  56. mysql-bin.000290 mysql-bin.000291 mysql-bin.000292 #(Yes, it was created)
  57. root@master [821 18:56:52 /var/lib/mysql]# mysql -uroot -p
  58. Enter password:
  59. Welcome to the MariaDB monitor. Commands end with ; or g.
  60. Your MariaDB connection id is 6345382
  61. Server version: 10.0.21-MariaDB-log MariaDB Server
  62.  
  63. Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
  64.  
  65. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
  66.  
  67. MariaDB [(none)]> SHOW BINARY LOGS;
  68. +------------------+------------+
  69. | Log_name | File_size |
  70. +------------------+------------+
  71. | mysql-bin.000279 | 1074114047 |
  72. | mysql-bin.000280 | 1074004090 |
  73. | mysql-bin.000281 | 1074035416 |
  74. | mysql-bin.000282 | 1073895128 |
  75. | mysql-bin.000283 | 1073742000 |
  76. | mysql-bin.000284 | 1074219591 |
  77. | mysql-bin.000285 | 1074184547 |
  78. | mysql-bin.000286 | 1074217812 |
  79. | mysql-bin.000287 | 1022733058 |
  80. | mysql-bin.000288 | 265069 |
  81. | mysql-bin.000289 | 1074010194 |
  82. | mysql-bin.000290 | 1074200346 |
  83. | mysql-bin.000291 | 617421886 |
  84. | mysql-bin.000292 | 265028 |
  85. +------------------+------------+
  86. 14 rows in set (0.00 sec)
  87.  
  88. MariaDB [(none)]> exit
  89. Bye
  90. root@master [821 18:57:24 /var/lib/mysql]# mysqlbinlog mysql-bin.000289 > /tmp/somefile.txt
  91. root@master [822 18:58:13 /var/lib/mysql]# tail /tmp/somefile.txt
  92. # at 1074010124
  93. #160519 3:28:59 server id 5 end_log_pos 1074010151 Xid = 417608063
  94. COMMIT/*!*/;
  95. # at 1074010151
  96. #160519 3:28:59 server id 5 end_log_pos 1074010194 Rotate to mysql-bin.000290 pos: 4
  97. DELIMITER ;
  98. # End of log file
  99. ROLLBACK /* added by mysqlbinlog */;
  100. /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
  101. /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
  102. root@master [823 18:58:31 /var/lib/mysql]#
  103.  
  104. # BINARY LOGGING #
  105. log-bin = /var/lib/mysql/mysql-bin
  106. expire-logs-days = 14
  107. sync-binlog = 1
  108.  
  109. root@master [826 12:15:33 /var/lib/mysql]# grep "end_log_pos 342 " /tmp/somefile.txt
  110. #160517 14:43:13 server id 5 end_log_pos 342 Binlog checkpoint mysql-bin.000288
  111.  
  112. Master_Server_Id: 3
  113.  
  114. Master_Host: 127.0.0.1
  115.  
  116. +------------------+------------+
  117. | Log_name | File_size |
  118. +------------------+------------+
  119. | mysql-bin.000279 | 1074114047 |
  120. | mysql-bin.000280 | 1074004090 |
  121. | mysql-bin.000281 | 1074035416 |
  122. | mysql-bin.000282 | 1073895128 |
  123.  
  124. mysql> PURGE BINARY LOGS TO 'mysql-bin.000279';
  125.  
  126. mysql> STOP SLAVE; START SLAVE;
Add Comment
Please, Sign In to add comment