「MySQL - MySQL Router」の版間の差分
提供: MochiuWiki : SUSE, EC, PCB
細 文字列「__FORCETOC__」を「{{#seo: |title={{PAGENAME}} : Exploring Electronics and SUSE Linux | MochiuWiki |keywords=MochiuWiki,Mochiu,Wiki,Mochiu Wiki,Electric Circuit,Electric,pcb,Mathematics,AVR,TI,STMicro,AVR,ATmega,MSP430,STM,Arduino,Xilinx,FPGA,Verilog,HDL,PinePhone,Pine Phone,Raspberry,Raspberry Pi,C,C++,C#,Qt,Qml,MFC,Shell,Bash,Zsh,Fish,SUSE,SLE,Suse Enterprise,Suse Linux,openSUSE,open SUSE,Leap,Linux,uCLnux,Podman,電気回路,電子回路,基板,プリント基板 |description={{PAGENAME}} - 電子回路とSUSE Linuxに関する情報 | This pag… |
|||
| 82行目: | 82行目: | ||
<br><br> | <br><br> | ||
{{#seo: | |||
|title={{PAGENAME}} : Exploring Electronics and SUSE Linux | MochiuWiki | |||
|keywords=MochiuWiki,Mochiu,Wiki,Mochiu Wiki,Electric Circuit,Electric,pcb,Mathematics,AVR,TI,STMicro,AVR,ATmega,MSP430,STM,Arduino,Xilinx,FPGA,Verilog,HDL,PinePhone,Pine Phone,Raspberry,Raspberry Pi,C,C++,C#,Qt,Qml,MFC,Shell,Bash,Zsh,Fish,SUSE,SLE,Suse Enterprise,Suse Linux,openSUSE,open SUSE,Leap,Linux,uCLnux,Podman,電気回路,電子回路,基板,プリント基板 | |||
|description={{PAGENAME}} - 電子回路とSUSE Linuxに関する情報 | This page is {{PAGENAME}} in our wiki about electronic circuits and SUSE Linux | |||
|image=/resources/assets/MochiuLogo_Single_Blue.png | |||
}} | |||
__FORCETOC__ | __FORCETOC__ | ||
[[カテゴリ:MySQL]] | [[カテゴリ:MySQL]] | ||
2024年11月10日 (日) 15:54時点における最新版
概要
MySQL Routerは、MySQL InnoDB ClusterやInnoDB ReplicaSetで使用可能であり、ロードバランスや障害発生時のフェイルオーバーに対応したルーティングを透過的に実現するミドルウェア製品である。

MySQL InnoDB Cluster
MySQL InnoDB Clusterは、アプリケーションからのルーティングも含めたフルスタックなHAソリューションである。
MySQL InnoDB Clusterは、以下に示す複数のコンポーネントをまとめた名称であり、それ自体が1つの製品ではない。
コンポーネント同士が強く結びついて動作させることが前提のため、サードパーティ製品を導入する際に組み合わせにより発生するトラブルに悩まされることもなく、汎用的なツールにありがちな複雑な設定から解放される。
- MySQL Group Replication (MySQLデータベースサーバ)
- MySQL Router (接続ルーティング)
- MySQL Shell (mysqlコマンド拡張)

必須環境
- Python
- Python 2.7が必要となる。
- MySQL Shellでは、以下に示すコマンドでPythonが実行されるため、複数のPythonがインストールされている環境では、Python 2.7が実行されるように変更する必要がある。
/usr/bin/env python
- 名前解決
- MySQL Group Replicationで各MySQLサーバ間はホスト名を使用して接続するため、名前解決できるようにhostsやDNSの設定が必要である。
構成
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