MySQL Group Replication

参考文档:
https://dev.mysql.com/doc/refman/8.4/en/group-replication-configuring-instances.html

MySQL版本:

mysql> select version();
+-----------+
| version() |
+-----------+
| 8.4.3     |
+-----------+
1 row in set (0.00 sec)mysql> 

-- 设置/etc/hosts (三个节点都需要设置)

192.168.2.11  mgr01
192.168.2.12  mgr02
192.168.2.13  mgr03

-- 关闭掉OS的防火墙 (三个节点都需要设置,略)

-- 第一个库的设置

-- 初始化MySQL (略)

-- MySQL配置文件(本测试,仅仅设置MGR所需的必须的参数)

[mysqld]#
# Disable other storage engines
#
disabled_storage_engines="MyISAM,BLACKHOLE,FEDERATED,ARCHIVE,MEMORY"#
# Replication configuration parameters
#
server_id=1
gtid_mode=ON
enforce_gtid_consistency=ON#
# Group Replication configuration
#
plugin_load_add='group_replication.so'
group_replication_group_name="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
group_replication_start_on_boot=off
group_replication_local_address= "mgr01:33061"
group_replication_group_seeds= "mgr01:33061,mgr02:33061,mgr03:33061"
group_replication_bootstrap_group= off

-- 安装插件,(my.cnf中plugin_load_add='group_replication.so',发现plogins已经是active了)

INSTALL PLUGIN group_replication SONAME 'group_replication.so';
SHOW PLUGINS;

-- 创建用户

SET SQL_LOG_BIN=0;CREATE USER rpl_user@'%' IDENTIFIED BY 'mysql';
alter user rpl_user@'%' identified with  mysql_native_password  by 'mysql';
GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%';
GRANT CONNECTION_ADMIN ON *.* TO rpl_user@'%';
GRANT BACKUP_ADMIN ON *.* TO rpl_user@'%';
GRANT GROUP_REPLICATION_STREAM ON *.* TO rpl_user@'%';
FLUSH PRIVILEGES;SET SQL_LOG_BIN=1;

-- 创建测试库 

CREATE DATABASE test;
USE test;
CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 TEXT NOT NULL);
INSERT INTO t1 VALUES (1, 'Luis');
SHOW BINLOG EVENTS;mysql> SHOW BINLOG EVENTS;
+---------------+-----+----------------+-----------+-------------+----------------------------------+
| Log_name      | Pos | Event_type     | Server_id | End_log_pos | Info                             |
+---------------+-----+----------------+-----------+-------------+----------------------------------+
| binlog.000001 |   4 | Format_desc    |         1 |         127 | Server ver: 8.4.3, Binlog ver: 4 |
| binlog.000001 | 127 | Previous_gtids |         1 |         158 |                                  |
| binlog.000001 | 158 | Stop           |         1 |         181 |                                  |
+---------------+-----+----------------+-----------+-------------+----------------------------------+
3 rows in set (0.00 sec)mysql> 

-- 启用复制 

CHANGE REPLICATION SOURCE TO SOURCE_USER='rpl_user',SOURCE_PASSWORD='mysql' FOR CHANNEL 'group_replication_recovery';
SET GLOBAL group_replication_bootstrap_group=ON;
START GROUP_REPLICATION USER='rpl_user', PASSWORD='mysql';
SET GLOBAL group_replication_bootstrap_group=OFF;mysql> CHANGE REPLICATION SOURCE TO SOURCE_USER='rpl_user',SOURCE_PASSWORD='mysql' FOR CHANNEL 'group_replication_recovery';
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> SET GLOBAL group_replication_bootstrap_group=ON;
Query OK, 0 rows affected (0.00 sec)mysql> START GROUP_REPLICATION USER='rpl_user', PASSWORD='mysql';
Query OK, 0 rows affected (1.08 sec)mysql> SET GLOBAL group_replication_bootstrap_group=OFF;
Query OK, 0 rows affected (0.00 sec)mysql> 

-- 查看复制状态

SELECT * FROM performance_schema.replication_group_members;mysql> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| group_replication_applier | e558e52f-b327-11ef-8266-000c291c3ef6 | mgr01       |        3306 | ONLINE       | PRIMARY     | 8.4.3          | XCom                       |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
1 row in set (0.01 sec)mysql> 

 

-- 添加第二个库  

-- 初始化MySQL、创建用户,同第一个库 (略)

-- 启动 

CHANGE REPLICATION SOURCE TO SOURCE_USER='rpl_user', SOURCE_PASSWORD='mysql' FOR CHANNEL 'group_replication_recovery';START GROUP_REPLICATION;
START GROUP_REPLICATION USER='rpl_user', PASSWORD='mysql';
SELECT * FROM performance_schema.replication_group_members;mysql> CHANGE REPLICATION SOURCE TO SOURCE_USER='rpl_user', SOURCE_PASSWORD='mysql' FOR CHANNEL 'group_replication_recovery';
Query OK, 0 rows affected, 1 warning (0.01 sec)mysql> mysql> START GROUP_REPLICATION USER='rpl_user', PASSWORD='mysql';
Query OK, 0 rows affected (5.94 sec)mysql> 
mysql> CHANGE REPLICATION SOURCE TO SOURCE_USER='rpl_user', SOURCE_PASSWORD='mysql' FOR CHANNEL 'group_replication_recovery';
Query OK, 0 rows affected, 1 warning (0.01 sec)mysql> START GROUP_REPLICATION USER='rpl_user', PASSWORD='mysql';
Query OK, 0 rows affected (1.89 sec)mysql> 

-- 查看复制状态 (状态为RECOVERING,说明有问题,通过后面的问题1234解决。设置时候可以参考各个mysql的log,以查看复制是否有问题)

mysql> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| group_replication_applier | 47b589a3-b3c3-11ef-ba63-000c297e6af7 | mgr02       |        3306 | RECOVERING   | SECONDARY   | 8.4.3          | XCom                       |
| group_replication_applier | e558e52f-b327-11ef-8266-000c291c3ef6 | mgr01       |        3306 | ONLINE       | PRIMARY     | 8.4.3          | XCom                       |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
2 rows in set (0.00 sec)mysql> 

-- 添加第三个库 

[mysqld]#
# Disable other storage engines
#
disabled_storage_engines="MyISAM,BLACKHOLE,FEDERATED,ARCHIVE,MEMORY"#
# Replication configuration parameters
#
server_id=3
gtid_mode=ON
enforce_gtid_consistency=ON#
# Group Replication configuration
#
plugin_load_add='group_replication.so'
group_replication_group_name="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
group_replication_start_on_boot=off
group_replication_local_address= "mgr03:33061"
group_replication_group_seeds= "mgr01:33061,mgr02:33061,mgr03:33061"
group_replication_bootstrap_group= off

-- 初始化MySQL、创建用户,同第一个库 (略)

-- 启动复制 

 

CHANGE REPLICATION SOURCE TO SOURCE_USER='rpl_user',SOURCE_PASSWORD='mysql' FOR CHANNEL 'group_replication_recovery';
START GROUP_REPLICATION USER='rpl_user', PASSWORD='mysql';

-- 查看复制状态

mysql> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| group_replication_applier | 47b589a3-b3c3-11ef-ba63-000c297e6af7 | mgr02       |        3306 | ONLINE       | SECONDARY   | 8.4.3          | XCom                       |
| group_replication_applier | 7bf19e8c-b3d1-11ef-b688-000c29e5c624 | mgr03       |        3306 | ONLINE       | SECONDARY   | 8.4.3          | XCom                       |
| group_replication_applier | e558e52f-b327-11ef-8266-000c291c3ef6 | mgr01       |        3306 | ONLINE       | PRIMARY     | 8.4.3          | XCom                       |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
3 rows in set (0.00 sec)mysql> 

-- 查询复制 
mgr01 上

mysql>  select * from performance_schema.replication_connection_status \G
*************************** 1. row ***************************CHANNEL_NAME: group_replication_applierGROUP_NAME: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaaSOURCE_UUID: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaaTHREAD_ID: NULLSERVICE_STATE: ONCOUNT_RECEIVED_HEARTBEATS: 0LAST_HEARTBEAT_TIMESTAMP: 0000-00-00 00:00:00.000000RECEIVED_TRANSACTION_SET: e558e52f-b327-11ef-8266-000c291c3ef6:1-4LAST_ERROR_NUMBER: 0LAST_ERROR_MESSAGE: LAST_ERROR_TIMESTAMP: 0000-00-00 00:00:00.000000LAST_QUEUED_TRANSACTION: LAST_QUEUED_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000
LAST_QUEUED_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000LAST_QUEUED_TRANSACTION_START_QUEUE_TIMESTAMP: 0000-00-00 00:00:00.000000LAST_QUEUED_TRANSACTION_END_QUEUE_TIMESTAMP: 0000-00-00 00:00:00.000000QUEUEING_TRANSACTION: QUEUEING_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000QUEUEING_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000QUEUEING_TRANSACTION_START_QUEUE_TIMESTAMP: 0000-00-00 00:00:00.000000
*************************** 2. row ***************************CHANNEL_NAME: group_replication_recoveryGROUP_NAME: SOURCE_UUID: THREAD_ID: NULLSERVICE_STATE: OFFCOUNT_RECEIVED_HEARTBEATS: 0LAST_HEARTBEAT_TIMESTAMP: 0000-00-00 00:00:00.000000RECEIVED_TRANSACTION_SET: LAST_ERROR_NUMBER: 0LAST_ERROR_MESSAGE: LAST_ERROR_TIMESTAMP: 0000-00-00 00:00:00.000000LAST_QUEUED_TRANSACTION: LAST_QUEUED_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000
LAST_QUEUED_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000LAST_QUEUED_TRANSACTION_START_QUEUE_TIMESTAMP: 0000-00-00 00:00:00.000000LAST_QUEUED_TRANSACTION_END_QUEUE_TIMESTAMP: 0000-00-00 00:00:00.000000QUEUEING_TRANSACTION: QUEUEING_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000QUEUEING_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000QUEUEING_TRANSACTION_START_QUEUE_TIMESTAMP: 0000-00-00 00:00:00.000000
2 rows in set (0.01 sec)mysql> 

mgr02 上

mysql> select * from performance_schema.replication_connection_status \G
*************************** 1. row ***************************CHANNEL_NAME: group_replication_applierGROUP_NAME: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaaSOURCE_UUID: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaaTHREAD_ID: NULLSERVICE_STATE: ONCOUNT_RECEIVED_HEARTBEATS: 0LAST_HEARTBEAT_TIMESTAMP: 0000-00-00 00:00:00.000000RECEIVED_TRANSACTION_SET: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1,
e558e52f-b327-11ef-8266-000c291c3ef6:1-4LAST_ERROR_NUMBER: 0LAST_ERROR_MESSAGE: LAST_ERROR_TIMESTAMP: 0000-00-00 00:00:00.000000LAST_QUEUED_TRANSACTION: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1LAST_QUEUED_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP: 2024-12-06 08:40:56.415873
LAST_QUEUED_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP: 2024-12-06 08:40:56.415873LAST_QUEUED_TRANSACTION_START_QUEUE_TIMESTAMP: 2024-12-06 08:40:56.530630LAST_QUEUED_TRANSACTION_END_QUEUE_TIMESTAMP: 2024-12-06 08:40:56.530646QUEUEING_TRANSACTION: QUEUEING_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000QUEUEING_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000QUEUEING_TRANSACTION_START_QUEUE_TIMESTAMP: 0000-00-00 00:00:00.000000
*************************** 2. row ***************************CHANNEL_NAME: group_replication_recoveryGROUP_NAME: SOURCE_UUID: THREAD_ID: NULLSERVICE_STATE: OFFCOUNT_RECEIVED_HEARTBEATS: 0LAST_HEARTBEAT_TIMESTAMP: 0000-00-00 00:00:00.000000RECEIVED_TRANSACTION_SET: LAST_ERROR_NUMBER: 0LAST_ERROR_MESSAGE: LAST_ERROR_TIMESTAMP: 0000-00-00 00:00:00.000000LAST_QUEUED_TRANSACTION: LAST_QUEUED_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000
LAST_QUEUED_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000LAST_QUEUED_TRANSACTION_START_QUEUE_TIMESTAMP: 0000-00-00 00:00:00.000000LAST_QUEUED_TRANSACTION_END_QUEUE_TIMESTAMP: 0000-00-00 00:00:00.000000QUEUEING_TRANSACTION: QUEUEING_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000QUEUEING_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000QUEUEING_TRANSACTION_START_QUEUE_TIMESTAMP: 0000-00-00 00:00:00.000000
2 rows in set (0.00 sec)mysql> 

mgr03上 

mysql> select * from performance_schema.replication_connection_status \G
*************************** 1. row ***************************CHANNEL_NAME: group_replication_applierGROUP_NAME: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaaSOURCE_UUID: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaaTHREAD_ID: NULLSERVICE_STATE: ONCOUNT_RECEIVED_HEARTBEATS: 0LAST_HEARTBEAT_TIMESTAMP: 0000-00-00 00:00:00.000000RECEIVED_TRANSACTION_SET: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1,
e558e52f-b327-11ef-8266-000c291c3ef6:1-4LAST_ERROR_NUMBER: 0LAST_ERROR_MESSAGE: LAST_ERROR_TIMESTAMP: 0000-00-00 00:00:00.000000LAST_QUEUED_TRANSACTION: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1LAST_QUEUED_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP: 2024-12-06 08:40:56.415873
LAST_QUEUED_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP: 2024-12-06 08:40:56.415873LAST_QUEUED_TRANSACTION_START_QUEUE_TIMESTAMP: 2024-12-06 08:40:56.432417LAST_QUEUED_TRANSACTION_END_QUEUE_TIMESTAMP: 2024-12-06 08:40:56.432447QUEUEING_TRANSACTION: QUEUEING_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000QUEUEING_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000QUEUEING_TRANSACTION_START_QUEUE_TIMESTAMP: 0000-00-00 00:00:00.000000
*************************** 2. row ***************************CHANNEL_NAME: group_replication_recoveryGROUP_NAME: SOURCE_UUID: THREAD_ID: NULLSERVICE_STATE: OFFCOUNT_RECEIVED_HEARTBEATS: 0LAST_HEARTBEAT_TIMESTAMP: 0000-00-00 00:00:00.000000RECEIVED_TRANSACTION_SET: LAST_ERROR_NUMBER: 0LAST_ERROR_MESSAGE: LAST_ERROR_TIMESTAMP: 0000-00-00 00:00:00.000000LAST_QUEUED_TRANSACTION: LAST_QUEUED_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000
LAST_QUEUED_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000LAST_QUEUED_TRANSACTION_START_QUEUE_TIMESTAMP: 0000-00-00 00:00:00.000000LAST_QUEUED_TRANSACTION_END_QUEUE_TIMESTAMP: 0000-00-00 00:00:00.000000QUEUEING_TRANSACTION: QUEUEING_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000QUEUEING_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP: 0000-00-00 00:00:00.000000QUEUEING_TRANSACTION_START_QUEUE_TIMESTAMP: 0000-00-00 00:00:00.000000
2 rows in set (0.00 sec)mysql> 

问题1 
group_replication_local_address    等,是mgr01:33061 或其他端口,不是mysql默认的3306 

问题2 
因为是clone的虚拟机,msyql的server_uuid是一样的,需要select uuid()生成一个后,修改,修改的文件是data目录下的auto.cnf ,而不是mysql的启动的时候使用的那个cnf文件

问题3 
mysql8.4 ,默认mysql_native_password 是disable的,如果需要启动,则需要在启动MySQL服务的时候加上--mysql-native-password=ON

问题4 
在启动mgr复制的时候,提示一下错误:
2024-12-06T12:05:35.826175Z 67 [ERROR] [MY-010584] [Repl] Replica I/O for channel 'group_replication_recovery': Error connecting to source 'rpl_user@mgr01:3306'. This was attempt 1/1, with a delay of 60 seconds between attempts. Message: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection. Error_code: MY-002061
需要设置为: mysql_native_password
该错误信息也可通过 select * from performance_schema.replication_connection_status \G 查询 
 

END 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/63593.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

day1:ansible

ansible-doc <module_name>&#xff08;如果没有网&#xff0c;那这个超级有用&#xff09; 这个很有用&#xff0c;用来查单个模块的文档。 ansible-doc -l 列出所有模块 ansible-doc -s <module_name> 查看更详细的模块文档。 ansible-doc --help 使用 --help …

unity 2D像素种田游戏学习记录(自用)

一、透明度排序轴 改变sprite的排序方式&#xff0c;默认按照z轴进行排序&#xff08;离摄像机的远近&#xff09;。可以将其改变成y轴的排序方式&#xff0c;这样可以使2D人物走在草丛的下方就不被遮挡&#xff0c;走在草丛上方就被遮挡&#xff0c;如下图。 在项目设置-图形…

关于GaussDB

一、GaussDB的层级关系 &#xff0c;关于schemas的定位&#xff0c;到底是个什么&#xff0c;其实就可以理解为一个文件夹 数据库服务器 --> databases --> schemas --> tables schema类似于文件夹&#xff0c;一个数据库database里面可以有多个文件夹&#xff0c;每…

代码随想录第五十五天

并查集理论基础 并查集的本质是一种维护不相交集合的数据结构。其核心思想是用树形结构来表示集合&#xff0c;每个集合是一棵树。 基本概念 并查集维护了一个由不同元素构成的不相交集合每个集合用一棵树来表示&#xff0c;树的根节点是该集合的代表元素同一棵树中的所有节…

【CKA】Kubernetes(k8s)认证之CKA考题讲解

CKA考题讲解 0.考试101 0.1 kubectl命令⾃动补全 在 bash 中设置当前 shell 的⾃动补全&#xff0c;要先安装 bash-completion 包。 echo "source <(kubectl completion bash)" >> ~/.bashrc还可以在补全时为 kubectl 使⽤⼀个速记别名&#xff1a; al…

第4章:颜色和背景 --[CSS零基础入门]

在 CSS 中,颜色和背景属性是用于美化网页元素的重要工具。你可以通过多种方式定义颜色,并且可以设置元素的背景颜色、图像、渐变等。以下是关于如何在 CSS 中使用颜色和背景的一些关键点和示例。 1.颜色表示法 当然!以下是使用不同颜色表示法的 CSS 示例,包括 RGB、RGBA、…

力扣刷题TOP101: 27.BM34 判断是不是二叉搜索树

目录&#xff1a; 目的 思路 复杂度 记忆秘诀 python代码 目的&#xff1a; 给定一个二叉树根节点&#xff0c;请判断这棵树是不是二叉搜索树。 二叉搜索树满足每个节点的左子树上的所有节点均小于当前节点且右子树上的所有节点均大于当前节点。 思路 什么是二叉搜索树&am…

linux-12 关于shell(十一)ls

登录系统输入用户名和密码以后&#xff0c;会显示给我们一个命令提示符&#xff0c;就意味着我们在这里就可以输入命令了&#xff0c;给一个命令&#xff0c;这个命令必须要可执行&#xff0c;那问题是我的命令怎么去使用&#xff0c;命令格式有印象吗&#xff1f;在命令提示符…

视觉语言模型 Qwen2-VL

视觉语言模型 Qwen2-VL flyfish from PIL import Image import requests import torch from torchvision import io from typing import Dict from transformers import Qwen2VLForConditionalGeneration, AutoTokenizer, AutoProcessor from modelscope import snapshot_dow…

learn-(Uni-app)跨平台应用的框架

使用 Vue.js 开发所有前端应用的框架&#xff0c;开发者编写一份代码&#xff0c;可发布到iOS、Android、Web&#xff08;包括微信小程序、百度小程序、支付宝小程序、字节跳动小程序、H5、App等&#xff09;等多个平台。 跨平台&#xff1a;Uni-app 支持编译到iOS、Android、W…

java+ssm+mysql校园物品租赁网

项目介绍&#xff1a; 使用javassmmysql开发的校园物品租赁网&#xff0c;系统包含管理员、用户角色&#xff0c;功能如下&#xff1a; 管理员&#xff1a;用户管理&#xff1b;物品管理&#xff08;物品种类、物品信息、评论信息&#xff09;&#xff1b;订单管理&#xff1…

肝了半年,我整理出了这篇云计算学习路线(新手必备,从入门到精通)

大家好&#xff01;我是凯哥&#xff0c;今天给大家分享一下云计算学习路线图。这是我按照自己最开始学习云计算的时候的学习路线&#xff0c;并且结合自己从业多年所涉及的知识精心总结的云计算的思维导图。这是凯哥精心总结的&#xff0c;花费了不少精力哦&#xff0c;希望对…

31.下一个排列 python

下一个排列 题目题目描述示例 1&#xff1a;示例 2&#xff1a;示例 3&#xff1a;提示&#xff1a;题目链接 题解解题思路python实现代码解释&#xff1a;提交结果 题目 题目描述 整数数组的一个 排列 就是将其所有成员以序列或线性顺序排列。 例如&#xff0c;arr [1,2,3…

ISO45001职业健康安全管理体系涵盖了丰富的内容

范围与术语 适用范围&#xff1a;明确规定了该标准适用于任何有愿望建立、实施和保持职业健康安全管理体系的组织&#xff0c;旨在使组织能够通过管理体系的有效运行&#xff0c;预防和控制职业健康安全风险&#xff0c;持续改进职业健康安全绩效。术语定义&#xff1a;对职业…

【OpenCV】平滑图像

二维卷积(图像滤波) 与一维信号一样&#xff0c;图像也可以通过各种低通滤波器&#xff08;LPF&#xff09;、高通滤波器&#xff08;HPF&#xff09;等进行过滤。LPF 有助于消除噪音、模糊图像等。HPF 滤波器有助于在图像中找到边缘。 opencv 提供了函数 **cv.filter2D()**&…

springSecurity自定义登陆接口和JWT认证过滤器

下面我会根据该流程图去自定义接口&#xff1a; 我们需要做的任务有&#xff1a; 登陆&#xff1a;1、通过ProviderManager的方法进行认证&#xff0c;生成jwt&#xff1b;2、把用户信息存入redis&#xff1b;3、自定义UserDetailsService实现到数据库查询数据的方法。 校验&a…

PowerShell install 一键部署postgres17

postgres 前言 PostgreSQL 是一个功能强大的开源对象关系数据库系统,拥有超过 35 年的积极开发经验 这为其赢得了可靠性、功能稳健性和性能的良好声誉。 通过官方文档可以找到大量描述如何安装和使用 PostgreSQL 的信息。 开源社区提供了许多有用的地方来熟悉PostgreSQL, 了…

Redis——内存淘汰策略

Redis的淘汰策略是指当Redis内存使用达到上限时&#xff0c;为了腾出空间给新的数据&#xff0c;Redis会根据预设的策略来删除一些现有的数据。以下是Redis的几种主要淘汰策略&#xff1a; 1. noeviction&#xff08;默认&#xff09; 描述&#xff1a;不淘汰任何key&#xf…

如何在 IntelliJ IDEA 中为 Spring Boot 应用实现热部署

文章目录 1. 引言2. 准备工作3. 添加必要的依赖4. 配置 IntelliJ IDEA4.1 启用自动编译4.2 开启热部署策略 5. 测试热部署6. 高级技巧7. 注意事项8. 总结 随着现代开发工具的进步&#xff0c;开发者们越来越重视提高生产力的特性。对于 Java 开发者来说&#xff0c;能够在不重启…

Spring Boot中实现JPA多数据源配置指南

本文还有配套的精品资源&#xff0c;点击获取 简介&#xff1a;本文详细介绍了在Spring Boot项目中配置和使用JPA进行多数据源管理的步骤。从引入依赖开始&#xff0c;到配置数据源、创建DataSource bean、定义实体和Repository&#xff0c;最后到配置事务管理器和使用多数据…