MySQL 8.0.32 InnoDB ReplicaSet 配置和手动切换
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 连接到数据库了。
MySQL 8.0.32 InnoDB ReplicaSet 配置和手动切换的更多相关文章
- 原创:mysql5 还原至mysql 8.0.11数据库链接配置提示错误(修改内容有三处
原创:mysql5 还原至mysql 8.0.11数据库链接配置提示错误改有三: a) mysql 连接jar包版修改 b)类路径修改 c)配置连接池地址修改 因版本升级,首先要修改 1:mysql- ...
- MySQL 5.0的my.cnf配置选项(另外一种方式分类整理)
一. mysqld程序--目录和文件 basedir = path 使用给定目录作为根目录(安装目录). Show variables like “basedir” //数据库中查看目录 da ...
- MySQL 8.0 yum安装和配置
MySQL 8.0 centos7.5 x86_64 一.yum安装 1.先卸载机器和mysql有关的东西,有的安装了mariab-lib,会对安装有干扰,卸载了它. [root@localhost ...
- mysql 8.0 MGR组复制配置
一.配置组复制的步骤 1.初始化数据目录 2.配置主服务器(primary) 3.配置辅助服务器(secondaries) 4.启动mysql实例 5.安装组复制插件(primary and seco ...
- MySQL 8.0.18 InnoDB Cluster 主从(MGR)完整安装配置
提示: MySQL InnoDB Cluster底层依赖Group Replication模式,至少3台机器 1. 准备3台 CentOS Linux 7 (Core), 修改各主机名:db-hos ...
- php4.3.4.4、apache2.0.4.8、mysql 4.0.26、window7 配置过程
apache的安装不需要过程,直接默认安装,下一步 下一步就Ok了. php4的安装: 1 将php-4.0.4-Win32.zip(最新版本4.0.4)解压缩到硬盘的一个目录中,例如解压到E:php ...
- MySql 8.0.12安装、配置
1. 参考:① 菜鸟教程下载安装MySQl ② 8.0.12安装方法 以下是我遇到的问题: 2.执行 mysqd --initialize --console 后,这个时候运行突然报"无法启 ...
- MySQL 8.0有什么新功能
https://mysqlserverteam.com/whats-new-in-mysql-8-0-generally-available/ 我们自豪地宣布MySQL 8.0的一般可用性. 现在下载 ...
- MySQL 8.0 新特性梳理汇总
一 历史版本发布回顾 从上图可以看出,基本遵循 5+3+3 模式 5---GA发布后,5年 就停止通用常规的更新了(功能不再更新了): 3---企业版的,+3年功能不再更新了: 3 ---完全停止更新 ...
- Tomcat 6.0.32 +Spring dbcp datasource关闭Tomcat出现严重异常
异常如下: 信息: Pausing Coyote HTTP/ -- :: org.apache.catalina.core.StandardService stop 信息: Stopping serv ...
随机推荐
- 原来你是这样的SpringBoot--初识SpringBootAdmin
简介 Spring Boot Admin(SBA)是一个针对spring-boot的actuator接口进行UI美化封装的监控工具.它可以:在列表中浏览所有被监控spring-boot项目的基本信息, ...
- Frida环境配置
目录 安装Linux客户端 配置Android服务端 测试运行效果 官方手册 安装Linux客户端 github地址:https://github.com/frida/frida pip instal ...
- MySQL 分表查询
分表是一种数据库分割技术,用于将大表拆分成多个小表,以提高数据库的性能和可管理性.在MySQL中,可以使用多种方法进行分表,例如基于范围.哈希或列表等.下面将详细介绍MySQL如何分表以及分表后如何进 ...
- JavaScript中的浅拷贝与深拷贝
前言 JavaScript中的浅拷贝和深拷贝是非常重要的概念,它们在处理对象和数组时具有不同的作用.在编程中,经常需要复制数据以便进行各种操作,但必须注意拷贝的方式,以确保得到预期的结果. 浅拷贝是创 ...
- Solution -「CF 959E」Mahmoud and Ehab and the xor-MST
Description Link. 一完全图有 \(n\) 个节点 \(0,...,n-1\),其中边 \((i,j)\) 的权值为 \(i\oplus j\),其中 \(\oplus\) 为位异或操 ...
- Interesting Array 题解
Interesting Array 题目大意 构造一个序列 \(a\),使其满足若干限制条件,每个限制条件是形如 l r q 的式子,其意义是:\(\&_{i=l}^ra_i=q\). 题意分 ...
- LLM在text2sql上的应用
一.前言: 目前,大模型的一个热门应用方向text2sql它可以帮助用户快速生成想要查询的SQL语句.那对于用户来说,大部分简单的sql都是正确的,但对于一些复杂逻辑来说,需要用户在产出SQL的基础上 ...
- zabbix 监控 IPMI
1.IPMI的相关介绍: 智能平台管理接口(Intelligent Platform Management Interface)原本是一种Intel架构的企业系统的周边设备所采用的一种工业标准.IPM ...
- 为什么idea建议使用“+”拼接字符串
前言 各位小伙伴在字符串拼接时应该都见过下面这种提示: 内容翻译:报告StringBuffer.StringBuilder或StringJoiner的任何用法,这些用法可以用单个java.lang.S ...
- 使用单卡v100 32g或更低显存的卡,使用peft工具qlora或lora混合精度训练大模型chatGLM2-6b,torch混合精度加速稳定训练,解决qlora loss变成nan的问题!
最近新换了工作,以后的工作内容会和大模型相关,所以先抽空跑了一下chatGLM2-6b的demo,使用Qlora或lora微调模型 今天简单写个文档记录一下,顺便也是一个简单的教程,并且踩了qlora ...