3.(MySQL Router+MGR)MySQL Router安装与配置

5. Using MySQL Router with InnoDB Cluster

--bootstrap

5.1 生成MySQL Router配置文件

[root@wn19testcdb1001 ~]# mysqlrouter --bootstrap root@192.168.136.128:13306 --directory /root/mysqlrouter --user=root --conf-use-sockets --force
Please enter MySQL password for root: 
WARNING: The MySQL server does not have SSL configured and metadata used by the router may be transmitted unencrypted.

Bootstrapping MySQL Router instance at '/root/mysqlrouter'...
Checking for old Router accounts
Creating account mysql_router10_zdwlsgpzi879@'%'
MySQL Router  has now been configured for the InnoDB cluster 'testCluster'.

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/Write Connections: /root/mysqlrouter/mysql.sock
- Read/Only Connections: localhost:6447
- Read/Only Connections: /root/mysqlrouter/mysqlro.sock

X protocol connections to cluster 'testCluster':
- Read/Write Connections: localhost:64460
- Read/Write Connections: /root/mysqlrouter/mysqlx.sock
- Read/Only Connections: localhost:64470
- Read/Only Connections: /root/mysqlrouter/mysqlxro.sock

查看mysqlrouter配置文件:/etc/mysqlrouter/mysqlrouter.conf

[root@wn19testcdb1001 mysqlrouter]# cat mysqlrouter.conf 
# File automatically generated during MySQL Router bootstrap
[DEFAULT]
user=root
logging_folder=/root/mysqlrouter/log
runtime_folder=/root/mysqlrouter/run
data_folder=/root/mysqlrouter/data
keyring_path=/root/mysqlrouter/data/keyring
master_key_path=/root/mysqlrouter/mysqlrouter.key
connect_timeout=30
read_timeout=30

[logger]
level = INFO

[metadata_cache:testCluster]
router_id=10
bootstrap_server_addresses=mysql://wn19testcdb1001:13306,mysql://wn19testcdb1002:13306,mysql://wn19testcdb1003:13306
user=mysql_router10_zdwlsgpzi879
metadata_cluster=testCluster
ttl=0.5

[routing:testCluster_default_rw]
bind_address=0.0.0.0
bind_port=6446
socket=/root/mysqlrouter/mysql.sock
destinations=metadata-cache://testCluster/default?role=PRIMARY
routing_strategy=round-robin
protocol=classic

[routing:testCluster_default_ro]
bind_address=0.0.0.0
bind_port=6447
socket=/root/mysqlrouter/mysqlro.sock
destinations=metadata-cache://testCluster/default?role=SECONDARY
routing_strategy=round-robin
pr
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值