40. シングルプライマリモード
• デフォルトではシングルプライマリモー
ド
• 1 ノードが書き込み可能なマスター
(PRIMARY)
• 他はホットスタンバイ (SECONDARY)
+---------------------------------------+-------+
| Variable_name | Value |
+---------------------------------------+-------+
| group_replication_single_primary_mode | ON |
+---------------------------------------+-------+
+----------------------------------------------------+-------+
| Variable_name | Value |
+----------------------------------------------------+-------+
| group_replication_enforce_update_everywhere_checks | OFF |
+----------------------------------------------------+-------+
※ シングルプライマリモードの設定
41. シングルプライマリモード
• Secondary ノードは参照のみ可能
– 書き込んだ場合は、 ERROR 1290 が発生する
S S S S P S
Primary
ERROR 1290 (HY000): The MySQL server is running with the --super-read-only option so it cannot execute this statementERROR 1290 (HY000): The MySQL server is running with the --super-read-only option so it cannot execute this statement
46. マルチマスターモード
• 後からコミットしたトランザクションは
ロールバックされる
46
M M M M M
UPDATE t1 SET a=4 WHERE a=1UPDATE t1 SET a=3 WHERE a=1
OKERROR 1180 (HY000): Got error 149 during
COMMIT
ERROR 1180 (HY000): Got error 149 during
COMMIT
47. アーキテクチャ概要
M M M M M
Com. API
Replication
Plugin
API
MySQL
Server
Group Comm.
System (Corosync)
Group Com. Engine
48. API
Replication
Plugin
API
MySQL
Server
Performance Schema Tables: Monitoring
MySQL
APIs: Lifecycle / Capture / Applier
InnoDB
Replication Protocol
Group Com. API
Group Com. Engine
Network
Plugin
Capture Applier
Conflicts
Handler
Group Comm.
System (Corosync)
Group Com. Engine
Group Com. Binding
Recovery
49.
50. MySQL Router: 2.1
• グループレプリケーション対
応ソフトウェアルータ
– GR 構成を自動判別
– 各メンバーのメタデータを利
用
• 起動時の GR の設定を取得
• アプリケーションから接続
– バックエンド構成の考慮不要
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
51. MySQL Shell
開発と運用管理の作業と統合した新クライアントプログラム
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
•複数の言語利用可能 :
JavaScript, Python, SQL
•ドキュメントと
リレーショナルモデル両対応
•開発用 API と管理用 API
52. MySQL Shell: Admin API
• mysql-js> dba.help()
• MySQL AdminAPI アクセス用
グローバル変数 'dba'
• DBA 管理作業
– GR の構成作成および確認
– インスタンスの起動停止
データベース管理用 API
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
Group Replication is a plugin and uses a service interface to access the server such as a logging interface and a sql interface, etc. The execution flow is transfered to the plugin through extension points or callbacks.
Underneath there is a group communication system which is responsible for propagating messages, for example transactions, to all members.
MySQL Group Replication is tigthly integrated with the server which means that it will keep evolving. For example, several information on Group Replication is exposed through performance schema tables and more things will be eventually added.
The interface between the sever and the plugin is very neat and clean. During transaction execution there is no interaction among remote members: changes are locally executed and captured. Upon commit control is transfered to the plugin which propagates the changes to remote members. Upon delivery, each replica verifies whether the changes conflict with any other concurrent change that was previously delivered. If there is no conflict, their are applied and the transaction is committed. Otherwise, the transaction is aborted and ignored on remote members.
The MySQL Shell is intended as a general purpose scriptable management frontend
for MySQL. The AdminAPI provides InnoDB clusters management functionality over the
Shell. Within the context of MySQL HA, it can be used for:
* Install the metadata schema
* Update the metadata schema from the actual state of the replicaset
* Perform remote provisioning of MySQL instances for GR via SSH, acting as a
remote frontend for mysqlprovision (start a replicaset, add instances to
a replicaset etc)
In the future, it will also allow management of sharding related functionality.