LNMP部署wordpress
1.环境准备
总体架构介绍
序号 | 类型 | 名称 | 外网地址 | 内网地址 | 软件 |
02 | 负载均衡服务器 | lb01 | 10.0.0.5 | 192.168.88.5 | nginx keepalived |
03 | 负载均衡服务器 | lb02 | 10.0.0.6 | 192.168.88.6 | nginx keepalived |
04 | web服务器 | web01 | 10.0.0.7 | 192.168.88.7 | nginx |
05 | web服务器 | web02 | 10.0.0.8 | 192.168.88.8 | nginx |
06 | web服务器 | web03 | 10.0.0.9 | 192.168.88.9 | nginx |
07 | 数据库服务器 | db01 | 10.0.0.51 | 192.168.88.51 | mariadb mysql |
08 | 存储服务器 | nfs01 | 10.0.0.31 | 192.168.88.31 | nfs-utils rpcbind |
09 | 备份服务器 | backup | 10.0.0.41 | 192.168.88.41 | rsync |
10 | 批量管理服务器 | m01 | 10.0.0.61 | 192.168.88.61 | ansible |
11 | 跳板机服务器 | jumpserver | 10.0.0.71 | 192.168.88.71 | jumpserver |
12 | 监控服务器 | zabbix | 10.0.0.72 | 192.168.88.72 | zabbix |
13 | 缓存服务器 | redis |
2.ansible搭建
cat >01_ins_ansible.sh<<EOF
#!/bin/bash
cat >/etc/yum.repos.d/ansible.repo<<EOM
[ansible]
name=ansible
baseurl=https://mirror.tuna.tsinghua.edu.cn/epel/7/x86_64/
gpgcheck=0
enabled=1
EOM
yum clean all
yum repoinfo
yum -y install ansible
EOF
vim 02_config_ansible.sh
#!/bin/bash
ls /ansible
[ $? -eq 0 ] || mkdir /ansible
cat >/ansible/ansible.cfg<<EOF
[defaults]
host_key_checking = false
inventory = inventory
EOF
cat >/ansible/inventory<<EOF
[web]
192.168.88.7
192.168.88.8
192.168.88.9[lb01]
192.168.88.5[lb02]
192.168.88.6[db]
192.168.88.51[backup]
192.168.88.41[data]
192.168.88.31
[all:vars]
ansible_ssh_user=root #所有机器用户名都是root,密码是123
ansible_ssh_pass=123
EOF
1.测试ansible可以正常访问
3.web服务(LNMP架构wordpress)
(一)安装linux操作系统(略)
(二)整体文件系统说明

1设置tab键
2.一键安装web服务器nginx,php,部署3台web
cd /ansible
cat >03_install_nginx.yaml<<EOF
---
- name: install nginxhosts: webtasks:- name: touchcopy:content: |[nginx]name=nginx repobaseurl=http://nginx.org/packages/centos/7/$basearch/gpgcheck=0enabled=1dest: /etc/yum.repos.d/nginx.repo- name: shellshell:cmd:yum makecache- name: install nginxshell:cmd: |yum -y install nginxyum remove -y epel-release.noarchyum install -y epel-releaseyum install -y https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/remi-release-7.rpmyum --enablerepo=remi-php74 install -y php php-cli php-common php-devel php-embedded php-gd php-mbstring php-pdo php-xml php-fpm php-mysqlnd php-opcache php-mcrypt php-pecl-memcached php-pecl-mongodb php-pecl-redis- name: copy web/default.confcopy:src: web/default.confdest: /etc/nginx/conf.d/- name: copy www.confcopy:src: files/www.confdest: /etc/php-fpm.d/www.conf- name: start nginx serviceservice:name: "{{item}}"state: restartedenabled: yesloop: [nginx,php-fpm]
EOF
ansible-playbook 03_install_nginx.yaml 执行
3.一键安装代理服务器nginx,keepalived,部署2台lb01和lb02
cat >04_install_keepalived.yaml<<EOF
---
- name: install nginxhosts: lb01,lb02tasks:- name: touchcopy:content: |[nginx]name=nginx repobaseurl=http://nginx.org/packages/centos/7/$basearch/gpgcheck=0enabled=1dest: /etc/yum.repos.d/nginx.repo- name: shellshell: yum makecache- name: install nginxyum:name: nginx,keepalivedstate: present- name: copy nginx.confcopy:src: files/nginx.confdest: /etc/nginx/- name: copy default.confcopy:src: files/default.confdest: /etc/nginx/conf.d/
- name: config keepalived.confhosts: lb01tasks:- name: copy lb01 keepalived.confcopy:src: files/keepalived.conf #master配置文件dest: /etc/keepalived/
- name: lb02hosts: lb02tasks:- name: copy lb02 keepalived.confcopy:src: ./keepalived.conf #slave配置文件dest: /etc/keepalived/
- name: start servicehosts: lb01,lb02tasks:- name: start nginx keepalived serviceservice:name: "{{item}}"state: restartedenabled: yesloop: [nginx,keepalived]
EOF
4.nfs服务端文件系统部署
cat >05_install_server_nfs-utils.yaml<<EOF
---
- name: install nfs01hosts: datatasks:- name: install nfs-utilsyum:name: nfs-utils,rpcbindstate: present- name: copy /etc/exportscopy:content: |/data 192.168.88.0/24(rw,sync)dest: /etc/exports- name: mkdir /datafile:path: /datastate: directoryowner: nfsnobodygroup: nfsnobody- name: htmlcopy:src: web/wordpress-6.1.1-zh_CN.tar.gzdest: /data- name: tar -xf wordpress-6.1.1-zh_CN.tar.gzshell: cmd: |tar -xf /data/wordpress-6.1.1-zh_CN.tar.gz -C /datachmod -R 777 /data- name: start rpcbind,nfsservice:name: "{{item}}"state: restartedenabled: yesloop: [rpcbind,nfs]EOF
5.nfs客户端web文件系统部署
cat >06_clientweb_nfs-utils.yaml<<EOF
---
- name: install nfs-utilshosts: webtasks:- name: install nfs-utilsyum:name: nfs-utilsstate: present- name: copy /etc/copy:content: |mount -t nfs 192.168.88.31:/data /mntdest: /etc/rc.d/nfs.local- name: chmod a+x /etc/rc.d/nfs.localshell:cmd: |chmod a+x /etc/rc.d/nfs.localmount -t nfs 192.168.88.31:/data /mnt
EOF
6.mariadb数据库部署
cat >07-install_mariadb-server.yaml<<EOF
---
- name: install nfs-utilshosts: dbtasks:- name: install nfs-utilsyum:name: mariadb-server,mariadbstate: present- name: start mariadbservice:name: mariadbstate: restartedenabled: yes- name: 修改passwdshell:cmd: |mysqladmin -u root password '123456'
EOF
7.创建收钱数据库和用户
cat >08-config-mysql.yml<<EOF
---
- name: config mysqlhosts: dbtasks:- name: create databasescript: files/config_mysql.sh
EOF
7.files目录下文件
1.files/config_mysql.sh
cat files/config_mysql.sh<<EOF
mysql -u root -p123456 -e "create database wordpress character set utf8mb4"
mysql -u root -p123456 -e "create user wordpress@'%' identified by 'wordpress'"
mysql -u root -p123456 -e "grant all privileges on wordpress.* to wordpress@'%'"
EOF
2.files/default.conf
cat >default.conf<<EOF
server {listen 80;server_name localhost;#access_log /var/log/nginx/host.access.log main;location / {proxy_pass http://webserver; #路由转发root /usr/share/nginx/html;index index.html index.htm;}#error_page 404 /404.html;# redirect server error pages to the static page /50x.html#error_page 500 502 503 504 /50x.html;location = /50x.html {root /usr/share/nginx/html;}# proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ \.php$ {# proxy_pass http://127.0.0.1;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000##location ~ \.php$ {# root html;# fastcgi_pass 127.0.0.1:9000;# fastcgi_index index.php;# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;# include fastcgi_params;#}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one##location ~ /\.ht {# deny all;#}
}
EOF
3.files/keepalived.conf
cat >keepalived.conf<<EOF
! Configuration File for keepalivedglobal_defs {notification_email {acassen@firewall.locfailover@firewall.locsysadmin@firewall.loc}notification_email_from Alexandre.Cassen@firewall.locsmtp_server 192.168.200.1smtp_connect_timeout 30router_id lb01vrrp_iptablesvrrp_skip_check_adv_addrvrrp_strictvrrp_garp_interval 0vrrp_gna_interval 0
}
vrrp_script chk_http_port { # 定义监视脚本script "/etc/keepalived/check_lvs.sh" interval 2 # 脚本每隔2秒运行一次}
vrrp_instance VI_1 {state MASTERinterface ens33virtual_router_id 51priority 100advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.88.80/24}
track_script { # 引用脚本chk_http_port}
}
EOF
4.files/check_lvs.sh
cat >files/check_lvs.sh<<EOF #检测keepalived主备切换
#!/bin/bash
ss -ntulp | grep :80 &> /dev/null && exit 0 || exit 1
EOF
chmod +x files/check_lvs.sh #记得加执行权限
5.files/www.conf
cat >files/www.conf<<EOF #源文件修改以下2行
...
user = nginxgroup = nginx
...
EOF
8.web目录下文件
1.web/default.conf
cat >web/default.conf<<EOF
server {listen 80;server_name localhost;#access_log /var/log/nginx/host.access.log main;location / {root /mnt/wordpress;index index.php index.html index.htm;}#error_page 404 /404.html;# redirect server error pages to the static page /50x.html#error_page 500 502 503 504 /50x.html;location = /50x.html {root /mnt/wordpress;}# proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ \.php$ {# proxy_pass http://127.0.0.1;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000#location ~ \.php$ {root /mnt/wordpress;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;include fastcgi_params;}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one##location ~ /\.ht {# deny all;#}
}
EOF
2.web/wordpress-6.1.1-zh_CN.tar.gz
wordpress-6.1-zh_CN.zip - 坚果云 - 云盘|网盘|企业网盘|同步|备份|无限空间|免费网络硬盘|企业云盘 (jianguoyun.com)
9.注意事项
如果客户端是windows主机,则使用记事本程序打开C:\windows\System32\drivers\etc\hosts添加名称解析
当点击http://192.168.88.80页面中任意链接时,地址栏上的地址,都会变成192.168.88.7。通过以下方式修复它:
# 在nfs服务器上修改配置文件
[root@nfs01 ~]# vim /mnt/wordpress/wp-config.php
# define('DB_NAME', 'wordpress')它的上方添加以下两行:
define('WP_SITEURL', 'http://192.168.88.80');
define('WP_HOME', 'http://192.168.88.80');
3.backup备份
服务端:backup
客户端:web01 web02 web03
要求:
每天晚上 00 点整在 Web 服务器上打包备份系统配置文件、网站程序目录及访问日志并通过 rsync 命令推送备份服务器 backup 上备份保留(备份思路可以是先在本地按日期打包,然后再推到备份服务器 backup 上) ,NFS 存储服务器同 Web 服务器,实际工作 中就是全部的服务器。
具体要求如下:
1)所有服务器的备份目录必须都为/backup。
2)要备份的系统配置文件包括但不限于:
a.定时任务服务的配置文件(/var/spool/cron/root)
b.开机自启动的配置文件(/etc/rc.local)
c.日常脚本的目录 (/server/scripts)。
d.防火墙 iptables 的配置文件(/etc/sysconfig/iptables)。
e.自己思考下还有什么需要备份呢?
3)Web 服务器站点目录(/var/html/www)。
4)Web 服务器 A 访问日志路径(/app/logs)
5)Web 服务器保留打包后的 7 天的备份数据即可(本地留存不能多于 7 天,因为太多硬盘会 满)
6)备份服务器上,保留每周一的所有数据副本,其它要保留 6 个月的数据副本。
7)备份服务器上要按照备份数据服务器的内网 IP 为目录保存备份,备份的文件按照时间名 字保存。
8)*需要确保备份的数据尽量完整正确,在备份服务器上对备份的数据进行检查,把备份的成功及失败结 果信息发给系统管理员邮箱中。
cat >09_backup_all_config.yaml<<EOF
---
- name: 客户端和服务端安装rsynchosts: web,backuptasks:- name: 安装rsync同步软件yum:name: rsyncstate: latest- name: 创建备份目录file:path: /server/scriptsstate: directory
- name: 配置backup服务端hosts: backupvars:rsync_password: "rsync_backup:123456"backup_dir: "/backup"tasks:- name: 配置/etc/rsyncd.confcopy:dest: /etc/rsyncd.confcontent: |uid = rsyncgid = rsyncport = 873fake super = yesuse chroot = nomax connections =200timeout = 300pid file = /var/run/rsyncd.pidlock file = /var/run/rsync.locklog file = /var/log/rsyncd.logignore errorsread only = falselist = falsehosts allow = 192.168.88.0/24hosts deny = 0.0.0.0/32auth users = rsync_backupsecrets file = /etc/rsync.password[backup]comment = "backup dir by abin"path = /backup- name: Add rsync useruser:name: rsynccreate_home: noshell: /sbin/nologinsystem: yes- name: Create rsync password fileshell: echo "{{ rsync_password }}" > /etc/rsync.password && chmod 600 /etc/rsync.password- name: Create backup directoryfile:path: "{{ backup_dir }}"state: directoryowner: rsyncgroup: rsync- name: Start and enable rsync serviceservice:name: rsyncdstate: restartedenabled: yes- name: 清理过期文件脚本copy:dest: /server/scripts/backup_server.shcontent: |#!/bin/bash# del 180 day ago datafind /backup/ -type f -mtime +180 ! -name "*week1.tar.gz"|xargs rm 2>/dev/null# check backup datafind /backup/ -type f -name "finger.txt"|xargs md5sum -c >/tmp/check.txt#send check mailmail -s "check backup info for $(date +%F)" 1781668237@qq.com </tmp/check.txt- name: Add cron job for backup_server scriptcron:user: "root"minute: "0"hour: "0"job: "/bin/sh /server/scripts/backup_server.sh"state: present
- name: 配置web客户端hosts: webvars:password: "123456"tasks:- name: Create rsync password fileshell: echo "{{ password }}" > /etc/rsync.password && chmod 600 /etc/rsync.password- name: 备份脚本copy:dest: /server/scripts/backup.shcontent: |#!/bin/bashBackup_dir="/backup"IP_info=`ifconfig | head -2 | tail -1 | awk '{print $2}'`# create backup dirmkdir -p $Backup_dir/$IP_info# tar backup datacd /tar zchf /$Backup_dir/$IP_info/system_backup_$(date +%F_week%w -d -0day).tar.gz /etc/rc.local /etc/nginx/nginx.conf /etc/nginx/conf.d/default.conf /server/scripts /var/spool/cron/root tar zchf /$Backup_dir/$IP_info/www_backup_$(date +%F_week%w).tar.gz ./var/html/wwwtar zchf /$Backup_dir/$IP_info/www_log_backup_$(date +%F_week%w).tar.gz ./app/logs# del 7 day ago datafind $Backup_dir -type f -mtime +7|xargs rm 2>/dev/null# create finger filefind $Backup_dir/ -type f -mtime -1 ! -name "finger*"|xargs md5sum >/$Backup_dir/$IP_info/finger.txt# backup push data inforsync -az $Backup_dir/ rsync_backup@192.168.88.41::backup --password-file=/etc/rsync.password- name: Add cron job for backup scriptcron:user: "root"minute: "0"hour: "0"job: "/bin/sh /server/scripts/backup.sh"state: present
EOF
相关文章:

LNMP部署wordpress
1.环境准备 总体架构介绍 序号类型名称外网地址内网地址软件02负载均衡服务器lb0110.0.0.5192.168.88.5nginx keepalived03负载均衡服务器lb0210.0.0.6192.168.88.6nginx keepalived04web服务器web0110.0.0.7192.168.88.7nginx05web服务器web0210.0.0.8192.168.88.8nginx06we…...

本地部署大模型ollama+docker+open WebUI/Lobe Chat
文章目录 大模型工具Ollama下载安装运行Spring Ai 代码测试加依赖配置写代码 ollama的web&Desktop搭建部署Open WebUI有两种方式Docker DesktopDocker部署Open WebUIDocker部署Lobe Chat可以配置OpenAI的key也可以配置ollama 大模型的选择 本篇基于windows环境下配置 大模型…...

qt学习篇---界面按键关联(信号和槽)
目录 1.qt基础 2.做一个界面 创建project UI界面设计 信号和槽 1.控件改名字 2.什么是信号和槽 3.怎么关联信号和槽 自动关联 手动关联 1.qt基础 qt可移植性强,不久会用到MCU。很有意义学习 2.做一个界面 创建project 不要中文路径 选择QWidget .pro文件…...
python Django 的内置权限系统或自定义模型来存储更复杂的角色和权限关系
在 Django 中,管理用户权限和角色通常涉及到使用 Django 的内置权限系统或自定义模型来存储更复杂的角色和权限关系。下面是一个基本的指南,说明如何在 Django 中为后台管理系统分配权限并将其保存在数据库中,同时结合 Vue.js 和 Element UI 作为前端框架。 后端(Django)…...

不上班,我靠这5份赚钱副业养活了自己
在这个快节奏的社会里,很多人都在为生活奔波忙碌。今天,就让我来跟大家分享一下我的“躺平”秘籍吧! 这一个月来,我没有上班,但好在有副业养活自己。有时候,我真的觉得有一份自己喜欢的自媒体副业挺好的。…...

强一致性的皇冠:分布式事务模型的至高法则揭秘
关注微信公众号 “程序员小胖” 每日技术干货,第一时间送达! 引言 分布式事务模型是分布式系统设计的核心,关键在于保证数据一致性和事务完整性,尤其强调强一致性。诸如2PC、3PC、Saga、TCC等模型与协议,应运而生以解…...

mac/windows下安装docker,minikube
1、安装docker Get Started | Docker 下载安装docker 就行 启动后,就可以正常操作docker了 使用docker -v 验证是否成功就行 2、安装minikube,是基于docker-desktop的 2.1、点击设置 2.2、选中安装,这个可能需要一点时间 这样安装后&…...
【爬虫】fake_useragent的使用、BeautifulSoup(find()和find_all())
1 fake_useragent 2 BeautifulSoup 3 Beautiful Soup库的find()和find_all() 1 fake_useragent fake_useragent是一个Python库,用于生成随机的用户代理字符串。 用户代理是在HTTP请求中发送给服务器的一种标识,它告诉服务器发送请求的客户端的类型、版本…...

ComfyUI中图像亮度/对比度/饱和度处理
用上面这个节点可以同时设置图片的亮度、对比度和饱和度。 【保姆级教程】一口气分享在ComfyUI中常用的30多种基本图像处理方式 更多好玩且实用AIGC工作流和节点 星球号:32767063 本期资料链接 往期学习资料 整理AI学习资料库...

基于FPGA的DDS波形发生器VHDL代码Quartus仿真
名称:基于FPGA的DDS波形发生器VHDL代码Quartus仿真(文末获取) 软件:Quartus 语言:VHDL 代码功能: DDS波形发生器VHDL 1、可以输出正弦波、方波、三角波 2、可以控制输出波形的频率 DDS波形发生器原理…...
C++语法|可调用对象与function类型
文章目录 引入function的使用function类型的典型应用function类型的原理实现代码优化可变参的函数对象 引入 还记得C语言中的函数指针数组吗? 我们通过函数指针数组实现一个,图书管理系统的界面: #include <stdio.h> void doShowAllB…...

Linux学习之路 -- 文件 -- 文件描述符
前面介绍了与文件相关的各种操作,其中的各个接口都离不开一个整数,那就是文件描述符,本文将介绍文件描述符的一些相关知识。 目录 <1>现象 <2>原理 文件fd的分配规则和利用规则实现重定向 <1>现象 我们可以先通过prin…...
JDK动态代理和Cglib动态代理区别
1.如果目标类实现了接口,将会使用JDK动态代理,否则会使用Cglib动态代理; 2.JDK代理使用自己的字节码生成工具生成代理对象,而Cglib会使用ASM字节码生成工具去生成; 3.JDK动态代理是通过反射的方式去实现代理对象的所有方法,通过…...

牛客 | 字符金字塔
请打印输出一个字符金字塔,字符金字塔的特征请参考样例 #include <stdio.h> #include <string.h> using namespace std; int main() {char c;scanf("%c", &c);for (int i 1; i < (c - 64); i)//第一个循环决定了有多少行{//c:67 第三…...

【计算机科学速成课】笔记三——操作系统
文章目录 18.操作系统问题引出——批处理设备驱动程序多任务处理虚拟内存内存保护Unix 18.操作系统 问题引出—— Computers in the 1940s and early 50s ran one program at a time. 1940,1950 年代的电脑,每次只能运行一个程序 A programmer would write one at…...

用js代码实现贪吃蛇小游戏
js已经学了大部分了,现在就利用我所学的js知识试试做贪吃蛇小游戏吧 以下部分相关图片以及思路笔记均出自渡一陈老师的视频 首先制作简单的静态页面,添加贪吃蛇移动的背景和相关图片,比如开始游戏等等 将各个功能均封装在函数中࿰…...

微信小程序+esp8266温湿度读取
本文主要使用微信小程序显示ESP8266读取的温湿度并通过微信小程序控制LED灯。小程序界面如下图所示 原理讲解 esp8266 通过mqtt发布消息,微信小程序通过mqtt 订阅消息,小程序订阅后,就可以实时收到esp8266 传输来的消息。 个人可免费注册五个微信小程序账号,在微信小程序官…...

软考中级-软件设计师(十)网络与信息安全基础知识
一、网络概述 1.1计算机网络的概念 计算机网络的发展:具有通信功能的单机系统->具有通信功能的多机系统->以共享资源为目的的计算机网络->以局域网及因特网为支撑环境的分布式计算机系统 计算机网络的功能:数据通信、资源共享、负载均衡、高…...

推荐一个好用的命令行工具ShellGPT
ShellGPT 配置安装常用功能聊天写命令并执行 高级功能函数调用角色管理 总结 这两天突然想到,现有的很多工具都在被大模型重构,比如诞生了像perplexity.ai 这种新交互形式的搜索引擎,就连wps也推出了AI服务,甚至都可以直接生成ppt…...

Prompt提示词教程 | 提示工程指南 | 提示词示例 入门篇
在上一节中,我们介绍并给出了如何赋能大语言模型的基本示例。如果还没看而且是刚入门的同学建议看下,有个基本概念。 Prompt提示词教程 | 提示工程指南 | 提示工程简介https://blog.csdn.net/HRG520JN/article/details/138523705在本节中,我…...
[2025CVPR]DeepVideo-R1:基于难度感知回归GRPO的视频强化微调框架详解
突破视频大语言模型推理瓶颈,在多个视频基准上实现SOTA性能 一、核心问题与创新亮点 1.1 GRPO在视频任务中的两大挑战 安全措施依赖问题 GRPO使用min和clip函数限制策略更新幅度,导致: 梯度抑制:当新旧策略差异过大时梯度消失收敛困难:策略无法充分优化# 传统GRPO的梯…...

家政维修平台实战20:权限设计
目录 1 获取工人信息2 搭建工人入口3 权限判断总结 目前我们已经搭建好了基础的用户体系,主要是分成几个表,用户表我们是记录用户的基础信息,包括手机、昵称、头像。而工人和员工各有各的表。那么就有一个问题,不同的角色…...
稳定币的深度剖析与展望
一、引言 在当今数字化浪潮席卷全球的时代,加密货币作为一种新兴的金融现象,正以前所未有的速度改变着我们对传统货币和金融体系的认知。然而,加密货币市场的高度波动性却成为了其广泛应用和普及的一大障碍。在这样的背景下,稳定…...
Java线上CPU飙高问题排查全指南
一、引言 在Java应用的线上运行环境中,CPU飙高是一个常见且棘手的性能问题。当系统出现CPU飙高时,通常会导致应用响应缓慢,甚至服务不可用,严重影响用户体验和业务运行。因此,掌握一套科学有效的CPU飙高问题排查方法&…...

Yolov8 目标检测蒸馏学习记录
yolov8系列模型蒸馏基本流程,代码下载:这里本人提交了一个demo:djdll/Yolov8_Distillation: Yolov8轻量化_蒸馏代码实现 在轻量化模型设计中,**知识蒸馏(Knowledge Distillation)**被广泛应用,作为提升模型…...

GO协程(Goroutine)问题总结
在使用Go语言来编写代码时,遇到的一些问题总结一下 [参考文档]:https://www.topgoer.com/%E5%B9%B6%E5%8F%91%E7%BC%96%E7%A8%8B/goroutine.html 1. main()函数默认的Goroutine 场景再现: 今天在看到这个教程的时候,在自己的电…...
Pydantic + Function Calling的结合
1、Pydantic Pydantic 是一个 Python 库,用于数据验证和设置管理,通过 Python 类型注解强制执行数据类型。它广泛用于 API 开发(如 FastAPI)、配置管理和数据解析,核心功能包括: 数据验证:通过…...

从0开始学习R语言--Day17--Cox回归
Cox回归 在用医疗数据作分析时,最常见的是去预测某类病的患者的死亡率或预测他们的结局。但是我们得到的病人数据,往往会有很多的协变量,即使我们通过计算来减少指标对结果的影响,我们的数据中依然会有很多的协变量,且…...
小白的进阶之路系列之十四----人工智能从初步到精通pytorch综合运用的讲解第七部分
通过示例学习PyTorch 本教程通过独立的示例介绍PyTorch的基本概念。 PyTorch的核心提供了两个主要特性: 一个n维张量,类似于numpy,但可以在gpu上运行 用于构建和训练神经网络的自动微分 我们将使用一个三阶多项式来拟合问题 y = s i n ( x ) y=sin(x) y=sin(x),作为我们的…...

python3GUI--基于PyQt5+DeepSort+YOLOv8智能人员入侵检测系统(详细图文介绍)
文章目录 一.前言二.技术介绍1.PyQt52.DeepSort3.卡尔曼滤波4.YOLOv85.SQLite36.多线程7.入侵人员检测8.ROI区域 三.核心功能1.登录注册1.登录2.注册 2.主界面1.主界面简介2.数据输入3.参数配置4.告警配置5.操作控制台6.核心内容显示区域7.检…...