gh-ost
has been updated to work with Amazon RDS however due to GitHub not using AWS for databases, this documentation is community driven so if you find a bug please open an issue!
SUPER
privileges.gh-ost
runs should be setup use --assume-rbr
and use binlog_format=ROW
.read_only
parameter. While it is defined as {TrueIfReplica}
, the parameter is non-modifiable field.In Aurora replication, you have separate reader and writer endpoints however because the cluster shares the underlying storage layer, gh-ost
will detect it is running on the master. This becomes an issue when you wish to use migrate/test on replica because you won't be able to use a single cluster in the same way you would with MySQL RDS.
To work around this, you can follow along the AWS replication between clusters documentation for Aurora with one small caveat. For the "Create a Snapshot of Your Replication Master" step, the binlog position is not available in the AWS console. You will need to issue the SQL query SHOW SLAVE STATUS
or aws rds describe-events
API call to get the correct position.
If you use pt-table-checksum
as a part of your data integrity checks, you might want to check out this patch which will enable you to run pt-table-checksum
with the --no-binlog-format-check
flag and prevent errors like the following:
03-24T12:51:06 Failed to /*!50108 SET @@binlog_format := 'STATEMENT'*/: DBD::mysql::db do failed: Access denied; you need (at least one of) the SUPER privilege(s) for this operation [for Statement "/*!50108 SET @@binlog_format := 'STATEMENT'*/"] at pt-table-checksum line 9292.
This tool requires binlog_format=STATEMENT, but the current binlog_format is set to ROW and an error occurred while attempting to change it. If running MySQL 5.1.29 or newer, setting binlog_format requires the SUPER privilege. You will need to manually set binlog_format to 'STATEMENT' before running this tool.
In Aurora, the binlog filtering feature is enabled by default. This becomes an issue when gh-ost tries to do the cut-over, because gh-ost waits for an entry in the binlog to proceed but this entry will never end up in the binlog because it gets filtered out by the binlog filtering feature.
You need to turn this feature off during the migration process.
Set the aurora_enable_repl_bin_log_filtering
parameter to 0 in the Parameter Group for your cluster.
When the migration is done, set it back to 1 (default).
Before trying to run any gh-ost
migrations you will want to confirm the following:
SHOW SLAVE STATUS\G
on your replica cluster displays the correct master host, binlog position, etc.hooks
to issue RDS procedures for stopping and starting replication. (see github/gh-ost#163 for examples)aurora_enable_repl_bin_log_filtering
is set to 0此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。