MySQL 数据库之 MMM 高可用架构构建

news2024/10/6 6:41:13

一、MMM 概述

1. 什么是 MMM
  MMM(Master-Master replication manager for MySQL,MySQL 主主复制管理器)是一套支持双主故障切换和双主日常管理的脚本程序。MMM 使用 Perl 语言开发,主要从来监控和管理 MySQL Master-Master(双主)复制,虽然叫做双主复制,但是业务上同一时刻只允许一个主进行写入,另一台备选主上提供部分读服务,以加速在主主切换时备选主的预热,可以说 MMM 这套脚本程序一方面实现了故障切换的功能,另一方面其内部附加的工具也可以实现多个 Slave 的 read 负载均衡。


2. 应用场景

 MMM 提供了自动和手动两种方式移除一组服务器中复制延迟较高的服务器的虚拟 ip,同时它还可以备份数据,实现两节点之间的数据同步等。由于 MMM 无法完全保证数据的一致性,所以 MMM 适用于对数据的一致性要求不是很高的,但是又想最大程度地保证业务可用性的场景。对于那些对数据的一致性要求很高的业务,非常不建议采用 MMM 这种高可用架构。
 

3. MMM 特点

  • MMM 是一套灵活的脚本程序
  • 基于 perl 语言实现
  • 用来对 mysql replication 进行监控和故障迁移
  • 管理 MySQL Master-Master 复制的配置

4. 关于 MMM 高可用架构的说明

 

mmm_mon:监控进程,负责所有的监控工作,决定和处理所有节点角色活动。此脚本需要在监管机上运行。
mmm_agent:运行在每个 MySQL 服务器上的代理进程,完成监控的探针工作和执行简单的远端服务设置。此脚本需要在被监管机上运行。
mmm_control:一个简单的脚本,提供管理 mmm_mond 进程的命令。
mysql-mmm 的监管端会提供多个虚拟 IP(VIP),包括一个可写 VIP,多个可读 VIP,通过监管的管理,这些 IP 会绑定在可用 MySQL 之上,当某一台 MySQL 宕机时,监管会将 VIP 迁移至其他 MySQL。

 

5. 用户及授权


  在整个监管过程中,需要在 MySQL 中添加相关授权 yoghurt,以便让 MySQL 可以支持监理机的维护。授权的用户包括一个 mmm_monitor 用户和一个 mmm_agent 用户,如果想使用 MMM 的备份工具则还需要添加一个 mmm_tools 用户。
 

二、案例环境

1. 服务器配置

 

2. 服务器环境

systemctl stop firewalld && systemctl disable firewalld
setenforce 0
 

3 修改主机名

hostnamectl set-hostname master1
su
 

master1 master2 slave1 slave2 monitor

三、案例实施

1. 搭建 MySQL 多主多从架构

(1) master1、master2、slave1、slave2 节点安装 mysql

(2) 修改 master1 配置文件

[client]
port = 3306
default-character-set=utf8
socket=/usr/local/mysql/mysql.sock

[mysql]
port = 3306
default-character-set=utf8
socket=/usr/local/mysql/mysql.sock
auto-rehash

[mysqld]
user = mysql
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
port = 3306
character-set-server=utf8
pid-file = /usr/local/mysql/mysqld.pid
socket=/usr/local/mysql/mysql.sock
server-id = 1
log-error=/usr/local/mysql/data/mysql_error.log
general_log=ON
general_log_file=/usr/local/mysql/data/mysql_general.log
slow_query_log=ON
slow_query_log_file=mysql_slow_query.log
long_query_time=5
binlog-ignore-db=mysql,information_schema
log_bin=mysql_bin
log_slave_updates=true
sync_binlog=1
innodb_flush_log_at_trx_commit=1
auto_increment_increment=2
auto_increment_offset=1


sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,PIPES_AS_CONCAT,ANSI_QUOTES

重启 mysqld

systemctl restart mysqld
 

参数说明

......
server-id = 1
#每台 Mysql 主机的 server-id 不能相同
log-error=/usr/local/mysql/data/mysql_error.log
#错误日志
general_log=ON
#通用查询日志
general_log_file=/usr/local/mysql/data/mysql_general.log
slow_query_log=ON
#慢查询日志
slow_query_log_file=mysql_slow_query.log
long_query_time=5
binlog-ignore-db=mysql,information_schema
#不需要同步的库名
log_bin=mysql_bin
#开启二进制日志用于主从数据复制
log_slave_updates=true
#允许slave从master复制数据时可以写入到自己的二进制日志
sync_binlog=1
#"双1设置",MySQL 在每写一次二进制日志时都会同步到磁盘中去    
innodb_flush_log_at_trx_commit=1
#"双1设置",每次事务提交时MySQL都会把缓存的数据写入日志文件,并且刷到磁盘中去
auto_increment_increment=2
#自增字段一次递增多少
auto_increment_offset=1
#自增字段的起始值

(3) 修改其他三台 mysql 并重启服务

把配置文件复制到其他 3 台数据库服务器并重启 mysql 服务器

注意:配置文件中的 server-id 不可相同,需要修改

(4) 配置主主复制,两台主服务器相互复制

① 在两台主服务器上都执行授予从的权限,从服务器上不需要执行

master1 服务器(192.168.10.20

mysql> grant replication slave on *.* to 'replication'@'192.168.10.%' identified by '123456';
mysql> flush privileges;

mysql> show master status;
+------------------+----------+--------------+--------------------------+-----------------
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB         | Executed_Gtid_Se
+------------------+----------+--------------+--------------------------+-----------------
| mysql_bin.000001 |     1023 |              | mysql,information_schema |                 
+------------------+----------+--------------+--------------------------+-----------------
1 row in set (0.00 sec)

master2 服务器(192.168.10.30)

mysql> grant replication slave on *.* to 'replication'@'192.168.10.%' identified by '123456';
mysql> flush privileges;

mysql> show master status;
+------------------+----------+--------------+--------------------------+-----------------
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB         | Executed_Gtid_Se
+------------------+----------+--------------+--------------------------+-----------------
| mysql_bin.000001 |     1023 |              | mysql,information_schema |                 
+------------------+----------+--------------+--------------------------+-----------------
1 row in set (0.00 sec)

② 在 master1 上配置同步

192.168.10.20

change master to master_host='192.168.10.30',master_user='replication',master_password='123456',master_log_file='mysql_bin.000001',master_log_pos=1023;

start slave;
show slave status\G;
#查看 IO 和 SQL 线程是不是 YES,位置偏移量对不对

③ 在 master2 上配置同步

192.168.10.30

change master to master_host='192.168.10.20',master_user='replication',master_password='123456',master_log_file='mysql_bin.000001',master_log_pos=1023;

start slave;
show slave status\G;
#查看 IO 和 SQL 线程是不是 YES,位置偏移量对不对

(5) 配置主从复制,在两台从服务器上做

① slave1 服务器

192.168.10.40

change master to master_host='192.168.10.20',master_user='replication',master_password='123456',master_log_file='mysql_bin.000001',master_log_pos=1023;

start slave;
show slave status\G;
 

② slave2 服务器

192.168.10.50

change master to master_host='192.168.10.20',master_user='replication',master_password='123456',master_log_file='mysql_bin.000001',master_log_pos=1023;

start slave;
show slave status\G;
 

(6) 测试主主、主从同步情况

2. 安装配置 MySQL-MMM

(1) 在所有服务器上安装 MySQL-MMM

注:若本地仓库中无以上软件,需先为各服务器配置在线源仓库。

yum -y install epel-release && yum -y install mysql-mmm*
 

(2) 在 master1 上对 MySQL-MMM 进行配置

192.168.10.20

[root@master1 ~]# cd /etc/mysql-mmm/
[root@master1 mysql-mmm]# cp mmm_common.conf mmm_common.conf.bak
#修改配置文件前,先备份
[root@master1 mysql-mmm]# vim mmm_common.conf

active_master_role      writer

<host default>
    cluster_interface       ens33
    pid_path                /run/mysql-mmm-agent.pid
    bin_path                /usr/libexec/mysql-mmm/
    replication_user        replication
##指定主主、主从复制用户,要与前面一致
    replication_password    123456
    agent_user              mmm_agent
##指定monitor代理进程的用户名
    agent_password          123456
</host>

<host db1>
    ip      192.168.10.20
    mode    master
    peer    db2
##peer设置同级数据库
</host>

<host db2>
    ip      192.168.10.30
    mode    master
    peer    db1
</host>

<host db3>
    ip      192.168.10.40
    mode    slave
</host>

<host db4>
    ip      192.168.10.50
    mode    slave
</host>

<role writer>
    hosts   db1, db2
    ips     192.168.10.200
##设定写VIP
    mode    exclusive
#只有一个 host 可以进行写操作模式
</role>

<role reader>
    hosts   db3, db4
    ips     192.168.10.201, 192.168.10.202
##设定读VIP
    mode    balanced
##多个 slave 主机可以进行读操作模式
</role>

(3) 把配置文件复制到其他 4 台主机

所有主机该配置文件内容都是相同的

scp mmm_common.conf root@192.168.10.30:/etc/mysql-mmm/
scp mmm_common.conf root@192.168.10.40:/etc/mysql-mmm/
scp mmm_common.conf root@192.168.10.50:/etc/mysql-mmm/
scp mmm_common.conf root@192.168.10.90:/etc/mysql-mmm/

(4) 修改所有数据库服务器的代理配置文件 mmm_agent.conf

master1

[root@master1 ~]# vim /etc/mysql-mmm/mmm_agent.conf
 
include mmm_common.conf
this db1
##根据不同的主机分别修改为db1/db2/db3/db4,默认配置为db1,因此master1无需修改
 

master2

[root@master2 ~]# vim /etc/mysql-mmm/mmm_agent.conf
 
include mmm_common.conf
this db2

slave1

[root@slave ~]# vim /etc/mysql-mmm/mmm_agent.conf
 
include mmm_common.conf
this db3

slave 2

[root@slave2 ~]# vim /etc/mysql-mmm/mmm_agent.conf
 
include mmm_common.conf
this db4
 

(5) 在 monitor 监控服务器上修改监控配置文件 mmm_mon.conf

monitor 服务器(192.168.10.90)

[root@monitor ~]# vim /etc/mysql-mmm/mmm_mon.conf 

include mmm_common.conf

<monitor>
    ip                  127.0.0.1
    pid_path            /run/mysql-mmm-monitor.pid
    bin_path            /usr/libexec/mysql-mmm
    status_path         /var/lib/mysql-mmm/mmm_mond.status
    ping_ips            192.168.10.20,192.168.10.30,192.168.10.40,192.168.10.50
##指定所有数据库服务器的IP
    auto_set_online     10
##指定自动上线时间

    # The kill_host_bin does not exist by default, though the monitor will
    # throw a warning about it missing.  See the section 5.10 "Kill Host
    # Functionality" in the PDF documentation.
    #
    # kill_host_bin     /usr/libexec/mysql-mmm/monitor/kill_host
    #
</monitor>

<host default>
    monitor_user        mmm_monitor
##指定mmm_monitor的用户名
    monitor_password    123456
##指定mmm_monitor的密码
</host>

debug 0

(6) 在所有数据库上为 mmm_agent(代理进程)授权

所有数据库执行下列语句

grant super,replication client,process on *.* to 'mmm_agent'@'192.168.10.%' identified by '123456';
flush privileges;
 

 (7) 在所有数据库上为 mmm_monitor(监控进程)授权

grant replication client on *.* to 'mmm_monitor'@'192.168.10.%' identified by '123456';
flush privileges;
 

(8) 在所有数据库服务器上启动 mysql-mmm-agent

systemctl start mysql-mmm-agent.service && systemctl enable mysql-mmm-agent.service
 

(9) 在 monitor 服务器上启动 mysql-mmm-monitor

systemctl start mysql-mmm-monitor.service && systemctl enable mysql-mmm-monitor.service
 

(10) 在 monitor 服务器上测试群集

① 查看各节点的情况

[root@monitor ~]#mmm_control show
  db1(192.168.10.20) master/ONLINE. Roles: writer(192.168.10.200)
  db2(192.168.10.30) master/ONLINE. Roles: 
  db3(192.168.10.40) slave/ONLINE. Roles: reader(192.168.10.202)
  db4(192.168.10.50) slave/ONLINE. Roles: reader(192.168.10.201)
 

② 检测监控功能是否完善

[root@monitor ~]#mmm_control checks all
db4  ping         [last change: 2021/11/04 16:13:20]  OK
db4  mysql        [last change: 2021/11/04 16:13:20]  OK
db4  rep_threads  [last change: 2021/11/04 16:13:20]  OK
db4  rep_backlog  [last change: 2021/11/04 16:13:20]  OK: Backlog is null
db2  ping         [last change: 2021/11/04 16:13:20]  OK
db2  mysql        [last change: 2021/11/04 16:13:20]  OK
db2  rep_threads  [last change: 2021/11/04 16:13:20]  OK
db2  rep_backlog  [last change: 2021/11/04 16:13:20]  OK: Backlog is null
db3  ping         [last change: 2021/11/04 16:13:20]  OK
db3  mysql        [last change: 2021/11/04 16:13:20]  OK
db3  rep_threads  [last change: 2021/11/04 16:13:20]  OK
db3  rep_backlog  [last change: 2021/11/04 16:13:20]  OK: Backlog is null
db1  ping         [last change: 2021/11/04 16:13:20]  OK
db1  mysql        [last change: 2021/11/04 16:13:20]  OK
db1  rep_threads  [last change: 2021/11/04 16:13:20]  OK
db1  rep_backlog  [last change: 2021/11/04 16:13:20]  OK: Backlog is null
 

③ 指定绑定 VIP 的主机

[root@monitor ~]#mmm_control move_role writer db2
OK: Role 'writer' has been moved from 'db1' to 'db2'. Now you can wait some time and check new roles info!
[root@monitor ~]#mmm_control show
  db1(192.168.10.20) master/ONLINE. Roles: 
  db2(192.168.10.30) master/ONLINE. Roles: writer(192.168.10.200)
  db3(192.168.10.40) slave/ONLINE. Roles: reader(192.168.10.202)
  db4(192.168.10.50) slave/ONLINE. Roles: reader(192.168.10.201)

[root@monitor ~]#mmm_control move_role writer db1
OK: Role 'writer' has been moved from 'db2' to 'db1'. Now you can wait some time and check new roles info!
[root@monitor ~]#mmm_control show
  db1(192.168.10.20) master/ONLINE. Roles: writer(192.168.10.200)
  db2(192.168.10.30) master/ONLINE. Roles: 
  db3(192.168.10.40) slave/ONLINE. Roles: reader(192.168.10.202)
  db4(192.168.10.50) slave/ONLINE. Roles: reader(192.168.10.201)
 

3. 故障测试

(1) 模拟 master 宕机以及恢复

① 停止 master1 的 mysql 服务

② 查看 VIP 漂移情况

monitor

[root@monitor ~]#mmm_control show
  db1(192.168.10.20) master/HARD_OFFLINE. Roles: 
  db2(192.168.10.30) master/ONLINE. Roles: writer(192.168.10.200)
  db3(192.168.10.40) slave/ONLINE. Roles: reader(192.168.10.202)
  db4(192.168.10.50) slave/ONLINE. Roles: reader(192.168.10.201)
 

VIP 成功漂移至 master2,且 master1 显示 HARD_OFFLINE

③ 重启 master1 的 mysql 服务

master1

systemctl start mysqld
 

master1 恢复后 VIP 仍在 master2 上,并未转移到 master1

(2) 模拟从服务器宕机以及恢复

① 停止 slave1 的 mysql 服务

slave1

systemctl stop mysqld
 

② 查看 VIP 漂移情况

monitor

[root@monitor ~]#mmm_control show
  db1(192.168.10.20) master/ONLINE. Roles: 
  db2(192.168.10.30) master/ONLINE. Roles: writer(192.168.10.200)
  db3(192.168.10.40) slave/HARD_OFFLINE. Roles: 
  db4(192.168.10.50) slave/ONLINE. Roles: reader(192.168.10.201), reader(192.168.10.202)
 

slave1 所对应的的 VIP 被 slave2 接管

③ 重启 slave1 的 mysql 服务

slave1

systemctl start mysqld
 

④ 查看 slave1 是否恢复

monitor

[root@monitor ~]#mmm_control show
  db1(192.168.10.20) master/ONLINE. Roles: 
  db2(192.168.10.30) master/ONLINE. Roles: writer(192.168.10.200)
  db3(192.168.10.40) slave/AWAITING_RECOVERY. Roles: 
  db4(192.168.10.50) slave/ONLINE. Roles: reader(192.168.10.201), reader(192.168.10.202)

[root@monitor ~]#mmm_control show
  db1(192.168.10.20) master/ONLINE. Roles: 
  db2(192.168.10.30) master/ONLINE. Roles: writer(192.168.10.200)
  db3(192.168.10.40) slave/ONLINE. Roles: 
  db4(192.168.10.50) slave/ONLINE. Roles: reader(192.168.10.201), reader(192.168.10.202)

[root@monitor ~]#mmm_control show
  db1(192.168.10.20) master/ONLINE. Roles: 
  db2(192.168.10.30) master/ONLINE. Roles: writer(192.168.10.200)
  db3(192.168.10.40) slave/ONLINE. Roles: reader(192.168.10.202)
  db4(192.168.10.50) slave/ONLINE. Roles: reader(192.168.10.201)
 

在一段时间的交接后,slave1 重新获取到 VIP,继续工作

(3) 客户端测试

① 在 master1 服务器上为 monitor 服务器地址授权登录

grant all on *.* to 'test'@'192.168.10.90' identified by '123456';
flush privileges;
 

② 在 monitor 服务器上使用 VIP 登录

yum -y install mariadb-server mariadb
systemctl start mariadb.service && systemctl enable mariadb.service
mysql -utest -p123456 -h 192.168.10.200        #能登录则成功
 

③ 客户端创建数据,测试同步情况

monitor

 

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

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

相关文章

工厂模式中简单工厂模式、工厂方法模式、抽象工厂模式的分析与总结

工厂模式 工厂模式有许多变体,其中最常见的有三种 简单工厂模式工厂方法模式抽象工厂模式 简单工厂代码分析 UML图中我们可以清晰的看到代码结构 ,首先我们创建一个Car的汽车接口,定制汽车的基本规范,汽车可以的方法是可以跑,所以我们定义了一个抽象的run方法. 定义汽车接口…

【sed编辑器】

目录 一、sed编辑器二、sed的命令格式操作命令1.1、命令演示 二、替换三、插入 一、sed编辑器 1、sed是一种流编辑器&#xff0c;流编辑器会在编辑器处理数据之前基于预先提供的一组规则来编辑数据流。 2、sed编辑器可以根据命令来处理数据流中的数据&#xff0c;这些命令要么…

OSC Liblo Window10配置

OpenSoundControl一种网络通讯协议&#xff0c;想了解详情的自行打开网站。 liblo 是最知名的OSC库&#xff0c; 功能完整&#xff0c;用 C 和 LGPL 许可编写。 下载请前往GitHub库。 解压后安装过程如下&#xff0c;需要用到CMake&#xff1a; 1.选择源代码文件和构建工程的文…

一文读懂“生成式 AI”

一、前言 本文基于谷歌的&#xff1a;《Introduction to Generative AI》 并且借助 ChatGPT 整理而成&#xff0c;帮助大家理解生成式 AI 这个概念。 主要包括 4 个部分&#xff1a; 生成式 AI 的定义生成式 AI 的工作原理生成式 AI 模型的分类生成式 AI 的应用 二、生成式…

【数据结构】双向带头循环链表的实现

目录 全部代码 图例&#xff08;双向带头循环链表&#xff09; 各个功能的实现 创建该链表的节点 创建初始链表 链表的头插 链表的尾插 链表的随机插入 链表的头删 链表的尾删 链表的随机删除 链表的销毁 链表是否为空的判断 链表节点的创建 总结 全部代码 typ…

命令行更新Windows

命令行更新Windows powershell命令行更新安装 Windows Update module for Windows Powershell连接到 Windows Update 服务器并下载更新安装下载好的 Windows Update 更新 cmd执行Windows update更新检查更新下载 Windows Update 更新安装更新安装更新后重新启动设备 win10以下版…

Python中Pandas库的相关操作

目录 Pandas库 常用操作 创建DataFrame 查看数据 数据选择和过滤 数据排序和排名 缺失数据处理 数据聚合和分组 数据的合并和连接 Pandas库 Pandas是Python中常用的数据处理和分析库&#xff0c;它提供了高效、灵活且易于使用的数据结构和数据分析工具。 1.Series&a…

实例35---字符串反转,如将字符串 “www.runoob.com“ 反转为 “moc.boonur.www“。

文章目录 前言一、题目描述 二、题目分析 三、解题 1.解题方法一--- for循环来将字符的下标数值进行对每一个字符进行交换 ---程序运行代码 2.解题方法二------ 指针 ------ 程序运行代码(1)程序运行代码优化 总结 前言 本系列为C语言菜鸟100道基础经典例题详解刷题系列。点滴…

微服务:服务发现

1. 服务发现 eureka、nacos、Consul、etcd 和 zk 都是主流的服务发现工具&#xff0c;而 Dubbo 和 Polaris Mesh 则是基于服务发现的 RPC 框架。 它们的主要区别在于&#xff1a; eureka 是 Netflix 开源的一个服务发现组件&#xff0c;支持高可用和数据同步&#xff0c;具有…

如何使用Linkage Mapper揭示栖息地变化的故事

✅创作者:陈书予 🎉个人主页:陈书予的个人主页 🍁陈书予的个人社区,欢迎你的加入: 陈书予的社区 🌟专栏地址: Linkage Mapper解密数字世界链接 文章目录 引言1.1 定义和作用1.2 Linkage Mapper的历史和发展2.1 揭示栖息地变化的重要性2.2 Linkage Mapper的优势和不足

Windows下载安装RocketMq

Windows下载安装RocketMq 下载安装包启动NAMESERVER 和 BROKER启动NAMESERVER启动BROKER 安装可视化插件 下载安装包 RockitMQ官网下载地址&#xff1a;https://rocketmq.apache.org/release-notes/ 解压到指定的文件夹下 先配置JAVA_HOME 配置ROCKETMQ_HOME环境变量 …

使用Maple的Python API :OpenMaple(Windows下的解决方案)

在Maple 2023&#xff08;按照软件文档&#xff0c;Maple 2018及以上版本均适用&#xff1b;我目前测试的版本为2023&#xff09;的安装目录下&#xff0c;有软件附带的解释器&#xff0c;如D:\Program Files\Maple 2023\Python.X86_64_WINDOWS\Python.exe。这一Python解释器的…

Python中NumPy库的相关操作

目录 NumPy库 常用操作 创建数组 数组属性 索引和切片 数组运算 数组重塑 NumPy库 NumPy&#xff08;Numerical Python&#xff09;是Python中常用的数值计算库&#xff0c;它提供了高性能的多维数组对象和对数组进行操作的函数。 1.多维数组对象&#xff08;ndarray&…

Java 课程设计 —— 扫雷

一、团队课程设计博客链接&#xff1a; https://www.cnblogs.com/luomeili/p/10280310.html 二、个人负责模块或任务说明&#xff1a; 模块&#xff1a;文件操作 Minefield 类实现 三、自己的代码提交记录截图 四、自己负责模块或任务详细说明 1.Minefield 类实现 Minefie…

Java中的CountDownLatch和CyclicBarrier有什么作用?

在Java并发编程中&#xff0c;CountDownLatch和CyclicBarrier是两个非常有用的工具&#xff0c;它们可以帮助我们更加方便地进行线程通信和协作。在本文中&#xff0c;我将从面试的角度&#xff0c;详细讲解Java中的CountDownLatch和CyclicBarrier的概念、作用和实现方式&#…

基于卷积的图像分类识别(六):DenseNet FractalNet

系列文章目录 本专栏介绍基于深度学习进行图像识别的经典和前沿模型&#xff0c;将持续更新&#xff0c;包括不仅限于&#xff1a;AlexNet&#xff0c; ZFNet&#xff0c;VGG&#xff0c;GoogLeNet&#xff0c;ResNet&#xff0c;DenseNet&#xff0c;SENet&#xff0c;MobileN…

如何搭建自己的git服务器

GitHub&#xff0c;Gitee 想来大家都用过&#xff0c;我们的代码就是托管在这些平台上的。因此&#xff0c;你可能好奇为什么我们不自己搭建一个 git 呢服务器&#xff1f;下面&#xff0c;就开始教大家如何一步步搭建自己的 git 服务器&#xff08;试验成功的那一刻还是很让人…

Java 中 ArrayList 和 LinkedList 有什么区别

在Java中&#xff0c;ArrayList和LinkedList是两种常见的集合类。它们都实现了List接口&#xff0c;提供了类似数组的功能&#xff0c;可以存储任意类型的对象。虽然它们都可以实现相同的功能&#xff0c;但是它们的底层实现方式有所不同&#xff0c;因此在性能和用途上也存在一…

dom4j解析XML文件

主要为了讲解Mybatis中如何用dom4j解析XML,这里当作dom4j解析.XML文件的练习 引入mybatis配置文件和一个.xml文件 都是.xml <?xml version"1.0" encoding"UTF-8" ?> <!DOCTYPE configurationPUBLIC "-//mybatis.org//DTD Config 3.0//EN…

【C++】| 04——STL | 容器_vector

系列文章目录 【C】| 01——泛型编程 | 模板 【C】| 02——STL | 初识 【C】| 03——STL | 迭代器 【C】| 04——STL | 容器_vector 文章目录 1. vector容器2. vector库2.1 迭代器相关函数2.1 ww 1. vector容器 vector 与 动态数组 相似&#xff0c;可以自动调节自身大小。元素…