首页 > 数据库 >MySQL 8.0.32 InnoDB ReplicaSet 配置和手动切换

MySQL 8.0.32 InnoDB ReplicaSet 配置和手动切换

时间:2023-12-23 15:11:35浏览次数:40  
标签:status 8.0 ReplicaSet 32 localhost MySQL 3306 mytest4 mytest3

1.环境准备

主库:192.168.137.4 mytest3
从库:192.168.137.5 mytest4
MySQL: 8.0.32

2.配置 ReplicaSet 实例

启动 mysql shell

# mysqlsh --uri root@localhost --socket=/abce/mysql_data/mysql.sock
MySQL Shell 8.0.32

Copyright (c) 2016, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.

Type '\help' or '\?' for help; '\quit' to exit.
Creating a Classic session to 'root@/abce%2Fmysql_data%2Fmysql.sock'
Fetching schema names for auto-completion... Press ^C to stop.
Your MySQL connection id is 9
Server version: 8.0.32-24 Percona Server (GPL), Release 24, Revision e5c6e9d2
No default schema selected; type \use <schema> to set one.
 MySQL  localhost  JS > 

配置实例

这里会新建专门用于管理 ReplicaSet 的账号。过程需要用户手动输入,会自动修改一些 ReplicaSet 需要的参数配置。

 MySQL  localhost  JS > dba.configureReplicaSetInstance()
The instance 'mytest3:3306' belongs to an InnoDB ReplicaSet.
Configuring local MySQL instance listening at port 3306 for use in an InnoDB ReplicaSet...

This instance reports its own address as mytest3:3306
Clients and other cluster members will communicate with it through this address by default. If this is not correct, the report_host MySQL system variable should be changed.

ERROR: User 'root' can only connect from 'localhost'. New account(s) with proper source address specification to allow remote connection from all instances must be created to manage the cluster.

1) Create remotely usable account for 'root' with same grants and password
2) Create a new admin account for InnoDB ReplicaSet with minimal required grants
3) Ignore and continue
4) Cancel

Please select an option [1]: 2
Please provide an account name (e.g: icroot@%) to have it created with the necessary
privileges or leave empty and press Enter to cancel.
Account Name: rsadmin@%
Password for new account: *********
Confirm password: *********

applierWorkerThreads will be set to the default value of 4.

NOTE: Some configuration options need to be fixed:
+----------------------------------------+---------------+----------------+----------------------------+
| Variable                               | Current Value | Required Value | Note                       |
+----------------------------------------+---------------+----------------+----------------------------+
| binlog_transaction_dependency_tracking | COMMIT_ORDER  | WRITESET       | Update the server variable |
+----------------------------------------+---------------+----------------+----------------------------+

Do you want to perform the required configuration changes? [y/n]: y
Configuring instance...
The instance 'mytest3:3306' was configured to be used in an InnoDB ReplicaSet.
 MySQL  localhost  JS > 

更新的参数会被持久化写入文件 mysqld-auto.cnf 中,放在 mysql 的数据目录下。

# more mysqld-auto.cnf
{"Version": 2, "mysql_static_variables": {"slave_parallel_workers": {"Value": "4", "Metadata": {"Host": "localhost", "User": "root", "Timestamp": 1703209767354675}}, "replica_parallel_workers": {"Value": "4", "Metadata": {"Host": "localhost", "User": "root
", "Timestamp": 1703209767354675}}}, "mysql_dynamic_variables": {"binlog_transaction_dependency_tracking": {"Value": "WRITESET", "Metadata": {"Host": "localhost", "User": "root", "Timestamp": 1703209767357369}}}}
#

要确保这一步骤在所有节点上都执行成功。集群的管理账号要在所有节点上都一致。

执行完上面的操作,mysql 实例会自动重启,让配置生效。当然也可以提前就创建要一个专门的用户,按照后面的操作步骤完成后续工作。

3.切换到新建的集群管理用户

 MySQL  localhost  JS > \connect rsadmin@mytest3
Creating a session to 'rsadmin@mytest3'
Please provide the password for 'rsadmin@mytest3': *********
Save password for 'rsadmin@mytest3'? [Y]es/[N]o/Ne[v]er (default No): y
Fetching schema names for auto-completion... Press ^C to stop.
Closing old connection...
Your MySQL connection id is 12 (X protocol)
Server version: 8.0.32-24 Percona Server (GPL), Release 24, Revision e5c6e9d2
No default schema selected; type \use <schema> to set one.
 MySQL  mytest3:33060+ ssl  JS > 

4.创建 ReplicaSet

 MySQL  mytest3:33060+ ssl  JS > dba.createReplicaSet('MyReplicaSet')
A new replicaset with instance 'mytest3:3306' will be created.

* Checking MySQL instance at mytest3:3306

This instance reports its own address as mytest3:3306
mytest3:3306: Instance configuration is suitable.

* Updating metadata...

ReplicaSet object successfully created for mytest3:3306.
Use rs.addInstance() to add more asynchronously replicated instances to this replicaset and rs.status() to check its status.

<ReplicaSet:MyReplicaSet>
 MySQL  mytest3:33060+ ssl  JS >

5.检查 ReplicaSet 的状态

 MySQL  mytest3:33060+ ssl  JS >  replicaset = dba.getReplicaSet()
You are connected to a member of replicaset 'MyReplicaSet'.
<ReplicaSet:MyReplicaSet>
 MySQL  mytest3:33060+ ssl  JS > 
 MySQL  mytest3:33060+ ssl  JS > replicaset.status()
{
    "replicaSet": {
        "name": "MyReplicaSet", 
        "primary": "mytest3:3306", 
        "status": "AVAILABLE", 
        "statusText": "All instances available.", 
        "topology": {
            "mytest3:3306": {
                "address": "mytest3:3306", 
                "instanceRole": "PRIMARY", 
                "mode": "R/W", 
                "status": "ONLINE"
            }
        }, 
        "type": "ASYNC"
    }
}
 MySQL  mytest3:33060+ ssl  JS >

6.增加从节点

添加新节点有两种方式:

(1)clone:使用在线实例快照做克隆,对于全新安装方式推荐使用这种。如果 DNS 配置不正确,或者 hosts 文件没有配置,克隆会失败。

(2)增量:依赖 mysql 的复制和日志应用,如果事务比较少,这种方式会比较快

 MySQL  mytest3:33060+ ssl  JS > replicaset.addInstance('mytest4:3306')
Adding instance to the replicaset...

* Performing validation checks

This instance reports its own address as mytest4:3306
mytest4:3306: Instance configuration is suitable.

* Checking async replication topology...

* Checking transaction state of the instance...

WARNING: A GTID set check of the MySQL instance at 'mytest4:3306' determined that it contains transactions that do not originate from the replicaset, which must be discarded before it can join the replicaset.

mytest4:3306 has the following errant GTIDs that do not exist in the replicaset:
a135dcac-9964-11ee-a4f2-005056b0f2b2:1-7

WARNING: Discarding these extra GTID events can either be done manually or by completely overwriting the state of mytest4:3306 with a physical snapshot from an existing replicaset member. To use this method by default, set the 'recoveryMethod' option to 'clone'.

Having extra GTID events is not expected, and it is recommended to investigate this further and ensure that the data can be removed prior to choosing the clone recovery method.

Please select a recovery method [C]lone/[A]bort (default Abort): C
* Updating topology
Waiting for clone process of the new member to complete. Press ^C to abort the operation.
* Waiting for clone to finish...
NOTE: mytest4:3306 is being cloned from mytest3:3306
** Stage DROP DATA: Completed
** Clone Transfer  
    FILE COPY  ############################################################  100%  Completed
    PAGE COPY  ############################################################  100%  Completed
    REDO COPY  ############################################################  100%  Completed
* Clone process has finished: 74.37 MB transferred in about 1 second (~74.37 MB/s)

** Changing replication source of mytest4:3306 to mytest3:3306
** Waiting for new instance to synchronize with PRIMARY...
** Transactions replicated  ############################################################  100% 

The instance 'mytest4:3306' was added to the replicaset and is replicating from mytest3:3306.

* Waiting for instance 'mytest4:3306' to synchronize the Metadata updates with the PRIMARY...
** Transactions replicated  ############################################################  100% 

 MySQL  mytest3:33060+ ssl  JS > 

至此 ReplicaSet 创建结束。

7.查看集群状态

检查 InnoDB ReplicaSet 的状态

使用 ReplicaSet.status() 操作查看 ReplicaSet 的相关信息。ReplicaSet.status() 操作支持扩展选项,可获取不同级别的详细信息。例如

·ReplicaSet.status({extended:0}): 提供常规级别的详细信息。除了非默认或意外的复制设置和状态外,只包含有关实例和复制状态的基本信息。

·ReplicaSet.status({extended:1}): 将扩展设置为 1 时,将包括元数据版本、服务器 UUID、复制信息(如滞后和工作线程)、用于推导实例状态的原始信息、应用者队列大小、防止意外写入的系统变量值等。

·ReplicaSet.status({extended:2}): 将扩展设置为 2 包括与复制相关的重要配置设置,如加密连接等。

 MySQL  mytest3:33060+ ssl  JS > replicaset.status()
{
    "replicaSet": {
        "name": "MyReplicaSet", 
        "primary": "mytest3:3306", 
        "status": "AVAILABLE", 
        "statusText": "All instances available.", 
        "topology": {
            "mytest3:3306": {
                "address": "mytest3:3306", 
                "instanceRole": "PRIMARY", 
                "mode": "R/W", 
                "status": "ONLINE"
            }, 
            "mytest4:3306": {
                "address": "mytest4:3306", 
                "instanceRole": "SECONDARY", 
                "mode": "R/O", 
                "replication": {
                    "applierStatus": "APPLIED_ALL", 
                    "applierThreadState": "Waiting for an event from Coordinator", 
                    "applierWorkerThreads": 4, 
                    "receiverStatus": "ON", 
                    "receiverThreadState": "Waiting for source to send event", 
                    "replicationLag": null
                }, 
                "status": "ONLINE"
            }
        }, 
        "type": "ASYNC"
    }
}
 MySQL  mytest3:33060+ ssl  JS >

--其它查询演示

 MySQL  mytest3:33060+ ssl  JS > replicaset.status({extended:0})
{
    "replicaSet": {
        "name": "MyReplicaSet", 
        "primary": "mytest3:3306", 
        "status": "AVAILABLE", 
        "statusText": "All instances available.", 
        "topology": {
            "mytest3:3306": {
                "address": "mytest3:3306", 
                "instanceRole": "PRIMARY", 
                "mode": "R/W", 
                "status": "ONLINE"
            }, 
            "mytest4:3306": {
                "address": "mytest4:3306", 
                "instanceRole": "SECONDARY", 
                "mode": "R/O", 
                "replication": {
                    "applierStatus": "APPLIED_ALL", 
                    "applierThreadState": "Waiting for an event from Coordinator", 
                    "applierWorkerThreads": 4, 
                    "receiverStatus": "ON", 
                    "receiverThreadState": "Waiting for source to send event", 
                    "replicationLag": null
                }, 
                "status": "ONLINE"
            }
        }, 
        "type": "ASYNC"
    }
}
 MySQL  mytest3:33060+ ssl  JS > replicaset.status({extended:1})
{
    "metadataVersion": "2.1.0", 
    "replicaSet": {
        "name": "MyReplicaSet", 
        "primary": "mytest3:3306", 
        "status": "AVAILABLE", 
        "statusText": "All instances available.", 
        "topology": {
            "mytest3:3306": {
                "address": "mytest3:3306", 
                "fenceSysVars": [], 
                "fenced": false, 
                "instanceRole": "PRIMARY", 
                "mode": "R/W", 
                "serverUuid": "a1356bf9-9964-11ee-9a9d-005056b01ad7", 
                "status": "ONLINE"
            }, 
            "mytest4:3306": {
                "address": "mytest4:3306", 
                "fenceSysVars": [
                    "read_only", 
                    "super_read_only"
                ], 
                "fenced": true, 
                "instanceRole": "SECONDARY", 
                "mode": "R/O", 
                "replication": {
                    "applierQueuedTransactionSet": "", 
                    "applierQueuedTransactionSetSize": 0, 
                    "applierState": "ON", 
                    "applierStatus": "APPLIED_ALL", 
                    "applierThreadState": "Waiting for an event from Coordinator", 
                    "applierWorkerThreads": 4, 
                    "coordinatorState": "ON", 
                    "coordinatorThreadState": "Replica has read all relay log; waiting for more updates", 
                    "receiverStatus": "ON", 
                    "receiverThreadState": "Waiting for source to send event", 
                    "receiverTimeSinceLastMessage": "00:00:06.330290", 
                    "replicationLag": null, 
                    "source": "mytest3:3306"
                }, 
                "serverUuid": "a135dcac-9964-11ee-a4f2-005056b0f2b2", 
                "status": "ONLINE", 
                "transactionSetConsistencyStatus": "OK"
            }
        }, 
        "type": "ASYNC"
    }
}
 MySQL  mytest3:33060+ ssl  JS > replicaset.status({extended:2})
{
    "metadataVersion": "2.1.0", 
    "replicaSet": {
        "name": "MyReplicaSet", 
        "primary": "mytest3:3306", 
        "status": "AVAILABLE", 
        "statusText": "All instances available.", 
        "topology": {
            "mytest3:3306": {
                "address": "mytest3:3306", 
                "fenceSysVars": [], 
                "fenced": false, 
                "instanceRole": "PRIMARY", 
                "mode": "R/W", 
                "serverUuid": "a1356bf9-9964-11ee-9a9d-005056b01ad7", 
                "status": "ONLINE"
            }, 
            "mytest4:3306": {
                "address": "mytest4:3306", 
                "fenceSysVars": [
                    "read_only", 
                    "super_read_only"
                ], 
                "fenced": true, 
                "instanceRole": "SECONDARY", 
                "mode": "R/O", 
                "replication": {
                    "applierQueuedTransactionSet": "", 
                    "applierQueuedTransactionSetSize": 0, 
                    "applierState": "ON", 
                    "applierStatus": "APPLIED_ALL", 
                    "applierThreadState": "Waiting for an event from Coordinator", 
                    "applierWorkerThreads": 4, 
                    "coordinatorState": "ON", 
                    "coordinatorThreadState": "Replica has read all relay log; waiting for more updates", 
                    "options": {
                        "connectRetry": 60, 
                        "delay": 0, 
                        "heartbeatPeriod": 30, 
                        "retryCount": 86400
                    }, 
                    "receiverStatus": "ON", 
                    "receiverThreadState": "Waiting for source to send event", 
                    "receiverTimeSinceLastMessage": "00:00:10.062587", 
                    "replicationLag": null, 
                    "source": "mytest3:3306"
                }, 
                "serverUuid": "a135dcac-9964-11ee-a4f2-005056b0f2b2", 
                "status": "ONLINE", 
                "transactionSetConsistencyStatus": "OK"
            }
        }, 
        "type": "ASYNC"
    }
}
 MySQL  mytest3:33060+ ssl  JS > 

8.数据测试

主节点插入数据

# mysqlsh --uri root@localhost --socket=/abce/mysql_data/mysql.sock
MySQL Shell 8.0.32

Copyright (c) 2016, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.

Type '\help' or '\?' for help; '\quit' to exit.
Creating a Classic session to 'root@/abce%2Fmysql_data%2Fmysql.sock'
Fetching schema names for auto-completion... Press ^C to stop.
Your MySQL connection id is 58
Server version: 8.0.32-24 Percona Server (GPL), Release 24, Revision e5c6e9d2
No default schema selected; type \use <schema> to set one.
 MySQL  localhost  JS > \sql
Switching to SQL mode... Commands end with ;
Fetching global names for auto-completion... Press ^C to stop.
 MySQL  localhost  SQL > create abce;
ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'abce' at line 1
 MySQL  localhost  SQL > create database abce;
Query OK, 1 row affected (0.0035 sec)
 MySQL  localhost  SQL > use abce
Default schema set to `abce`.
Fetching global names, object names from `abce` for auto-completion... Press ^C to stop.
 MySQL  localhost  abce  SQL >  CREATE TABLE if not exists abce.student(stndid int primary key auto_increment,stdname varchar(100),phone int,classid int);
Query OK, 0 rows affected (0.0128 sec)
 MySQL  localhost  abce  SQL > INSERT abce.student(stdname,phone,classid) values('Aslam',123456977,7);
Query OK, 1 row affected (0.0052 sec)
 MySQL  localhost  abce  SQL > select * from student;
+--------+---------+-----------+---------+
| stndid | stdname | phone     | classid |
+--------+---------+-----------+---------+
|      1 | Aslam   | 123456977 |       7 |
+--------+---------+-----------+---------+
1 row in set (0.0004 sec)
 MySQL  localhost  abce  SQL > select  @@hostname;
+------------+
| @@hostname |
+------------+
| mytest3    |
+------------+
1 row in set (0.0006 sec)
 MySQL  localhost  abce  SQL > 

在从节点查看

# mysqlsh --uri root@localhost --socket=/abce/mysql_data/mysql.sock
MySQL Shell 8.0.32

Copyright (c) 2016, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.

Type '\help' or '\?' for help; '\quit' to exit.
Creating a Classic session to 'root@/abce%2Fmysql_data%2Fmysql.sock'
Fetching schema names for auto-completion... Press ^C to stop.
Your MySQL connection id is 28
Server version: 8.0.32-24 Percona Server (GPL), Release 24, Revision e5c6e9d2
No default schema selected; type \use <schema> to set one.
 MySQL  localhost  JS > \sql
Switching to SQL mode... Commands end with ;
Fetching global names for auto-completion... Press ^C to stop.
 MySQL  localhost  SQL > use abce
Default schema set to `abce`.
Fetching global names, object names from `abce` for auto-completion... Press ^C to stop.
 MySQL  localhost  abce  SQL > select * from student;
+--------+---------+-----------+---------+
| stndid | stdname | phone     | classid |
+--------+---------+-----------+---------+
|      1 | Aslam   | 123456977 |       7 |
+--------+---------+-----------+---------+
1 row in set (0.0009 sec)
 MySQL  localhost  abce  SQL > select  @@hostname;
+------------+
| @@hostname |
+------------+
| mytest4    |
+------------+
1 row in set (0.0004 sec)
 MySQL  localhost  abce  SQL > 

9.手动切换

ReplicaSet.setPrimaryInstance() 可以切换主节点。为了切换安全,mysql shell 必须要能访问所有节点。根据 ReplicaSet 启动的 MySQL 路由器实例会自动开始将读写客户端重定向到新的主服务器。

# mysqlsh --uri root@localhost --socket=/abce/mysql_data/mysql.sock
MySQL Shell 8.0.32

Copyright (c) 2016, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.

Type '\help' or '\?' for help; '\quit' to exit.
Creating a Classic session to 'root@/abce%2Fmysql_data%2Fmysql.sock'
Fetching schema names for auto-completion... Press ^C to stop.
Your MySQL connection id is 65
Server version: 8.0.32-24 Percona Server (GPL), Release 24, Revision e5c6e9d2
No default schema selected; type \use <schema> to set one.
 MySQL  localhost  JS > 
 MySQL  localhost  JS > \connect rsadmin@mytest3
Creating a session to 'rsadmin@mytest3'
Fetching schema names for auto-completion... Press ^C to stop.
Closing old connection...
Your MySQL connection id is 66 (X protocol)
Server version: 8.0.32-24 Percona Server (GPL), Release 24, Revision e5c6e9d2
No default schema selected; type \use <schema> to set one.
 MySQL  mytest3:33060+ ssl  JS > replicaset = dba.getReplicaSet()
You are connected to a member of replicaset 'MyReplicaSet'.
<ReplicaSet:MyReplicaSet>
 MySQL  mytest3:33060+ ssl  JS > replicaset.status()
{
    "replicaSet": {
        "name": "MyReplicaSet", 
        "primary": "mytest3:3306", 
        "status": "AVAILABLE", 
        "statusText": "All instances available.", 
        "topology": {
            "mytest3:3306": {
                "address": "mytest3:3306", 
                "instanceRole": "PRIMARY", 
                "mode": "R/W", 
                "status": "ONLINE"
            }, 
            "mytest4:3306": {
                "address": "mytest4:3306", 
                "instanceRole": "SECONDARY", 
                "mode": "R/O", 
                "replication": {
                    "applierStatus": "APPLIED_ALL", 
                    "applierThreadState": "Waiting for an event from Coordinator", 
                    "applierWorkerThreads": 4, 
                    "receiverStatus": "ON", 
                    "receiverThreadState": "Waiting for source to send event", 
                    "replicationLag": null
                }, 
                "status": "ONLINE"
            }
        }, 
        "type": "ASYNC"
    }
}
 MySQL  mytest3:33060+ ssl  JS > replicaset.setPrimaryInstance('mytest4:3306')
mytest4:3306 will be promoted to PRIMARY of 'MyReplicaSet'.
The current PRIMARY is mytest3:3306.

* Connecting to replicaset instances
** Connecting to mytest3:3306
** Connecting to mytest4:3306
** Connecting to mytest3:3306
** Connecting to mytest4:3306

* Performing validation checks
** Checking async replication topology...
** Checking transaction state of the instance...

* Synchronizing transaction backlog at mytest4:3306
** Transactions replicated  ############################################################  100% 

* Updating metadata

* Acquiring locks in replicaset instances
** Pre-synchronizing SECONDARIES
** Acquiring global lock at PRIMARY
** Acquiring global lock at SECONDARIES

* Updating replication topology
** Changing replication source of mytest3:3306 to mytest4:3306

mytest4:3306 was promoted to PRIMARY.

 MySQL  mytest3:33060+ ssl  JS > replicaset.status()
{
    "replicaSet": {
        "name": "MyReplicaSet", 
        "primary": "mytest4:3306", 
        "status": "AVAILABLE", 
        "statusText": "All instances available.", 
        "topology": {
            "mytest3:3306": {
                "address": "mytest3:3306", 
                "instanceRole": "SECONDARY", 
                "mode": "R/O", 
                "replication": {
                    "applierStatus": "APPLIED_ALL", 
                    "applierThreadState": "Waiting for an event from Coordinator", 
                    "applierWorkerThreads": 4, 
                    "receiverStatus": "ON", 
                    "receiverThreadState": "Waiting for source to send event", 
                    "replicationLag": null
                }, 
                "status": "ONLINE"
            }, 
            "mytest4:3306": {
                "address": "mytest4:3306", 
                "instanceRole": "PRIMARY", 
                "mode": "R/W", 
                "status": "ONLINE"
            }
        }, 
        "type": "ASYNC"
    }
}
 MySQL  mytest3:33060+ ssl  JS > 

强制切换

如果无法连接到主节点,也无法使用 ReplicaSet.setPrimaryInstance() 安全地执行切换到新主节点。可以强制故障转移,强制故障转移是一种潜在的破坏性操作,必须谨慎使用。

如果最后已知的主库仍可访问,ReplicaSet.forcePrimaryInstance() 操作就会失败

10.安装启动mysqlrouter

MySQL Router 的 bootstrap 模式支持 failover,这里将 MySQL Router 安装在 192.168.137.4上,如果资源充足的话,建议将MySQL Router安装在单独的一台服务器上。

用 mysqlrouter 用户引导启动 mysqlrouter

# mysqlrouter --bootstrap rsadmin@mytest3 --user mysqlrouter
Please enter MySQL password for rsadmin: 
# Bootstrapping system MySQL Router instance...

- 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 /etc/mysqlrouter/mysqlrouter.conf

Existing configuration backed up to '/etc/mysqlrouter/mysqlrouter.conf.bak'

# MySQL Router configured for the InnoDB ReplicaSet 'MyReplicaSet'

After this MySQL Router has been started with the generated configuration

    $ /etc/init.d/mysqlrouter restart
or
    $ systemctl start mysqlrouter
or
    $ mysqlrouter -c /etc/mysqlrouter/mysqlrouter.conf

InnoDB ReplicaSet 'MyReplicaSet' can be reached by connecting to:

## MySQL Classic protocol

- Read/Write Connections: localhost:6446
- Read/Only Connections:  localhost:6447

## MySQL X protocol

- Read/Write Connections: localhost:6448
- Read/Only Connections:  localhost:6449

router 配置好后就可以通过 router 连接到数据库了。​

标签:status,8.0,ReplicaSet,32,localhost,MySQL,3306,mytest4,mytest3
From: https://www.cnblogs.com/abclife/p/17923132.html

相关文章

  • 320二叉树的不同形态(已知层次遍历和中序遍历创建二叉树;输出叶子结点(从左到右);后序遍历)
    题目:二叉树的不同形态问题描述给定二叉树T(树深度H<=10,深度从1开始,结点个数N<1024,结点编号1~N)的层次遍历序列和中序遍历序列,输出T从左向右叶子结点以及二叉树先序和后序遍历序列。输入格式输入共三行:第一行是整数n,表示二叉树中的结点数目;第二行有n个整数,表示该二叉树的层次遍......
  • 2023-2024-1 20231320 《计算机基础与程序设计》第十三周学习总结
    2023-2024-120231320《计算机基础与程序设计》第十三周学习总结作业信息这个作业属于哪个课程<班级的链接>(2023-2024-1计算机基础与程序设计)这个作业要求在哪里<作业要求的链接>(2022-2023-1计算机基础与程序设计第十三周作业)这个作业的目标<自学《C语言程序......
  • 12321
    #include<iostream>#include<windows.h>usingnamespacestd;/*声明变量*/HWNDhand=NULL;DWORDpid=0;HANDLEhProcess=NULL;DWORDBaseValue=0;DWORDSunshineAddress;/*声明方法/函数*/boolstartGame();boolinitSunshine();intgetSunshineValue();voidsetSunshi......
  • 代码随想录算法训练营第十天 | 栈与队列理论基础,232.用栈实现队列,225.用队列实现栈
    一、栈与队列理论基础学习:1.定义栈先进后出队列先进先出2.底层实现均可以通过数组或链表进行实现二、232.用栈实现队列题目链接:LeetCode232.用栈实现队列学习前:思路:无学习后:不同方法有部分功能实现是一致的,则可以进行抽象提取,实现复用性两个栈实现队列时......
  • 适用于双电机控制和PFC控制的R5F526TAADFM、R5F526T8AGFM 32位微控制器
    简介RX26T微控制器产品群是可在单芯片上实现磁场定向控制(FOC)双电机控制和功率因数校正(PFC)控制的5V兼容产品。它搭载工作频率为120MHz的RX第三代CPU内核“RXv3内核”,通过可实现120MHz读取操作的高速闪存和三角函数运算单元(TFUv2)实现超高计算性能。定时器功能支持120MHzPWM(三......
  • STM32MP157驱动开发——USB设备驱动
    一、简介  由于USB协议太过庞大和复杂,所以本节只对STM32MP157自带的USB驱动进行使能和测试。详细的USB接口和协议的介绍,可以参考原子哥的资料《USB2.0协议中文版.pdf》和《USB3.0协议中文版.pdf》。  USB全称为UniversalSerialBus,翻译过来就是通用串行总线,用......
  • STM32中滴答定时器的使用并进行ms和us级延时
    STM32中滴答定时器的使用并进行ms和us级延时滴答定时器(Systick)滴答定时器Systick是stm32内核中的一个系统定时器,是属于内核的外设。滴答定时器是一个24位的倒计数定时器,当计数到0时,会从LOAD寄存器中自动重装载定时初值,开始新一轮计数。在core_cm3.h和core_cm4.h头文件中都会......
  • 2023-2024-1 20232309 《网络空间安全导论》第15(6)周学习总结
    2023-2024-120232309《网络空间安全导论》第15(6)周学习总结教材学习内容总结教材学习中的问题和解决过程1.比特币是啥?(想要个更通俗的介绍)去中心化示意:百度介绍:一点解释:2.区块链?基于AI的学习好像关联性不是很大但随便了。。。嗯嗯就这样敷衍地结束了()......
  • 20211327 嵌入式基础
    嵌入式基础信息安全系统有时间戳的需求,因此密码系统有实时钟芯片。假设实时钟芯片的IO映像基址是全局变量unsigntedintTIME的指针地址,时间存放在(基址+2)的寄存器中(默认值为当前时间),寄存器是16位,结构如附件中图所示按照下图给出TIME的注释(6‘)定义基于16位寄存器的宏(4‘)使......
  • ubuntu18离线安装mysql8.0
    参考文档Ubuntu中使用apt下载离线包以及相关依赖包-厚礼蝎-博客园(cnblogs.com)ubuntu18.04安装mysql8.0详细教程及踩坑解决方法(包含删除Mysql5.7版本方法)_ubuntu编译安装mysql-CSDN博客如何配置MySQL8中的lower_case_table_names来让其忽略大小写?–就是这个范儿(thi......