mgr-router

配置环境变量

export PATH=$PATH:/usr/local/mysql-shell/bin/:/usr/local/mysql/bin/:/usr/local/mysql-router/bin
source /etc/profile

配置mysqlrouter

[root@mysql_m bin]# ./mysqlrouter --bootstrap mgr@mysql_m:3306 -d myrouter --user=ro
otPlease enter MySQL password for mgr: 
# Bootstrapping MySQL Router instance at '/usr/local/mysql-router/bin/myrouter'...

- Creating account(s) (only those that are needed, if any)
- Verifying account (using it to run SQL queries that would be run by Router)
- Storing account in keyring
- Adjusting permissions of generated files
- Creating configuration /usr/local/mysql-router/bin/myrouter/mysqlrouter.conf

# MySQL Router configured for the InnoDB Cluster 'mycluster'

After this MySQL Router has been started with the generated configuration

    $ ./mysqlrouter -c /usr/local/mysql-router/bin/myrouter/mysqlrouter.conf

InnoDB Cluster 'mycluster' can be reached by connecting to:

## MySQL Classic protocol

=================================================================================
[root@mysql_s1 bin]# ./mysqlrouter --bootstrap mgr@mysql_s1:3306 -d myrouter --user=root
Please enter MySQL password for mgr: 
# Reconfiguring MySQL Router instance at '/usr/local/mysql-router/bin/myrouter'...

- Fetching password for current account (mysql_router1_a51yps5zlikm) from keyring
- Creating account(s) (only those that are needed, if any)
Fetching Cluster Members
trying to connect to mysql-server at mysql_m:3306
- Creating account(s) (only those that are needed, if any)
- Using existing certificates from the '/usr/local/mysql-router/bin/myrouter/data' directory
- Verifying account (using it to run SQL queries that would be run by Router)
- Storing account in keyring
- Adjusting permissions of generated files
- Creating configuration /usr/local/mysql-router/bin/myrouter/mysqlrouter.conf

# MySQL Router configured for the InnoDB Cluster 'mycluster'

After this MySQL Router has been started with the generated configuration

    $ ./mysqlrouter -c /usr/local/mysql-router/bin/myrouter/mysqlrouter.conf

InnoDB Cluster 'mycluster' can be reached by connecting to:

## MySQL Classic protocol

=======================================================================================
[root@mysql_s2 bin]# ./mysqlrouter --bootstrap mgr@mysql_s2:3306 -d myrouter --user=root
Please enter MySQL password for mgr: 
# Bootstrapping MySQL Router instance at '/usr/local/mysql-router/bin/myrouter'...

Fetching Cluster Members
trying to connect to mysql-server at mysql_m:3306
- Creating account(s) (only those that are needed, if any)
- Verifying account (using it to run SQL queries that would be run by Router)
- Storing account in keyring
- Adjusting permissions of generated files
- Creating configuration /usr/local/mysql-router/bin/myrouter/mysqlrouter.conf

# MySQL Router configured for the InnoDB Cluster 'mycluster'

After this MySQL Router has been started with the generated configuration

    $ ./mysqlrouter -c /usr/local/mysql-router/bin/myrouter/mysqlrouter.conf

InnoDB Cluster 'mycluster' can be reached by connecting to:

## MySQL Classic protocol

启动mysql-route

[root@mysql_m bin]# ls
myrouter  mysqlrouter  mysqlrouter_keyring  mysqlrouter_passwd	mysqlrouter_plugin_info
[root@mysql_m bin]# myrouter/start.sh
[root@mysql_m bin]# PID 1637 written to '/usr/local/mysql-router/bin/myrouter/mysqlrouter.pid'
stopping to log to the console. Continuing to log to filelog
====================================
[root@mysql_s1 bin]# myrouter/start.sh
[root@mysql_s1 bin]# PID 1373 written to '/usr/local/mysql-router/bin/myrouter/mysqlrouter.pid'
stopping to log to the console. Continuing to log to filelog
=========================================
[root@mysql_s2 bin]# myrouter/start.sh
[root@mysql_s2 bin]# PID 2556 written to '/usr/local/mysql-router/bin/myrouter/mysqlrouter.pid'
stopping to log to the console. Continuing to log to filelog

查看route进程:

ps -ef|grep myroute 
netstat -tunlp|grep (route的pid)

a) 管理节点本机mysql-shell连接:
mysqlsh --uri root@localhost:6446
b) 管理节点本机mysql连接:
mysql -u root -h 127.0.0.1 -P 6446 -p
c) 远程客户机通过route连接mysql
mysql -u root -h manager_ip -P 6446 -p

server_uuid通过发出以下命令, 传递要成为组新主成员的成员的: SELECT group_replication_set_as_primary(member_uuid);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

韶博雅

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值