MySQL - MySQL Router
提供: MochiuWiki : SUSE, EC, PCB
概要
MySQL Routerは、MySQL InnoDB ClusterやInnoDB ReplicaSetで使用可能であり、ロードバランスや障害発生時のフェイルオーバーに対応したルーティングを透過的に実現するミドルウェア製品である。

構成
bootstrapによる初期設定の完了後、MySQL Routerの設定ファイル(/etc/mysqlrouter/mysqlrouter.confファイル)には、以下に示すような内容が自動で書き込まれる。
# File automatically generated during MySQL Router bootstrap
[DEFAULT]
name=system
user=mysqlrouter
keyring_path=/var/lib/mysqlrouter/keyring
master_key_path=/etc/mysqlrouter/mysqlrouter.key
connect_timeout=15
read_timeout=30
dynamic_state=/var/lib/mysqlrouter/state.json
[logger]
level = INFO
[metadata_cache:myCluster]
cluster_type=gr
router_id=1
user=mysql_router1_w0dw2zzuwu4c
metadata_cluster=myCluster
ttl=0.5
auth_cache_ttl=-1
auth_cache_refresh_interval=2
use_gr_notifications=0
[routing:myCluster_rw]
bind_address=0.0.0.0
bind_port=6446
destinations=metadata-cache://myCluster/?role=PRIMARY
routing_strategy=first-available
protocol=classic
[routing:myCluster_ro]
bind_address=0.0.0.0
bind_port=6447
destinations=metadata-cache://myCluster/?role=SECONDARY
routing_strategy=round-robin-with-fallback
protocol=classic
[routing:myCluster_x_rw]
bind_address=0.0.0.0
bind_port=64460
destinations=metadata-cache://myCluster/?role=PRIMARY
routing_strategy=first-available
protocol=x
[routing:myCluster_x_ro]
bind_address=0.0.0.0
bind_port=64470
destinations=metadata-cache://myCluster/?role=SECONDARY
routing_strategy=round-robin-with-fallback
protocol=x