# mysqlsh -uroot -h MySQL1 MySQL JS> cluster = dba.createCluster('testcluster') A new InnoDB cluster will be created on instance '[email protected]:3306'. MySQL JS> cluster.addInstance('[email protected]') MySQL JS> cluster.addInstance('[email protected]') MySQL JS> cluster.status() ~省略~ "primary": "MySQL1:3306", ~省略~
InnoDB Clusterの例(シングルプライマリ) MySQL Router初期設定で先ほどプライマリになっていたDBに接続する
接続するための情報が表示される
# mysqlrouter --bootstrap [email protected] --user=mysqlrouter The following connection information can be used to connect to the cluster after MySQL Router has been started with generated configuration.. Classic MySQL protocol connections to cluster 'testcluster': - Read/Write Connections: localhost:6446 - Read/Only Connections: localhost:6447 ~省略~
# mysqlsh -uroot -h MySQL1 MySQL JS> dba.createReplicaSet("repl1") A new replicaset with instance 'MySQL1:3306' will be created. MySQL JS> dba.getReplicaSet().addInstance("[email protected]:3306”) MySQL JS> dba.getReplicaSet().addInstance("[email protected]:3306”)
CLONE実行 MYSQL1,2> INSTALL PLUGIN clone SONAME 'mysql_clone.so' MYSQL1,2> CREATE USER [email protected]"%" IDENTIFIED BY 'pass'; MYSQL1,2> GRANT BACKUP_ADMIN ON *.* TO [email protected]"%"; MySQL2> SET GLOBAL clone_valid_donor_list = 'MySQL1:3306'; MySQL2> CLONE INSTANCE FROM [email protected]:3306 IDENTIFIED BY 'pass';
Last_SQL_Error: Error 'Character set '#255' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file' on query. Default database: 'test'. Query: 'BEGIN’ default_authentication_pluginを変更していないと8.0→5.7でレプリエラー Error 'Plugin 'caching_sha2_password' is not loaded' on query. Default database: ''. Query: 'CREATE USER 'hoge'@'10.%.%.%' IDENTIFIED WITH 'caching_sha2_password' AS '$A$005$6R\'Cg;SVYYu*
https://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.MySQL80.html#Aurora.AuroraMySQL.Compare-80- v3 Aurora MySQL v3とMySQL8.0の違い(の一部)
参考資料 MySQL 8.0: InnoDB now supports Instant ADD COLUMN Aurora.VersionPolicy.MajorVersionLifetime 塩漬けにしている MySQL 8.0.xxをバージョンアップしたくなる、ここ数年での MySQL 8.0の改善点 / MySQL Update 202208 MySQL Shellを使ってもっと楽をしようの会 Aurora MySQL long-term support (LTS) releases MySQL 8.0 で追加、非推奨または削除されたサーバーおよびステータスの変数とオプション Aurora MySQL バージョン 2 と 3 の特徴の違い Use the TempTable storage engine on Amazon RDS for MySQL and Amazon Aurora MySQL New temporary table behavior in Aurora MySQL version 3 MySQLのEXPLAIN ANALYZEの読み方を勉強したよ