patternsqlMinor
Amazon RDS mysqbinlog "Could not find first log file name in binary log index file"
Viewed 0 times
indexfilemysqbinloglogcouldamazonfirstnamebinaryfind
Problem
Preamble:
We use RDS at AWS to manage our MySQL database. I know that RDS creates binary logs used for replication..
I want to harvest these binary logs and store them on S3, so that at any time, i can restore to an off-site database and replay the actions.
The Problem:
I span up a new RDS instance, and tried the following.
So the binary log retrieves fine, however see the Error within the binary log..
What does this mean?
I googled for about 2 days and could find no mention of this error [anywhere].
My questions:
PS: this is happening for the production DB and this test DB
PS2: I note that this is not directly a programming question, however is related to it. Please do not move/close from SO to somewhere like serverfault. Thanks
Update 2/4/2014:
```
mysql> show binary logs;
+----------------------------+-----------+
| Log_name | File_size |
+----------------------------+-----------+
| mysql-bin-changelog.000002 | 1097 |
| mysql-bin-changelog.000003 | 469 |
| mysql-bin-changelog.000004 | 469 |
| mysql-bin-changelog.000005 | 594 |
| mysql-bin-changelog.000006 | 715 |
| m
We use RDS at AWS to manage our MySQL database. I know that RDS creates binary logs used for replication..
I want to harvest these binary logs and store them on S3, so that at any time, i can restore to an off-site database and replay the actions.
The Problem:
I span up a new RDS instance, and tried the following.
root@aws_test_server:/root# mysqlbinlog -h testing.xxxxxxxx.eu-west-1.rds.amazonaws.com -u myuser -p --read-from-remote-server -t mysql-bin-changelog.000002
Enter password:
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ERROR: Got error reading packet from server: Could not find first log file name in binary log index file
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
root@aws_test_server:/root#So the binary log retrieves fine, however see the Error within the binary log..
What does this mean?
I googled for about 2 days and could find no mention of this error [anywhere].
My questions:
- Is this a good idea? (backing up binary logs to S3..)
- Can it be done in a better way? (~infinite point-in-time db recovery)
- What can I do about the error?
PS: this is happening for the production DB and this test DB
PS2: I note that this is not directly a programming question, however is related to it. Please do not move/close from SO to somewhere like serverfault. Thanks
Update 2/4/2014:
SHOW BINARY LOGS;```
mysql> show binary logs;
+----------------------------+-----------+
| Log_name | File_size |
+----------------------------+-----------+
| mysql-bin-changelog.000002 | 1097 |
| mysql-bin-changelog.000003 | 469 |
| mysql-bin-changelog.000004 | 469 |
| mysql-bin-changelog.000005 | 594 |
| mysql-bin-changelog.000006 | 715 |
| m
Solution
You are mistaken in your assertion that "the binary log retrieves fine." The output you are seeing is boilerplate output from mysqlbinlog... there's no evidence here that you are actually fetching the binlog. There's no such log file on the server. That's the meaning of this error.
...to find the available logs on the server.
You can confirm that you are not in fact actually fetching a file, by passing a completely bogus binlog file name and I suspect the output will be the same.
Backing up binlogs is an excellent plan, but you should look into the
SHOW BINARY LOGS;...to find the available logs on the server.
You can confirm that you are not in fact actually fetching a file, by passing a completely bogus binlog file name and I suspect the output will be the same.
Backing up binlogs is an excellent plan, but you should look into the
--stop-never option that, if I recall correctly, was introduced in the version of mysqlbinlog that shipped with MySQL Server 5.6 (backwards compatible with all 5.x servers) and maintains a connection to the server and fetches the files, saving each one under its own name.Code Snippets
SHOW BINARY LOGS;Context
StackExchange Database Administrators Q#62285, answer score: 4
Revisions (0)
No revisions yet.