当前位置:首页>Linux>搭建私有 Linux 镜像仓库:从零到生产的完整指南

搭建私有 Linux 镜像仓库:从零到生产的完整指南

  • 2026-01-20 16:15:31
搭建私有 Linux 镜像仓库:从零到生产的完整指南
点击上方 "Linux就该这样学关注,星标或者置顶,第一时间送达

责编:Linux妹 | 来源:马哥Linux运维

上一篇:20个Linux命令贴与技巧,效率瞬间翻倍

大家好,我是Linux妹。

概述

为什么需要私有镜像仓库?

在企业环境中,搭建私有Linux镜像仓库具有以下优势:

  • • 网络优化:减少外网带宽消耗,提升下载速度
  • • 安全控制:内网环境下的安全软件分发
  • • 版本管理:统一管理软件包版本,确保环境一致性
  • • 离线部署:支持无外网环境的软件安装
  • • 成本节约:减少重复下载,节省带宽成本

架构设计

客户端
负载均衡器
镜像服务器1
镜像服务器2
存储后端
同步服务器
上游镜像源

环境准备

硬件要求

组件
最低配置
推荐配置
生产环境
CPU
2核
4核
8核+
内存
4GB
8GB
16GB+
存储
500GB
2TB
10TB+
网络
100Mbps
1Gbps
10Gbps

软件环境

# 操作系统:Ubuntu 22.04 LTS 或 CentOS 8# Web服务器:Nginx# 同步工具:rsync, apt-mirror, reposync# 监控:Prometheus + Grafana

目录规划

# 创建目录结构sudomkdir -p /data/mirrors/{ubuntu,centos,docker,alpine}sudomkdir -p /data/mirrors/logssudomkdir -p /data/mirrors/scriptssudomkdir -p /etc/mirrors

搭建APT私有镜像源

安装apt-mirror

# Ubuntu/Debian系统sudo apt updatesudo apt install -y apt-mirror nginx# 创建镜像用户sudo useradd -r -s /bin/false -d /data/mirrors aptmirrorsudochown -R aptmirror:aptmirror /data/mirrors

配置apt-mirror

# 编辑配置文件sudo nano /etc/apt/mirror.list
# /etc/apt/mirror.list############# config ##################set base_path    /data/mirrors/ubuntuset mirror_path  $base_path/mirrorset skel_path    $base_path/skelset var_path     $base_path/varset cleanscript  $var_path/clean.shset defaultarch  amd64set postmirror_script $var_path/postmirror.shset run_postmirror 0set nthreads     20set _tilde 0############# end config ############### Ubuntu 22.04 LTS (Jammy)deb http://archive.ubuntu.com/ubuntu jammy main restricted universe multiversedeb http://archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiversedeb http://archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiversedeb http://security.ubuntu.com/ubuntu jammy-security main restricted universe multiverse# Ubuntu 20.04 LTS (Focal)deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiversedeb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiversedeb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiversedeb http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse# 源码包(可选)# deb-src http://archive.ubuntu.com/ubuntu jammy main restricted universe multiverse# 清理脚本clean http://archive.ubuntu.com/ubuntuclean http://security.ubuntu.com/ubuntu

创建同步脚本

# 创建同步脚本sudo nano /data/mirrors/scripts/sync-ubuntu.sh
#!/bin/bash# Ubuntu镜像同步脚本set -eLOGFILE="/data/mirrors/logs/ubuntu-sync-$(date +%Y%m%d-%H%M%S).log"LOCKFILE="/var/run/ubuntu-mirror.lock"# 检查锁文件if [ -f "$LOCKFILE" ]; thenecho"同步进程已在运行,退出..."exit 1fi# 创建锁文件echo $$ > "$LOCKFILE"# 清理函数cleanup() {rm -f "$LOCKFILE"}trap cleanup EXITecho"开始Ubuntu镜像同步: $(date)" | tee -a "$LOGFILE"# 执行同步sudo -u aptmirror apt-mirror /etc/apt/mirror.list 2>&1 | tee -a "$LOGFILE"# 更新时间戳echo"$(date)" > /data/mirrors/ubuntu/last_updateecho"Ubuntu镜像同步完成: $(date)" | tee -a "$LOGFILE"# 清理旧日志(保留30天)find /data/mirrors/logs -name "ubuntu-sync-*.log" -mtime +30 -delete# 发送通知(可选)# curl -X POST -H 'Content-type: application/json' \#     --data '{"text":"Ubuntu镜像同步完成"}' \#     YOUR_WEBHOOK_URL
# 设置执行权限sudochmod +x /data/mirrors/scripts/sync-ubuntu.sh

配置Nginx

# 创建Nginx配置sudo nano /etc/nginx/sites-available/ubuntu-mirror
server {listen80;server_name ubuntu-mirror.example.com;root /data/mirrors/ubuntu/mirror;index index.html;# 访问日志access_log /var/log/nginx/ubuntu-mirror.access.log;error_log /var/log/nginx/ubuntu-mirror.error.log;# 基本配置location / {autoindexon;autoindex_exact_sizeoff;autoindex_localtimeon;# 缓存配置expires1d;add_header Cache-Control "public, immutable";# 安全头add_header X-Frame-Options "SAMEORIGIN";add_header X-Content-Type-Options "nosniff";    }# 包文件缓存location~* \.(deb|udeb|tar\.gz|tar\.xz|tar\.bz2)$ {expires7d;add_header Cache-Control "public, immutable";    }# 元数据文件location~* (Release|Packages|Sources)$ {expires1h;add_header Cache-Control "public, must-revalidate";    }# 状态页面location /status {alias /data/mirrors/ubuntu/;try_files /last_update =404;add_header Content-Type text/plain;    }# 禁止访问隐藏文件location~ /\. {deny all;    }}
# 启用站点sudoln -s /etc/nginx/sites-available/ubuntu-mirror /etc/nginx/sites-enabled/sudo nginx -tsudo systemctl reload nginx

搭建YUM私有镜像源

安装reposync

# CentOS/RHEL系统sudo yum install -y yum-utils createrepo nginx# 或者在Ubuntu上安装sudo apt install -y yum-utils createrepo-c nginx

配置YUM仓库同步

# 创建CentOS 8同步脚本sudo nano /data/mirrors/scripts/sync-centos.sh
#!/bin/bash# CentOS镜像同步脚本set -eMIRROR_BASE="/data/mirrors/centos"LOGFILE="/data/mirrors/logs/centos-sync-$(date +%Y%m%d-%H%M%S).log"LOCKFILE="/var/run/centos-mirror.lock"# 检查锁文件if [ -f "$LOCKFILE" ]; thenecho"同步进程已在运行,退出..."exit 1fiecho $$ > "$LOCKFILE"cleanup() {rm -f "$LOCKFILE"}trap cleanup EXITecho"开始CentOS镜像同步: $(date)" | tee -a "$LOGFILE"# 同步CentOS 8 Streamsync_centos_stream() {local version=$1local repo_dir="$MIRROR_BASE/$version"mkdir -p "$repo_dir"# 同步各个仓库for repo in baseos appstream extras powertools; doecho"同步 CentOS $version$repo..." | tee -a "$LOGFILE"        reposync \            --download-path="$repo_dir" \            --repo="$repo" \            --arch=x86_64 \            --newest-only \            --delete \            2>&1 | tee -a "$LOGFILE"# 创建仓库元数据        createrepo_c "$repo_dir/$repo/" 2>&1 | tee -a "$LOGFILE"done}# 同步不同版本sync_centos_stream "8-stream"sync_centos_stream "9-stream"# 更新时间戳echo"$(date)" > "$MIRROR_BASE/last_update"echo"CentOS镜像同步完成: $(date)" | tee -a "$LOGFILE"# 清理旧日志find /data/mirrors/logs -name "centos-sync-*.log" -mtime +30 -delete

配置YUM仓库文件

# 创建仓库配置模板sudo nano /data/mirrors/centos/centos8-stream.repo
[baseos]name=CentOS Stream $releasever - BaseOSbaseurl=http://your-mirror.example.com/centos/8-stream/baseos/gpgcheck=1enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial[appstream]name=CentOS Stream $releasever - AppStreambaseurl=http://your-mirror.example.com/centos/8-stream/appstream/gpgcheck=1enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial[extras]name=CentOS Stream $releasever - Extrasbaseurl=http://your-mirror.example.com/centos/8-stream/extras/gpgcheck=1enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial[powertools]name=CentOS Stream $releasever - PowerToolsbaseurl=http://your-mirror.example.com/centos/8-stream/powertools/gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

Nginx配置(CentOS)

server {listen80;server_name centos-mirror.example.com;root /data/mirrors/centos;index index.html;access_log /var/log/nginx/centos-mirror.access.log;error_log /var/log/nginx/centos-mirror.error.log;location / {autoindexon;autoindex_exact_sizeoff;autoindex_localtimeon;expires1d;add_header Cache-Control "public, immutable";    }# RPM包缓存location~* \.rpm$ {expires7d;add_header Cache-Control "public, immutable";    }# 元数据缓存location~* (repomd\.xml|primary\.xml|filelists\.xml|other\.xml)$ {expires1h;add_header Cache-Control "public, must-revalidate";    }# 仓库配置文件下载location /repo-files/ {alias /data/mirrors/centos/;try_files$uri$uri.repo =404;add_header Content-Type text/plain;    }}

搭建Docker私有镜像仓库

安装Docker Registry

# 安装Dockercurl -fsSL https://get.docker.com | shsudo usermod -aG docker $USER# 创建Registry目录sudomkdir -p /data/mirrors/docker/{registry,auth,certs}

配置Registry

# 创建Registry配置文件sudo nano /data/mirrors/docker/config.yml
version:0.1log:accesslog:disabled:falselevel:infoformatter:textfields:service:registrystorage:cache:blobdescriptor:inmemoryfilesystem:rootdirectory:/var/lib/registrydelete:enabled:truehttp:addr::5000headers:X-Content-Type-Options: [nosniff]Access-Control-Allow-Origin: ['*']Access-Control-Allow-Methods: ['HEAD''GET''OPTIONS''DELETE']Access-Control-Allow-Headers: ['Authorization''Accept''Cache-Control']health:storagedriver:enabled:trueinterval:10sthreshold:3proxy:remoteurl:https://registry-1.docker.iousername:your-dockerhub-usernamepassword:your-dockerhub-password

启动Registry服务

# 创建docker-compose文件sudo nano /data/mirrors/docker/docker-compose.yml
version:'3.8'services:registry:image:registry:2.8container_name:docker-registryrestart:unless-stoppedports:-"5000:5000"environment:REGISTRY_CONFIG_PATH:/etc/docker/registry/config.ymlREGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY:/var/lib/registryvolumes:-/data/mirrors/docker/registry:/var/lib/registry-/data/mirrors/docker/config.yml:/etc/docker/registry/config.yml:ronetworks:-registry-netregistry-ui:image:joxit/docker-registry-ui:latestcontainer_name:registry-uirestart:unless-stoppedports:-"8080:80"environment:REGISTRY_TITLE:"Private Docker Registry"REGISTRY_URL:http://registry:5000DELETE_IMAGES:"true"SHOW_CONTENT_DIGEST:"true"depends_on:-registrynetworks:-registry-netnetworks:registry-net:driver:bridge
# 启动服务cd /data/mirrors/dockersudo docker-compose up -d

配置Registry代理

# Docker Registry Nginx配置server {listen80;server_name docker-registry.example.com;client_max_body_size0;chunked_transfer_encodingon;location /v2/ {proxy_pass http://localhost:5000;proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto $scheme;proxy_read_timeout900;    }location / {proxy_pass http://localhost:8080;proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto $scheme;    }}

自动化同步与更新

创建统一同步脚本

# 创建主同步脚本sudo nano /data/mirrors/scripts/sync-all.sh
#!/bin/bash# 统一镜像同步脚本set -eSCRIPT_DIR="/data/mirrors/scripts"LOG_DIR="/data/mirrors/logs"NOTIFICATION_URL="${WEBHOOK_URL:-}"# 日志函数log() {echo"[$(date '+%Y-%m-%d %H:%M:%S')$1" | tee -a "$LOG_DIR/sync-all.log"}# 通知函数notify() {local message="$1"local status="$2"log"$message"if [ -n "$NOTIFICATION_URL" ]; then        curl -X POST -H 'Content-type: application/json' \            --data "{\"text\":\"$message\", \"status\":\"$status\"}" \"$NOTIFICATION_URL" || truefi}# 执行同步任务run_sync() {local script="$1"local name="$2"if [ -f "$script" ]; thenlog"开始同步 $name"if"$script"then            notify "$name 同步成功""success"else            notify "$name 同步失败""error"return 1fielselog"同步脚本不存在: $script"return 1fi}# 主执行流程main() {log"开始镜像同步任务"local failed=0# 同步Ubuntu    run_sync "$SCRIPT_DIR/sync-ubuntu.sh""Ubuntu" || ((failed++))# 同步CentOS    run_sync "$SCRIPT_DIR/sync-centos.sh""CentOS" || ((failed++))# 清理旧日志    find "$LOG_DIR" -name "*.log" -mtime +30 -deleteif [ $failed -eq 0 ]; then        notify "所有镜像同步完成""success"else        notify "有 $failed 个镜像同步失败""warning"filog"镜像同步任务结束"}main "$@"

配置定时任务

# 编辑crontabsudo crontab -e# 添加定时任务# 每天凌晨2点同步0 2 * * * /data/mirrors/scripts/sync-all.sh# 每周日凌晨1点清理Docker Registry0 1 * * 0 /data/mirrors/scripts/cleanup-docker.sh# 每小时检查服务状态0 * * * * /data/mirrors/scripts/health-check.sh

健康检查脚本

# 创建健康检查脚本sudo nano /data/mirrors/scripts/health-check.sh
#!/bin/bash# 服务健康检查脚本SERVICES=("nginx""docker")LOG_FILE="/data/mirrors/logs/health-check.log"log() {echo"[$(date '+%Y-%m-%d %H:%M:%S')$1" >> "$LOG_FILE"}check_service() {local service="$1"if systemctl is-active --quiet "$service"thenlog"$service 服务正常运行"return 0elselog"$service 服务异常,尝试重启"        systemctl restart "$service"sleep 5if systemctl is-active --quiet "$service"thenlog"$service 服务重启成功"return 0elselog"$service 服务重启失败"return 1fifi}check_disk_space() {local usage=$(df /data/mirrors | awk 'NR==2 {print $5}' | sed 's/%//')if [ "$usage" -gt 85 ]; thenlog"磁盘空间不足: ${usage}%"# 发送告警return 1elselog"磁盘空间正常: ${usage}%"return 0fi}# 主检查流程main() {local failed=0# 检查服务状态for service in"${SERVICES[@]}"do        check_service "$service" || ((failed++))done# 检查磁盘空间    check_disk_space || ((failed++))# 检查网络连通性if ! curl -s --max-time 10 http://localhost/status > /dev/null; thenlog"Web服务访问异常"        ((failed++))fiif [ $failed -eq 0 ]; thenlog"所有检查项正常"elselog"发现 $failed 个异常项"fi}main "$@"

高可用与负载均衡

配置HAProxy负载均衡

# 安装HAProxysudo apt install -y haproxy# 配置HAProxysudo nano /etc/haproxy/haproxy.cfg
global    daemon    chroot /var/lib/haproxy    stats socket /run/haproxy/admin.sock mode 660 level admin    stats timeout 30s    user haproxy    group haproxydefaults    mode http    timeout connect 5000ms    timeout client 50000ms    timeout server 50000ms    option httplog    option dontlognull    errorfile 400 /etc/haproxy/errors/400.http    errorfile 403 /etc/haproxy/errors/403.http    errorfile 408 /etc/haproxy/errors/408.http    errorfile 500 /etc/haproxy/errors/500.http    errorfile 502 /etc/haproxy/errors/502.http    errorfile 503 /etc/haproxy/errors/503.http    errorfile 504 /etc/haproxy/errors/504.httpfrontend mirror_frontend    bind *:80    bind *:443 ssl crt /etc/ssl/certs/mirror.pem    redirect scheme https if !{ ssl_fc }    # 根据域名分发    acl is_ubuntu hdr(host) -i ubuntu-mirror.example.com    acl is_centos hdr(host) -i centos-mirror.example.com    acl is_docker hdr(host) -i docker-registry.example.com    use_backend ubuntu_backend if is_ubuntu    use_backend centos_backend if is_centos    use_backend docker_backend if is_docker    default_backend ubuntu_backendbackend ubuntu_backend    balance roundrobin    option httpchk GET /status    server ubuntu1 192.168.1.10:80 check    server ubuntu2 192.168.1.11:80 check backupbackend centos_backend    balance roundrobin    option httpchk GET /status    server centos1 192.168.1.10:80 check    server centos2 192.168.1.11:80 check backupbackend docker_backend    balance roundrobin    option httpchk GET /v2/    server docker1 192.168.1.10:5000 check    server docker2 192.168.1.11:5000 check backuplisten stats    bind *:8404    stats enable    stats uri /stats    stats refresh 30s    stats admin if TRUE

配置Keepalived高可用

# 安装Keepalivedsudo apt install -y keepalived# 主节点配置sudo nano /etc/keepalived/keepalived.conf
# 主节点配置vrrp_script chk_haproxy {    script "/bin/kill -0 `cat /var/run/haproxy.pid`"    interval 2    weight 2    fall 3    rise 2}vrrp_instance VI_1 {    state MASTER    interface eth0    virtual_router_id 51    priority 101    advert_int 1    authentication {        auth_type PASS        auth_pass 1111    }    virtual_ipaddress {        192.168.1.100    }    track_script {        chk_haproxy    }}

监控与维护

配置Prometheus监控

# 创建Prometheus配置sudo nano /etc/prometheus/prometheus.yml
global:scrape_interval:15sevaluation_interval:15srule_files:-"mirror_rules.yml"scrape_configs:-job_name:'prometheus'static_configs:-targets: ['localhost:9090']-job_name:'node-exporter'static_configs:-targets: ['localhost:9100']-job_name:'nginx'static_configs:-targets: ['localhost:9113']-job_name:'haproxy'static_configs:-targets: ['localhost:8404']alerting:alertmanagers:-static_configs:-targets:-alertmanager:9093

创建告警规则

# 创建告警规则sudo nano /etc/prometheus/mirror_rules.yml
groups:-name:mirror_alertsrules:-alert:HighDiskUsageexpr:(node_filesystem_size_bytes{mountpoint="/data"}-node_filesystem_free_bytes{mountpoint="/data"})/node_filesystem_size_bytes{mountpoint="/data"}*100>85for:5mlabels:severity:warningannotations:summary:"磁盘使用率过高"description:"镜像存储磁盘使用率超过85%"-alert:ServiceDownexpr:up==0for:2mlabels:severity:criticalannotations:summary:"服务不可用"description:"{{ $labels.instance }} 服务已停止"-alert:HighMemoryUsageexpr:(1-(node_memory_MemAvailable_bytes/node_memory_MemTotal_bytes))*100>90for:5mlabels:severity:warningannotations:summary:"内存使用率过高"description:"内存使用率超过90%"-alert:SyncJobFailedexpr:increase(sync_job_failures_total[1h])>0for:0mlabels:severity:criticalannotations:summary:"镜像同步失败"description:"镜像同步任务执行失败"

Grafana仪表板

{"dashboard":{"id":null,"title":"Linux Mirror Repository Dashboard","tags":["mirror","linux"],"timezone":"browser","panels":[{"title":"磁盘使用率","type":"stat","targets":[{"expr":"(node_filesystem_size_bytes{mountpoint=\"/data\"} - node_filesystem_free_bytes{mountpoint=\"/data\"}) / node_filesystem_size_bytes{mountpoint=\"/data\"} * 100","legendFormat":"磁盘使用率"}],"fieldConfig":{"defaults":{"unit":"percent","thresholds":{"steps":[{"color":"green","value":null},{"color":"yellow","value":70},{"color":"red","value":85}]}}}},{"title":"网络流量","type":"graph","targets":[{"expr":"rate(node_network_receive_bytes_total{device=\"eth0\"}[5m])","legendFormat":"接收"},{"expr":"rate(node_network_transmit_bytes_total{device=\"eth0\"}[5m])","legendFormat":"发送"}]},{"title":"同步状态","type":"table","targets":[{"expr":"sync_last_success_timestamp_seconds","legendFormat":"最后同步时间"}]}],"time":{"from":"now-1h","to":"now"},"refresh":"30s"}}

安全配置

SSL/TLS配置

# 生成SSL证书sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \    -keyout /etc/ssl/private/mirror.key \    -out /etc/ssl/certs/mirror.crt \    -subj "/C=CN/ST=Beijing/L=Beijing/O=Company/CN=mirror.example.com"# 合并证书文件(HAProxy使用)sudocat /etc/ssl/certs/mirror.crt /etc/ssl/private/mirror.key > /etc/ssl/certs/mirror.pem

访问控制

# IP白名单配置geo$allowed_ip {default0;    192.168.0.0/16 1;    10.0.0.0/8 1;    172.16.0.0/12 1;}server {listen80;server_name mirror.example.com;# IP访问控制if ($allowed_ip = 0) {return403;    }# 限制连接数limit_conn_zone$binary_remote_addr zone=conn_limit_per_ip:10m;limit_conn conn_limit_per_ip 10;# 限制请求频率limit_req_zone$binary_remote_addr zone=req_limit_per_ip:10m rate=10r/s;limit_req zone=req_limit_per_ip burst=20 nodelay;location / {# 基本认证(可选)auth_basic"Private Mirror";auth_basic_user_file /etc/nginx/.htpasswd;# 其他配置...    }}

防火墙配置

# UFW防火墙配置sudo ufw default deny incomingsudo ufw default allow outgoing# 允许SSHsudo ufw allow ssh# 允许HTTP/HTTPSsudo ufw allow 80/tcpsudo ufw allow 443/tcp# 允许内网访问sudo ufw allow from 192.168.0.0/16 to any port 80sudo ufw allow from 10.0.0.0/8 to any port 80# 启用防火墙sudo ufw enable

故障排除

常见问题诊断

1. 同步失败问题

# 检查网络连通性curl -I http://archive.ubuntu.com/ubuntu/# 检查磁盘空间df -h /data/mirrors# 检查权限ls -la /data/mirrors/# 查看同步日志tail -f /data/mirrors/logs/ubuntu-sync-*.log

2. 服务访问问题

# 检查Nginx状态sudo systemctl status nginxsudo nginx -t# 检查端口监听sudo netstat -tlnp | grep :80# 检查防火墙sudo ufw status# 测试本地访问curl -I http://localhost/

3. 性能问题

# 检查系统负载tophtopiotop# 检查网络流量iftopnethogs# 检查磁盘IOiostat -x 1

故障恢复脚本

# 创建故障恢复脚本sudo nano /data/mirrors/scripts/recovery.sh
#!/bin/bash# 故障恢复脚本SERVICES=("nginx""docker""haproxy")BACKUP_DIR="/data/backup"# 服务恢复recover_services() {for service in"${SERVICES[@]}"doif ! systemctl is-active --quiet "$service"thenecho"恢复服务: $service"            systemctl restart "$service"sleep 5if systemctl is-active --quiet "$service"thenecho"$service 恢复成功"elseecho"$service 恢复失败"fifidone}# 配置文件恢复recover_configs() {if [ -d "$BACKUP_DIR" ]; thenecho"恢复配置文件..."# 恢复Nginx配置if [ -f "$BACKUP_DIR/nginx.conf" ]; thencp"$BACKUP_DIR/nginx.conf" /etc/nginx/nginx.conf            nginx -t && systemctl reload nginxfi# 恢复HAProxy配置if [ -f "$BACKUP_DIR/haproxy.cfg" ]; thencp"$BACKUP_DIR/haproxy.cfg" /etc/haproxy/haproxy.cfg            systemctl reload haproxyfifi}# 数据完整性检查check_data_integrity() {echo"检查数据完整性..."# 检查Ubuntu镜像if [ -f "/data/mirrors/ubuntu/mirror/dists/jammy/Release" ]; thenecho"Ubuntu镜像完整"elseecho"Ubuntu镜像损坏,需要重新同步"        /data/mirrors/scripts/sync-ubuntu.shfi# 检查CentOS镜像if [ -f "/data/mirrors/centos/8-stream/baseos/repodata/repomd.xml" ]; thenecho"CentOS镜像完整"elseecho"CentOS镜像损坏,需要重新同步"        /data/mirrors/scripts/sync-centos.shfi}# 主恢复流程main() {echo"开始故障恢复..."    recover_services    recover_configs    check_data_integrityecho"故障恢复完成"}main "$@"

监控脚本

# 创建监控脚本sudo nano /data/mirrors/scripts/monitor.sh
#!/bin/bash# 实时监控脚本ALERT_EMAIL="admin@example.com"WEBHOOK_URL="https://hooks.slack.com/services/YOUR/WEBHOOK/URL"send_alert() {local message="$1"local severity="$2"echo"[$(date)] ALERT [$severity]: $message"# 发送邮件告警echo"$message" | mail -s "Mirror Alert [$severity]""$ALERT_EMAIL"# 发送Webhook通知    curl -X POST -H 'Content-type: application/json' \        --data "{\"text\":\"$message\", \"severity\":\"$severity\"}" \"$WEBHOOK_URL"}# 检查磁盘空间check_disk() {local usage=$(df /data/mirrors | awk 'NR==2 {print $5}' | sed 's/%//')if [ "$usage" -gt 90 ]; then        send_alert "磁盘空间严重不足: ${usage}%""CRITICAL"elif [ "$usage" -gt 80 ]; then        send_alert "磁盘空间不足: ${usage}%""WARNING"fi}# 检查同步状态check_sync() {local last_sync=$(stat -c %Y /data/mirrors/ubuntu/last_update 2>/dev/null || echo 0)local current_time=$(date +%s)local diff=$((current_time - last_sync))# 如果超过24小时未同步if [ $diff -gt 86400 ]; then        send_alert "Ubuntu镜像同步超时: $((diff/3600))小时""WARNING"fi}# 检查服务状态check_services() {local services=("nginx""docker")for service in"${services[@]}"doif ! systemctl is-active --quiet "$service"then            send_alert "$service 服务异常""CRITICAL"fidone}# 主监控循环main() {whiletruedo        check_disk        check_sync        check_servicessleep 300  # 5分钟检查一次done}main "$@"

总结

通过本文的详细指南,我们成功搭建了一个完整的私有Linux镜像仓库系统,包括:

核心功能

  • • 多发行版支持:Ubuntu、CentOS、Docker镜像
  • • 自动化同步:定时同步上游镜像源
  • • 负载均衡:HAProxy + Keepalived高可用方案
  • • 监控告警:Prometheus + Grafana监控体系

运维特性

  • • 安全加固:SSL/TLS、访问控制、防火墙配置
  • • 故障恢复:自动化故障检测和恢复机制
  • • 性能优化:缓存策略、并发控制
  • • 日志管理:完整的日志记录和轮转

最佳实践

  1. 1. 定期备份:配置文件和关键数据的定期备份
  2. 2. 容量规划:根据使用情况合理规划存储容量
  3. 3. 网络优化:配置适当的缓存和CDN策略
  4. 4. 安全更新:及时更新系统和软件包

这套方案可以满足企业级的私有镜像仓库需求,提供稳定、高效、安全的软件包分发服务

你还有什么想要补充的吗?

上周,又劝退十几个了。。。

ChatGPT 4.0 国内直接用 !!!

最后给大家推荐一个ChatGPT 4.0国内网站,是我们团队一直在使用的,我们对接是OpenAI官网的账号,给大家打造了一个一模一样ChatGPT,很多粉丝朋友现在也都通过我拿这种号,价格不贵,关键还有售后。

一句话说明:用官方一半价格的钱,一句话说明:用跟官方 ChatGPT4.0 一模一样功能,无需魔法,无视封号,不必担心次数不够。

最大优势:可实现会话隔离!突破限制:官方限制每个账号三小时可使用40次4.0本网站可实现次数上限之后,手动切换下一个未使用的账号【相当于一个4.0帐号,同享受一百个账号轮换使用权限】

最后,再次推荐下我们的AI星

为了跟上AI时代我干了一件事儿,我创建了一个知识星球社群:ChartGPT与副业。想带着大家一起探索ChatGPT和新的AI时代

有很多小伙伴搞不定ChatGPT账号,于是我们决定,凡是这三天之内加入ChatPGT的小伙伴,我们直接送一个正常可用的永久ChatGPT独立账户。

不光是增长速度最快,我们的星球品质也绝对经得起考验,短短一个月时间,我们的课程团队发布了8个专栏、18个副业项目

简单说下这个星球能给大家提供什么:

1、不断分享如何使用ChatGPT来完成各种任务,让你更高效地使用ChatGPT,以及副业思考、变现思路、创业案例、落地案例分享。

2、分享ChatGPT的使用方法、最新资讯、商业价值。

3、探讨未来关于ChatGPT的机遇,共同成长。

4、帮助大家解决ChatGPT遇到的问题。

5、提供一整年的售后服务,一起搞副业

星球福利:

1、加入星球4天后,就送ChatGPT独立账号。

2、邀请你加入ChatGPT会员交流群。

3、赠送一份完整的ChatGPT手册和66个ChatGPT副业赚钱手册。

其它福利还在筹划中... 不过,我给你大家保证,加入星球后,收获的价值会远远大于今天加入的门票费用 !

本星球第一期原价399,目前属于试运营,早鸟价169,每超过50人涨价10元,星球马上要来一波大的涨价,如果你还在犹豫,可能最后就要以更高价格加入了。。

早就是优势。建议大家尽早以便宜的价格加入!

  声明:本文部分素材转载自互联网,如有侵权立即删除 。

END

往日精彩:

17 个 IT 运维常用指标,绝对不能想简单了?

一款颜值、功能都很能打的 SSH 工具

Tabby:一款超高颜值的终端工具(开源免费,全平台支持)

刚刚,被 GPT-4o 价格劝退了!

喜欢本文的朋友们,欢迎长按二维码,关注订阅号Linux就该这样学

收看更多精彩内容

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-09 02:34:07 HTTP/2.0 GET : https://f.mffb.com.cn/a/460485.html
  2. 运行时间 : 0.261013s [ 吞吐率:3.83req/s ] 内存消耗:4,794.14kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=59497579f281cef6851947fd3b251456
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.001063s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001796s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000713s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.003245s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001388s ]
  6. SELECT * FROM `set` [ RunTime:0.001443s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001526s ]
  8. SELECT * FROM `article` WHERE `id` = 460485 LIMIT 1 [ RunTime:0.010665s ]
  9. UPDATE `article` SET `lasttime` = 1770575647 WHERE `id` = 460485 [ RunTime:0.004126s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.000719s ]
  11. SELECT * FROM `article` WHERE `id` < 460485 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001281s ]
  12. SELECT * FROM `article` WHERE `id` > 460485 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001599s ]
  13. SELECT * FROM `article` WHERE `id` < 460485 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.032064s ]
  14. SELECT * FROM `article` WHERE `id` < 460485 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002256s ]
  15. SELECT * FROM `article` WHERE `id` < 460485 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.029332s ]
0.264839s