TiDB v8.5.3 单机集群部署指南

前言

最近在做 TiDB 的恢复演练,需要在单台 Linux 服务器上部署一套 TiDB 最小的完整拓扑的集群,本文记录一下安装过程。

环境准备

开始部署 TiDB 集群前,准备一台部署主机,确保其软件满足需求:

  • 推荐安装 CentOS 7.3 及以上版本
  • 运行环境可以支持互联网访问,用于下载 TiDB 及相关软件安装包

注意:TiDB 从 v8.5.1 版本起重新适配 glibc 2.17,恢复了对 CentOS Linux 7 的兼容性支持。

环境信息

最小规模的 TiDB 集群拓扑包含以下实例:

组件数量IP端口配置
PD1192.168.31.792379/2380
TiDB1192.168.31.794000/10080
TiKV3192.168.31.7920160-20162/20180-20182
TiFlash1192.168.31.799000/3930/20170/20292/8234/8123
Prometheus1192.168.31.799090/12020
Grafana1192.168.31.793000

安装依赖库

编译和构建 TiDB 所需的依赖库:

  • Golang 1.23 及以上版本
  • Rust nightly-2023-12-28 及以上版本
  • LLVM 17.0 及以上版本
  • sshpass 1.06 及以上
  • GCC 7.x(不满足)
  • glibc 2.28-151.el8 版本(不满足)

下载所需依赖包:

  • Rust 下载地址:https://forge.rust-lang.org/infra/other-installation-methods.html
  • Golang 下载地址:https://go.dev/dl/
  • sshpass 下载地址:https://sourceforge.net/projects/sshpass/files/latest/download

Golang 安装:

[root@test soft]# tar -C /usr/local -xf go1.25.0.linux-amd64.tar.gz
[root@test ~]# cat<<-\EOF>>/root/.bash_profile
export PATH=$PATH:/usr/local/go/bin
EOF
[root@test ~]# source /root/.bash_profile
[root@test ~]# go version
go version go1.25.0 linux/amd64

Rust 安装:

[root@test soft]# tar -xf rust-1.89.0-x86_64-unknown-linux-gnu.tar.tar
[root@test soft]# cd rust-1.89.0-x86_64-unknown-linux-gnu/
[root@test rust-1.89.0-x86_64-unknown-linux-gnu]# ./install.sh
[root@test ~]# rustc --version
rustc 1.89.0 (29483883e 2025-08-04)

sshpass 安装:

[root@test soft]# tar -xf sshpass-1.10.tar.gz
[root@test soft]# cd sshpass-1.10/
[root@test sshpass-1.10]# ./configure && make && make install
[root@test ~]# sshpass -V
sshpass 1.10

关闭防火墙

[root@test ~]# systemctl stop firewalld.service
[root@test ~]# systemctl disable firewalld.service
[root@test ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: inactive (dead)Docs: man:firewalld(1)

检测及关闭 swap

[root@test ~]# echo "vm.swappiness = 0">> /etc/sysctl.conf
[root@test ~]# swapoff -a
[root@test ~]# sysctl -p
vm.swappiness = 0

记得修改 /etc/fstab 配置,注释掉 swap 分区:

#/dev/mapper/centos-swap swap                    swap    defaults        0 0

检查和配置操作系统优化参数

[root@test ~]# echo never > /sys/kernel/mm/transparent_hugepage/enabled
[root@test ~]# echo never > /sys/kernel/mm/transparent_hugepage/defrag
[root@test ~]# cat<<EOF>>/etc/sysctl.conf
fs.file-max = 1000000
net.core.somaxconn = 32768
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_syncookies = 0
vm.overcommit_memory = 1
EOF[root@test ~]# sysctl -p[root@test ~]# cat<<EOF>>/etc/security/limits.conf
tidb soft nofile 1000000
tidb hard nofile 1000000
tidb soft stack 32768
tidb hard stack 32768
EOF

调整 MaxSessions

由于模拟多机部署,需要通过 root 用户调大 sshd 服务的连接数限制:

[root@test ~]# vim /etc/ssh/sshd_config
## 调整 MaxSessions 20
[root@test ~]# systemctl restart sshd.service

创建 TiDB 用户

[root@test ~]# useradd tidb
[root@test ~]# echo "Tidb@123" |passwd tidb --stdin
Changing password for user tidb.
passwd: all authentication tokens updated successfully.
[root@test ~]# cat<<-EOF>>/etc/sudoers
tidb ALL=(ALL) NOPASSWD: ALL
EOF

实施部署

本文是内网环境,不使用官方在线源安装,使用本地镜像源进行部署,本地镜像源部署请参考:TiDB 离线部署 TiUP 组件。

tiup 已部署完成:

[root@test ~]# tiup mirror show
/root/tidb-community-server-v8.5.3-linux-amd64[root@test ~]# tiup --version
1.16.2 tiup
Go Version: go1.21.13
Git Ref: v1.16.2
GitHash: 678c52de0c0ef30634b8ba7302a8376caa95d50d

创建并启动集群:

[root@test ~]# cat<<-\EOF>topo.yaml
# # Global variables are applied to all deployments and used as the default value of
# # the deployments if a specific deployment value is missing.
global:user: "tidb"ssh_port: 11122deploy_dir: "/data/tidb-deploy"data_dir: "/data/tidb-data"# # Monitored variables are applied to all the machines.
monitored:node_exporter_port: 9100blackbox_exporter_port: 9115server_configs:tidb:instance.tidb_slow_log_threshold: 300tikv:readpool.storage.use-unified-pool: falsereadpool.coprocessor.use-unified-pool: truepd:replication.enable-placement-rules: truereplication.location-labels: ["host"]tiflash:logger.level: "info"pd_servers:- host: 192.168.31.79tidb_servers:- host: 192.168.31.79tikv_servers:- host: 192.168.31.79port: 20160status_port: 20180config:server.labels: { host: "logic-host-1" }- host: 192.168.31.79port: 20161status_port: 20181config:server.labels: { host: "logic-host-2" }- host: 192.168.31.79port: 20162status_port: 20182config:server.labels: { host: "logic-host-3" }tiflash_servers:- host: 192.168.31.79monitoring_servers:- host: 192.168.31.79grafana_servers:- host: 192.168.31.79
EOF

安装前预检查:

[root@test ~]# tiup cluster check topo.yaml --user root -p
Input SSH password:+ Detect CPU Arch Name- Detecting node 192.168.31.79 Arch info ... Done+ Detect CPU OS Name- Detecting node 192.168.31.79 OS info ... Done
+ Download necessary tools- Downloading check tools for linux/amd64 ... Done
+ Collect basic system information
+ Collect basic system information- Getting system info of 192.168.31.79:11122 ... Done
+ Check time zone- Checking node 192.168.31.79 ... Done
+ Check system requirements
+ Check system requirements
+ Check system requirements
+ Check system requirements- Checking node 192.168.31.79 ... Done- Checking node 192.168.31.79 ... Done- Checking node 192.168.31.79 ... Done- Checking node 192.168.31.79 ... Done- Checking node 192.168.31.79 ... Done- Checking node 192.168.31.79 ... Done- Checking node 192.168.31.79 ... Done- Checking node 192.168.31.79 ... Done- Checking node 192.168.31.79 ... Done
+ Cleanup check files- Cleanup check files on 192.168.31.79:11122 ... Done
Node          Check         Result  Message
----          -----         ------  -------
192.168.31.79  os-version    Fail    CentOS Linux 7 (Core) 7.9.2009 not supported, use version 9 or higher
192.168.31.79  cpu-cores     Pass    number of CPU cores / threads: 4
192.168.31.79  ntp           Warn    The NTPd daemon may be not start
192.168.31.79  disk          Warn    mount point /data does not have 'noatime' option set
192.168.31.79  selinux       Pass    SELinux is disabled
192.168.31.79  thp           Pass    THP is disabled
192.168.31.79  command       Pass    numactl: policy: default
192.168.31.79  cpu-governor  Warn    Unable to determine current CPU frequency governor policy
192.168.31.79  memory        Pass    memory size is 8192MB
192.168.31.79  network       Pass    network speed of ens192 is 10000MB
192.168.31.79  disk          Fail    multiple components tikv:/data/tidb-data/tikv-20160,tikv:/data/tidb-data/tikv-20161,tikv:/data/tidb-data/tikv-20162,tiflash:/data/tidb-data/tiflash-9000 are using the same partition 192.168.31.79:/data as data dir
192.168.31.79  disk          Fail    mount point /data does not have 'nodelalloc' option set

部署集群:

[root@test ~]# tiup cluster deploy lucifer v8.5.3 topo.yaml --user root -p
Input SSH password:+ Detect CPU Arch Name- Detecting node 192.168.31.79 Arch info ... Done+ Detect CPU OS Name- Detecting node 192.168.31.79 OS info ... Done
Please confirm your topology:
Cluster type:    tidb
Cluster name:    lucifer
Cluster version: v8.5.3
Role        Host          Ports                            OS/Arch       Directories
----        ----          -----                            -------       -----------
pd          192.168.31.79  2379/2380                        linux/x86_64  /data/tidb-deploy/pd-2379,/data/tidb-data/pd-2379
tikv        192.168.31.79  20160/20180                      linux/x86_64  /data/tidb-deploy/tikv-20160,/data/tidb-data/tikv-20160
tikv        192.168.31.79  20161/20181                      linux/x86_64  /data/tidb-deploy/tikv-20161,/data/tidb-data/tikv-20161
tikv        192.168.31.79  20162/20182                      linux/x86_64  /data/tidb-deploy/tikv-20162,/data/tidb-data/tikv-20162
tidb        192.168.31.79  4000/10080                       linux/x86_64  /data/tidb-deploy/tidb-4000
tiflash     192.168.31.79  9000/3930/20170/20292/8234/8123  linux/x86_64  /data/tidb-deploy/tiflash-9000,/data/tidb-data/tiflash-9000
prometheus  192.168.31.79  9090/12020                       linux/x86_64  /data/tidb-deploy/prometheus-9090,/data/tidb-data/prometheus-9090
grafana     192.168.31.79  3000                             linux/x86_64  /data/tidb-deploy/grafana-3000
Attention:1. If the topology is not what you expected, check your yaml file.2. Please confirm there is no port/directory conflicts in same host.
Do you want to continue? [y/N]: (default=N) y
+ Generate SSH keys ... Done
+ Download TiDB components- Download pd:v8.5.3 (linux/amd64) ... Done- Download tikv:v8.5.3 (linux/amd64) ... Done- Download tidb:v8.5.3 (linux/amd64) ... Done- Download tiflash:v8.5.3 (linux/amd64) ... Done- Download prometheus:v8.5.3 (linux/amd64) ... Done- Download grafana:v8.5.3 (linux/amd64) ... Done- Download node_exporter: (linux/amd64) ... Done- Download blackbox_exporter: (linux/amd64) ... Done
+ Initialize target host environments- Prepare 192.168.31.79:11122 ... Done
+ Deploy TiDB instance- Copy pd -> 192.168.31.79 ... Done- Copy tikv -> 192.168.31.79 ... Done- Copy tikv -> 192.168.31.79 ... Done- Copy tikv -> 192.168.31.79 ... Done- Copy tidb -> 192.168.31.79 ... Done- Copy tiflash -> 192.168.31.79 ... Done- Copy prometheus -> 192.168.31.79 ... Done- Copy grafana -> 192.168.31.79 ... Done- Deploy node_exporter -> 192.168.31.79 ... Done- Deploy blackbox_exporter -> 192.168.31.79 ... Done
+ Copy certificate to remote host
+ Init instance configs- Generate config pd -> 192.168.31.79:2379 ... Done- Generate config tikv -> 192.168.31.79:20160 ... Done- Generate config tikv -> 192.168.31.79:20161 ... Done- Generate config tikv -> 192.168.31.79:20162 ... Done- Generate config tidb -> 192.168.31.79:4000 ... Done- Generate config tiflash -> 192.168.31.79:9000 ... Done- Generate config prometheus -> 192.168.31.79:9090 ... Done- Generate config grafana -> 192.168.31.79:3000 ... Done
+ Init monitor configs- Generate config node_exporter -> 192.168.31.79 ... Done- Generate config blackbox_exporter -> 192.168.31.79 ... Done
Enabling component pdEnabling instance 192.168.31.79:2379Enable instance 192.168.31.79:2379 success
Enabling component tikvEnabling instance 192.168.31.79:20162Enabling instance 192.168.31.79:20160Enabling instance 192.168.31.79:20161Enable instance 192.168.31.79:20162 successEnable instance 192.168.31.79:20161 successEnable instance 192.168.31.79:20160 success
Enabling component tidbEnabling instance 192.168.31.79:4000Enable instance 192.168.31.79:4000 success
Enabling component tiflashEnabling instance 192.168.31.79:9000Enable instance 192.168.31.79:9000 success
Enabling component prometheusEnabling instance 192.168.31.79:9090Enable instance 192.168.31.79:9090 success
Enabling component grafanaEnabling instance 192.168.31.79:3000Enable instance 192.168.31.79:3000 success
Enabling component node_exporterEnabling instance 192.168.31.79Enable 192.168.31.79 success
Enabling component blackbox_exporterEnabling instance 192.168.31.79Enable 192.168.31.79 success
Cluster `lucifer` deployed successfully, you can start it with command: `tiup cluster start lucifer --init`

启动集群:

[root@test ~]# tiup cluster start lucifer --init
Starting cluster lucifer...
+ [ Serial ] - SSHKeySet: privateKey=/root/.tiup/storage/cluster/clusters/lucifer/ssh/id_rsa, publicKey=/root/.tiup/storage/cluster/clusters/lucifer/ssh/id_rsa.pub
+ [Parallel] - UserSSH: user=tidb, host=192.168.31.79
+ [Parallel] - UserSSH: user=tidb, host=192.168.31.79
+ [Parallel] - UserSSH: user=tidb, host=192.168.31.79
+ [Parallel] - UserSSH: user=tidb, host=192.168.31.79
+ [Parallel] - UserSSH: user=tidb, host=192.168.31.79
+ [Parallel] - UserSSH: user=tidb, host=192.168.31.79
+ [Parallel] - UserSSH: user=tidb, host=192.168.31.79
+ [Parallel] - UserSSH: user=tidb, host=192.168.31.79
+ [ Serial ] - StartCluster
Starting component pdStarting instance 192.168.31.79:2379Start instance 192.168.31.79:2379 success
Starting component tikvStarting instance 192.168.31.79:20162Starting instance 192.168.31.79:20160Starting instance 192.168.31.79:20161Start instance 192.168.31.79:20162 successStart instance 192.168.31.79:20161 successStart instance 192.168.31.79:20160 success
Starting component tidbStarting instance 192.168.31.79:4000Start instance 192.168.31.79:4000 success
Starting component tiflashStarting instance 192.168.31.79:9000Start instance 192.168.31.79:9000 success
Starting component prometheusStarting instance 192.168.31.79:9090Start instance 192.168.31.79:9090 success
Starting component grafanaStarting instance 192.168.31.79:3000Start instance 192.168.31.79:3000 success
Starting component node_exporterStarting instance 192.168.31.79Start 192.168.31.79 success
Starting component blackbox_exporterStarting instance 192.168.31.79Start 192.168.31.79 success
+ [ Serial ] - UpdateTopology: cluster=lucifer
Started cluster `lucifer` successfully
The root password of TiDB database has been changed.
The new password is: 'm+92G0Q3eNR4^6cq*@'.
Copy and record it to somewhere safe, it is only displayed once, and will not be stored.
The generated password can NOT be get and shown again.

查看集群:

[root@test ~]# tiup cluster list
Name      User  Version  Path                                           PrivateKey
----      ----  -------  ----                                           ----------
lucifer  tidb  v8.5.3   /root/.tiup/storage/cluster/clusters/lucifer  /root/.tiup/storage/cluster/clusters/lucifer/ssh/id_rsa

检查集群状态:

[root@test ~]# tiup cluster display lucifer
Cluster type:       tidb
Cluster name:       lucifer
Cluster version:    v8.5.3
Deploy user:        tidb
SSH type:           builtin
Dashboard URL:      http://192.168.31.79:2379/dashboard
Dashboard URLs:     http://192.168.31.79:2379/dashboard
Grafana URL:        http://192.168.31.79:3000
ID                  Role        Host          Ports                            OS/Arch       Status   Data Dir                         Deploy Dir
--                  ----        ----          -----                            -------       ------   --------                         ----------
192.168.31.79:3000   grafana     192.168.31.79  3000                             linux/x86_64  Up       -                                /data/tidb-deploy/grafana-3000
192.168.31.79:2379   pd          192.168.31.79  2379/2380                        linux/x86_64  Up|L|UI  /data/tidb-data/pd-2379          /data/tidb-deploy/pd-2379
192.168.31.79:9090   prometheus  192.168.31.79  9090/12020                       linux/x86_64  Up       /data/tidb-data/prometheus-9090  /data/tidb-deploy/prometheus-9090
192.168.31.79:4000   tidb        192.168.31.79  4000/10080                       linux/x86_64  Up       -                                /data/tidb-deploy/tidb-4000
192.168.31.79:9000   tiflash     192.168.31.79  9000/3930/20170/20292/8234/8123  linux/x86_64  Up       /data/tidb-data/tiflash-9000     /data/tidb-deploy/tiflash-9000
192.168.31.79:20160  tikv        192.168.31.79  20160/20180                      linux/x86_64  Up       /data/tidb-data/tikv-20160       /data/tidb-deploy/tikv-20160
192.168.31.79:20161  tikv        192.168.31.79  20161/20181                      linux/x86_64  Up       /data/tidb-data/tikv-20161       /data/tidb-deploy/tikv-20161
192.168.31.79:20162  tikv        192.168.31.79  20162/20182                      linux/x86_64  Up       /data/tidb-data/tikv-20162       /data/tidb-deploy/tikv-20162
Total nodes: 8

安装 MySQL 客户端

TiDB 兼容 MySQL 协议,故需要 MySQL 客户端连接,则需安装 MySQL 客户端,Linux7 版本的系统默认自带安装了 MariaDB,需要先清理:

[root@test ~]# rpm -e --nodeps $(rpm -qa | grep mariadb)

找个有网的环境下载:

[root@lucifer ~]# wget https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
[root@lucifer ~]# wget http://dev.mysql.com/get/mysql80-community-release-el7-10.noarch.rpm

安装 MySQL 客户端:

[root@test ~]# yum -y install mysql80-community-release-el7-10.noarch.rpm
[root@test ~]# rpm --import RPM-GPG-KEY-mysql-2023
[root@test ~]# yum -y install mysql

连接数据库:

## 这里的 root 初始密码在 tidb 集群初始化时日志中输出的密码 m+92G0Q3eNR4^6cq*@
[root@test ~]# mysql -h 192.168.31.79 -P 4000 -uroot –p
mysql> show databases;

修改初始 root 密码:

mysql> use mysql
mysql> alter user 'root'@'%' identified by 'tidb';

集群监控:

  • Dashboard:http://192.168.31.79:2379/dashboard (使用 root/tidb 登录)
  • Grafana:http://192.168.31.79:3000 (默认密码:admin/admin)

写在最后

至此,TiDB 单机集群部署完成,可用于开发测试和学习研究。生产环境建议参考官方推荐的多机部署方案。

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

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

相关文章

ClickHouse常见问题——ClickHouseKeeper配置listen_host后不生效

ClickHouseKeeper配置listen_host后不生效ClickHouseKeeper配置listen_host后不生效ClickHouseKeeper配置listen_host后不生效 3节点部署ClickHouse集群后&#xff0c;ClickHouse Server执行报错&#xff1a; Poco::Exception. Code: 1000, e.code() 111, Connection refuse…

《Python × MongoDB 实战指南:从连接到查询,构建高效数据操作流程》

《Python MongoDB 实战指南:从连接到查询,构建高效数据操作流程》 一、引言:当 Python 遇上 MongoDB 在当今数据驱动的开发世界里,MongoDB 以其灵活的文档结构、强大的查询能力和良好的扩展性,成为 NoSQL 数据库中的佼佼者。而 Python,作为一门简洁优雅、生态丰富的编…

【Flask + Vue3 前后端分离管理系统】

Flask Vue3 前后端分离管理系统 项目概述 本项目是一个基于 Flask 后端和 Vue3 前端的前后端分离管理系统。项目实现了用户管理、角色管理、菜单管理、权限控制等完整的后台管理功能。 技术栈 后端技术栈&#xff1a; Flask 3.0.0 - Python Web框架Flask-SQLAlchemy 3.1.1 - O…

51c视觉~3D~合集5

自己的原文哦~ https://blog.51cto.com/whaosoft/14165531 #AnimateAnyMesh 文本驱动通用网格动画新范式&#xff0c;实现高效高质量4D内容生成 4D 内容生成&#xff0c;即包含时间维度信息的 3D 内容创建&#xff0c;在 VR/AR、游戏等领域具有广阔的应用前景。…

开悟篇Docker从零到实战一篇文章搞定

目录 一:概述 1:why docker 2:Docker是什么? 3:Docker核心概念 二:初步体验 1:Docker核心架构图 2:准备工作 1:服务器 2:Docker安装 3:阿里云docker安装 4:镜像加速 三:Docker命令和帮助文档的使用 1:帮助文档 2:镜像的基本操作 1:查看本地…

LINUX驱动篇(二)驱动开发

系列文章目录 文章目录系列文章目录总结介绍字符设备驱动工作原理驱动框架加载卸载注册注销设备号详解打开关闭等操作实例分析led驱动编写地址映射LED驱动改进驱动方式总结自动注册注销设备号自动创建设备节点设备树设备树LED驱动实验pinctrl和gpio并发和竞争原子操作自旋锁块设…

【工具】开源大屏设计器 自用整理

【工具】开源大屏设计器 自用整理 GoView低代码数据可视化 GoView 说明文档 | 低代码数据可视化开发平台 JimuReport积木报表(免费报表工具) https://github.com/jeecgboot/JimuReport 「数据可视化&#xff1a;报表、大屏、数据看板」积木报表是一款类Excel操作风格&#xf…

.NetCore MVC

这个是我自己记得笔记&#xff0c;最好有点基础看我的。 html 辅助标签 Html.DropList 分布视图 使用 RenderPartialAsync 呈现分部视图。 此方法不返回 IHtmlContent。 它将呈现的输出直接流式传输到响应。 因为该方法不返回结果&#xff0c;所以必须在 Razor 代码块内调用它…

@GitLab 介绍部署使用详细指南

文章目录**GitLab 介绍&部署&使用详细指南****1. GitLab 介绍与核心概念****1.1 什么是 GitLab&#xff1f;****1.2 核心特性****1.3 版本区别****2. 部署指南 (以 Ubuntu 22.04 LTS 为例)****2.1 环境准备****2.2 安装步骤****2.3 重要配置文件****3. 基本使用入门***…

如何通过 AI IDE 集成开发工具快速生成简易留言板系统

在当今快速迭代的软件开发环境中&#xff0c;AI 辅助编程工具已经成为开发者提高效率的重要手段。本文将详细介绍如何利用 AI IDE 集成开发工具快速构建一个功能完整的简易留言板系统&#xff0c;涵盖从需求分析到部署上线的全过程&#xff0c;并提供完整代码、流程图、Prompt …

机器学习:从技术原理到实践应用的深度解析

目录引言一.什么是机器学习&#xff08;ML&#xff09;&#xff1f;——从技术本质到核心目标1.与传统编程的本质区别&#xff1a;规则的“来源不同”2.核心目标&#xff1a;在“偏差-方差权衡”下优化性能指标二.机器学习的核心分类——基于“数据标签”与“学习范式”的技术划…

[muduo网络库]-muduo库TcpServer类解析

本贴用于记录muduo库的学习过程&#xff0c;以下是关于TcpServer的个人理解。 TcpServer内含Acceptor、threadpool等类&#xff0c;算是把主线程所有要做的事封装了起来。 重要成员变量 EventLoop *loop_; // baseloop 用户自定义的loopconst std::string ipPort_;const std…

工作两年,最后从css转向tailwind了!

菜鸟上班已经两年了&#xff0c;从一个对技术充满热情的小伙子&#xff0c;变成了一个职场老鸟了。自以为自己在不停的学习&#xff0c;但是其实就是学一些零碎的知识点&#xff0c;比如&#xff1a;vue中什么东西没见过、js什么特性没用过、css新出了个啥 …… 菜鸟感觉自己也…

macOS 更新后找不到钥匙串访问工具的解决方案

macOS 更新后找不到钥匙串访问工具的解决方案 随着macOS的不断更新&#xff0c;一些系统工具的位置可能会发生变化&#xff0c;给用户带来不便。钥匙串访问&#xff08;Keychain Access&#xff09;是macOS中一个非常重要的工具&#xff0c;用于管理密码、证书等敏感信息。最近…

深入理解Go 与 PHP 在参数传递上的核心区别

$run_return_data []; $ret $this->handleData($event_req_info, $run_return_data); public function handleData($event_req_info, &$run_return_data): array {$run_return_data [ //使用引用变量返回数据shop_id > $shop_id,request_id > $request_…

【Dify智能体】2025 最新版Linux部署Dify教程(Ubuntu)

一、前言 Dify 是一款开源的智能体工作流平台,可以用来快速构建 AI 应用。相比手动搭建复杂的依赖环境,Docker Compose 部署方式更简单、更快速、更稳定。本文将一步步带你在 Ubuntu 22.04 + Docker Compose v2 上安装 Dify,并给出常见问题与优化方案。 ps:如果还没有安装…

基础思想:动态规划与贪心算法

一、动态规划核心思想&#xff1a;将复杂问题分解为相互重叠的子问题&#xff0c;通过保存子问题的解来避免重复计算&#xff08;记忆化&#xff09;。动态规划需要通过子问题的最优解&#xff0c;推导出最终问题的最优解&#xff0c;因此这种方法特别注重子问题之间的转移关系…

使用生成对抗网络增强网络入侵检测性能

文章目录前言一、GAN 模型介绍二、研究方法1.数据集选择与处理2.IDS 基线模型构建3. GAN 模型设计与样本生成4.生成样本质量评估三、实验评估四、总结前言 网络入侵检测系统&#xff08;Network Intrusion Detection System, NIDS&#xff09;在保护关键数字基础设施免受网络威…

VR森林经营模拟体验带动旅游经济发展

将VR森林经营模拟体验作为一种独特的旅游项目&#xff0c;正逐渐成为旅游市场的新热点。游客们无需长途跋涉前往深山老林&#xff0c;只需在旅游景区的VR体验中心&#xff0c;戴上VR设备&#xff0c;就能开启一场奇妙的森林之旅。在虚拟森林中&#xff0c;他们可以尽情探索&…

Vue2存量项目国际化改造踩坑

Vue2存量项目国际化改造踩坑 一、背景 在各类业务场景中&#xff0c;国际化作为非常重要的一部分已经有非常多成熟的方案&#xff0c;但对于一些存量项目则存在非常的改造成本&#xff0c;本文将分享一个的Vue2项目国际化改造方案&#xff0c;通过自定义Webpack插件自动提取中文…