首页
关于
壁纸
直播
留言
友链
统计
Search
1
《三国志英杰传》攻略
6,105 阅读
2
Emby客户端IOS破解
5,947 阅读
3
白嫖Emby
5,937 阅读
4
《吞食天地1》金手指代码
5,107 阅读
5
破解emby-server
4,179 阅读
moonjerx
game
age-of-empires
zx3
san-guo-zhi
尼尔:机械纪元
net
emby
learn-video
docker
torrent
photoshop
route
minio
git
ffmpeg
im
vue
gitlab
typecho
svn
alipay
nasm
srs
mail-server
tailscale
kkfileview
aria2
webdav
synology
redis
oray
chemical
mxsite
math
π
x-ui
digital-currency
server
nginx
baota
k8s
http
cloud
linux
shell
database
vpn
esxi
rancher
domain
k3s
ewomail
os
android
windows
ios
app-store
macos
develop
java
javascript
uniapp
nodejs
hbuildx
maven
android-studio
jetbrain
jenkins
css
mybatis
php
python
hardware
hard-disk
pc
RAM
software
pt
calibre
notion
office
language
literature
philosophy
travel
登录
Search
标签搜索
ubuntu
mysql
openwrt
zerotier
springboot
centos
openvpn
jdk
吞食天地2
synology
spring
idea
windows11
吞食天地1
transmission
google-play
Japanese
xcode
群晖
kiftd
MoonjerX
累计撰写
375
篇文章
累计收到
463
条评论
首页
栏目
moonjerx
game
age-of-empires
zx3
san-guo-zhi
尼尔:机械纪元
net
emby
learn-video
docker
torrent
photoshop
route
minio
git
ffmpeg
im
vue
gitlab
typecho
svn
alipay
nasm
srs
mail-server
tailscale
kkfileview
aria2
webdav
synology
redis
oray
chemical
mxsite
math
π
x-ui
digital-currency
server
nginx
baota
k8s
http
cloud
linux
shell
database
vpn
esxi
rancher
domain
k3s
ewomail
os
android
windows
ios
app-store
macos
develop
java
javascript
uniapp
nodejs
hbuildx
maven
android-studio
jetbrain
jenkins
css
mybatis
php
python
hardware
hard-disk
pc
RAM
software
pt
calibre
notion
office
language
literature
philosophy
travel
页面
关于
壁纸
直播
留言
友链
统计
搜索到
375
篇与
moonjerx
的结果
2025-03-26
PVE开启IOMMU与硬件直通
硬件直通准备1. 确认主板支持主板BIOS/UEFI设置:启用 VT-d(Intel CPU) 或 AMD-V(AMD CPU)。禁用 CSM(仅限i440机型,需确保其他设置为UEFI模式)。ACS Enable(若存在,需启用,自动模式无效)。启用 4G解码(4G Decoding)。禁用 Resizable BAR/Smart Access Memory(AMD GPU直通时避免“代码43错误”)。启用 IOMMU(AMD主板需特别注意)。主显示器设置为CPU/iGPU(若CPU集成显卡)。预分配内存64M。启用IOMMU2. 配置内核参数编辑 /etc/default/grub 文件,修改 GRUB_CMDLINE_LINUX_DEFAULT 行:Intel CPU:GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt initcall_blacklist=sysfb_init pcie_acs_override=downstream,multifunction pci=nommconf"AMD CPU:GRUB_CMDLINE_LINUX_DEFAULT="quiet iommu=pt initcall_blacklist=sysfb_init pcie_acs_override=downstream,multifunction pci=nommconf"其他可选配置:# GVT-g模式(共享显卡) GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt i915.enable_gvt=1 video=efifb:off" # 独占模式(无PVE控制台输出) GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt video=efifb:off"3. 参数释义iommu=pt:启用IOMMU,PT模式优化未直通设备性能。initcall_blacklist=sysfb_init:解决PVE 7.2+的核显驱动冲突。i915.enable_gvt=1:启用Intel GVT-g虚拟显卡技术(需支持的CPU)。pcie_acs_override=downstream:拆分IOMMU组,避免直通导致物理机崩溃。pci=nommconf:禁用PCI配置空间的内存映射,提升稳定性。4. 更新GRUB并重启# 更新引导配置 proxmox-boot-tool refresh # 或 update-grub # 重启系统 reboot5. 验证IOMMU启用# 检查IOMMU状态 dmesg | grep -e DMAR -e IOMMU # 成功示例: # [ 0.000000] DMAR: IOMMU enabled # 验证IOMMU组 find /sys/kernel/iommu_groups/ -type l # 检查中断重映射 dmesg | grep remapping # 成功示例(Intel): # [ 0.175675] DMAR-IR: Enabled IRQ remapping in x2apic mode # 成功示例(AMD): # AMD-Vi: Interrupt remapping enabled显卡直通配置1. 屏蔽显卡驱动编辑 /etc/modprobe.d/pve-blacklist.conf:# NVIDIA blacklist nvidiafb blacklist nouveau blacklist nvidia # AMD blacklist amdgpu blacklist radeon # Intel blacklist snd_hda_codec_hdmi blacklist snd_hda_intel blacklist snd_hda_codec blacklist snd_hda_core blacklist i9152. 忽略显卡警告(NVIDIA专属)编辑 /etc/modprobe.d/kvm.conf:options kvm ignore_msrs=1 report_ignored_msrs=03. 配置VFIO获取设备ID:# 查找显卡及音频设备ID lspci -nn | grep VGA lspci -n -s <设备地址>配置vfio-pci:编辑 /etc/modprobe.d/vfio-pci.conf:options vfio-pci ids=1234:5678,1234:5678 disable_vga=1 # 替换为实际设备ID,多个ID用逗号分隔更新内核并重启:update-initramfs -u reboot4. 验证显卡接管lspci -nnk # 成功示例: # Kernel driver in use: vfio-pci添加显卡到虚拟机1. 创建虚拟机系统选项:机型:选择 q35。BIOS:选择 OVMF(UEFI)。CPU:选择 host 模式。内存:关闭 Ballooning设备。2. 直通显卡进入虚拟机管理界面,点击 硬件 → 添加 → PCI设备。选择目标显卡,勾选:启用所有功能。主GPU(可选,可能影响启动)。ROM-Bar 和 PCI-Express。Intel GVT-g虚拟化核显(Intel 5-10代CPU)1. 配置GRUBGRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt i915.enable_gvt=1 video=efifb:off"2. 加载内核模块编辑 /etc/modules:vfio vfio_iommu_type1 vfio_pci kvmgt3. 验证GVT-gls /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/ # 成功示例: # i915-GVTg_V5_1 i915-GVTg_V5_2 ...注意事项驱动冲突:确保所有显卡驱动被正确屏蔽。内核更新:每次内核升级后需重新运行 update-initramfs -u。日志排查:使用 dmesg | tail 或 journalctl 检查直通失败原因。额外笔记:一、开启iommu,打开编辑 nano /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on video=efifb:off" GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on" 二、加载vfio模块,打开编辑 nano /etc/modules 加上以下内容 vfio vfio_iommu_type1 vfio_pci vfio_virqfd 三、禁用驱动(不同PVE版本可能不同) nano /etc/modprobe.d/pve-blacklist.conf 加入以下内容: block AMD driver blacklist radeon blacklist amdgpu block NVIDIA driver blacklist nouveau blacklist nvidia block INTEL driver blacklist snd_hda_intel blacklist snd_hda_codec_hdmi blacklist i915 # Nvidia blacklist nvidiafb blacklist nouveau blacklist nvidia # AMD blacklist amdgpu blacklist radeon # Intel UHD blacklist snd_hda_codec_hdmi blacklist snd_hda_intel blacklist snd_hda_codec blacklist snd_hda_core blacklist i915 四、查询显卡的PCI ID lspci|grep 570 04:00.0 查看显卡的Device ID 显卡 root@pve:~# lspci -n -s 04:00.0 04:00.0 0300: 1002:67df (rev ef) 声卡 root@pve:~# lspci -n -s 04:00.1 04:00.1 0403: 1002:aaf0 五、编辑vfio nano /etc/modprobe.d/vfio.conf 将设备加入(两个ID就加两个) options vfio-pci 1002:67df options vfio-pci 1002:aaf0 或者: options vfio-pci ids=1002:67df,1002:aaf0 六、更新grub并重启 update-grub && reboot dmesg | grep -e DMAR -e IOMMU 从命令行运行 如果没有输出,则说明有问题。 root@pve:~# dmesg | grep -e DMAR -e IOMMU [ 0.141371] DMAR: IOMMU enabled root@pve:~# dmesg | grep iommu [ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-6.8.12-4-pve root=/dev/mapper/pve-root ro quiet intel_iommu=on video=efifb:off [ 0.141295] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.8.12-4-pve root=/dev/mapper/pve-root ro quiet intel_iommu=on video=efifb:off [ 0.621854] iommu: Default domain type: Translated [ 0.621854] iommu: DMA domain TLB invalidation policy: lazy mode 更新内核,重启 update-initramfs -u reboot
2025年03月26日
26 阅读
0 评论
0 点赞
2025-03-23
Proxmox VE 保姆级安装教程
一、硬件要求CPU:支持虚拟化技术(Intel VT-x/AMD-V)内存:至少 2GB(建议 4GB+)存储:至少 20GB 硬盘空间网络:需连接网络(安装依赖包)二、下载 Proxmox VE访问官网:https://www.proxmox.com选择 Download → Proxmox VE → 下载最新版 ISO 文件(如 proxmox-ve_7.4-1.iso)验证文件完整性(可选):sha256sum proxmox-ve_7.4-1.iso对比官网提供的 SHA256 值。三、制作启动U盘工具推荐:Rufus(Windows)或 Etcher(跨平台)以 Rufus 为例:插入空U盘(建议 4GB+)打开 Rufus → 选择下载的 ISO 文件格式选 FAT32,分区方案选 MBR 或 GPT(根据目标系统)点击开始 → 等待写入完成(此处插入图片:Rufus 配置界面截图)四、BIOS/UEFI 设置重启电脑 → 进入 BIOS/UEFI(开机时按 Del/F2/F12)禁用 Secure Boot(首次安装建议关闭)启用 Virtualization Technology(Intel VT-x/AMD-V)设置启动顺序:将U盘设为第一启动项五、开始安装1. 引导界面插入启动U盘 → 重启 → 选择 Install Proxmox VE(此处插入图片:Proxmox 引导界面截图)2. 安装配置Language:选择语言(中文需后续设置)Keyboard Layout:选择键盘布局Network:选择网卡 → 自动获取 IP 或手动配置Hostname:输入主机名(如 proxmox)Storage:选择存储类型(默认 ZFS 或 LVM)Partitioning:选择 Guided Storage → 全盘安装或手动分区3. 设置 root 密码输入并确认密码(后续登录需用此密码)4. 完成安装等待安装完成 → 重启 → 拔掉U盘六、首次登录1. Web 界面登录访问 https://<你的IP>:8006(浏览器输入)用户名:root密码:安装时设置的密码(此处插入图片:Proxmox Web 界面登录截图)2. SSH 登录(可选)ssh root@<你的IP>七、后续配置(必看)更新系统:apt update && apt upgrade -y配置防火墙:ufw allow 8006/tcp # Web 界面 ufw allow 22/tcp # SSH ufw enable创建存储库:Web 界面 → Datacenter → Storage → 添加 ZFS/LVM 存储添加虚拟机:Web 界面 → Create CT (LXC) 或 Create VM (KVM)八、常见问题无法进入 BIOS:重启时反复按 Del/F2/F12,不同主板按键不同。网络不通:检查网线 → 确保 DHCP 启用 → 手动配置 IP。存储配置失败:选择 LVM 替代 ZFS(新手建议)。提示:完整图文教程可参考官方文档或视频教程(搜索关键词:Proxmox 安装 7.4)。
2025年03月23日
20 阅读
0 评论
0 点赞
2025-03-20
驾考笔记
记1分违法行为(灯光会车货宽高,不带四证)1.不按规定使用灯光。 2.不按规定会车。 3.驾驶机动车载货长度、宽度、高度超过规定。 4.上道路行驶的机动车未放置检验合格标志、保险标志,未随车携带行驶证、机动车驾驶证。 记2分违法行为(交叉行停电盔带,排队插队)1.行经交叉路口不按规定行车或者停车。 2.有拨打、接听手持电话等妨碍安全驾驶的行为。 3.驾驶二轮摩托车,不戴安全头盔。 4.在高速公路或者城市快速路上行驶时,驾驶人未按规定系安全带。 5.遇前方机动车停车排队或者缓慢行驶时,借道超车或者占用对面车道、穿插等候车辆。 6.不按照规定为校车配备安全设备,或者不按照规定对校车进行安全维护。 7.驾驶校车运载学生,不按照规定放置校车标牌、开启校车标志灯,或者不按照经审核确定的线路行驶。 8校车上下学生,不按照规定在校车停靠站点停靠。 9.校车未运载学生上道路行驶,使用校车标牌、校车标志灯和停车指示标志。 10.驾驶校车上道路行驶前,未对校车车况是否符合安全技术要求进行检查,或者驾驶存在安全隐患的校车上道路行驶。 11.在校车载有学生时给车辆加油,或者在校车发动机引擎熄灭前离开驾驶座位。记3分违法行为(超载超速超质量;高低禁入不按道;标线人道减停避;牵引安检超让逆;故障灯光设警告)1.驾驶营运客车(不包括公共汽车)、校车以外的载客汽车载人超过核定人数未达20%。 2.驾驶中型以上载客载货汽车、危险物品运输车辆在高速公路、城市快速路以外的道路上行驶或者驾驶其他机动车行驶超过规定时速未达20%。 3.驾驶货车载物超过核定载质量未达30%。 4.在高速公路上行驶低于规定最低时速。 5.驾驶禁止驶入高速公路的机动车驶入高速公路。 6.在高速公路或者城市快速路上不按规定车道行驶。 7.行经人行横道,不按规定减速、停车、避让行人。 8.违反禁令标志、禁止标线指示。 9.不按规定超车、让行的,或者逆向行驶。 10.违反规定牵引挂车。 11.在道路上车辆发生故障、事故停车后,不按规定使用灯光和设置警告标志。 12.上道路行驶的机动车未按规定定期进行安全技术检验。记6分违法行为()1.机动车驾驶证被暂扣期间驾驶机动车 2.违反道路交通信号灯通行 3.驾驶营运客车(不包括公共汽车)、校车载人超过核定人数未达20%的,或者驾驶其他载客汽车载人超过核定人数20%以上。 4.驾驶中型以上载客载货汽车、校车、危险物品运输车辆在高速公路、城市快速路上行驶超过规定时速未达20%。 5.驾驶中型以上载客载货汽车、校车、危险物品运输车辆在高速公路、城市快速路以外的道路上行驶或者驾驶其他机动车行驶超过规定时速20%以上未达到50%。 6.驾驶货车载物超过核定载质量30%以上或者违反规定载客。 7.驾驶营运客车以外的机动车在高速公路车道内停车。 8在高速公路或者城市快速路上违法用应急车道行驶。 9.低能见度气象条件下,驾驶机动车在高速公路上不按规定行驶。 10.运载超限的不可解体的物品,未按指定的时间、路线、速度行驶或者未悬挂明显标志。 11.载运爆炸物品、易燃易爆化学物品以及剧毒、放射性等危险物品,未按指定的时间、路线、速度行驶或者未悬挂警示标志并采取必要的安全措施。 12.以隐瞒、欺骗手段补领机动车证。 13.连续驾驶中型以上载客汽车、危险物品运输车辆以外的机动车超过4小时未停车休息或者停车休息时间少于20分钟。 14.不按照规定避让校车。记12分违法行为(不符酒驾超载(20%)逃;无牌遮牌伪他牌;高速停车倒逆穿;)1.驾驶与准驾车型不符的机动车。 2.饮酒后驾驶机动车。 3.驾驶营运客车(不包括公共汽车)、校车载人超过核定人数20%以上。 4.造成交通事故后逃逸,尚不构成犯罪。 5.上道路行驶的机动车未悬挂机动车号牌的,或者故意遮挡、污损、不按规定安装机动车号牌。 6.使用伪造、变造的机动车号牌、行驶证、驾驶证、校车标牌或者使用其他机动车号牌、行驶证。 7.在高速公路上倒车、逆行、穿越中央分隔带掉头。 8.驾驶营运客车在高速公路车道内停车。 9.驾驶中型以上载客载货汽车、校车、危险物品运输车辆在高速公路、城大快速路上行驶超过规定时速20%以或者在高速公路、城市快速路以外的道路上行驶超过规定时速50%以上介以及驾驶其他机动车行驶超过规定首页速50%以上。 10.连续驾驶中型以上载客汽车、危险品运输车辆超过4小时末停车休息可评论停车休息时间少于20分钟的。 11.未取得校车驾驶资格驾驶校车。
2025年03月20日
12 阅读
0 评论
0 点赞
2025-02-22
使用 Docker 部署 Ollama 与 Open WebUI 完整指南
基于 DeepSeek-R1 模型的本地化部署方案前言本文详细介绍如何通过 Docker 快速搭建支持 GPU 加速的 Ollama 服务,并集成 Open WebUI 实现可视化交互界面。方案完整支持:✅ 多 GPU 并行计算✅ 模型持久化存储✅ 企业级权限管理✅ 中英文双语支持前置准备硬件要求NVIDIA 显卡(显存 ≥8GB,推荐 RTX 3060 以上)内存 ≥16GB磁盘空间 ≥50GB软件依赖# 安装 Docker 和 NVIDIA 容器工具包 sudo apt-get update sudo apt-get install -y docker.io nvidia-container-toolkit sudo systemctl restart docker # 验证 GPU 支持 docker run --rm --gpus all nvidia/cuda:11.8.0-base-ubuntu22.04 nvidia-smi如果报错:sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit Hit:1 http://hk.archive.ubuntu.com/ubuntu jammy InRelease Hit:2 http://hk.archive.ubuntu.com/ubuntu jammy-updates InRelease Hit:3 http://hk.archive.ubuntu.com/ubuntu jammy-backports InRelease Hit:4 http://hk.archive.ubuntu.com/ubuntu jammy-security InRelease Reading package lists... Done Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package nvidia-container-toolkit你的系统中可能未正确添加 NVIDIA Container Toolkit 的软件源。请按以下步骤操作:解决方案如下:添加 NVIDIA 官方源和密钥# 安装依赖 sudo apt-get install -y curl # 添加 GPG 密钥 curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - # 添加仓库(注意系统代号匹配) distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list更新并安装sudo apt-get update sudo apt-get install -y nvidia-container-toolkit验证安装nvidia-ctk --version常见问题排查:如果系统代号不匹配(如 Ubuntu 22.04 应为 ubuntu22.04),可手动替换上述命令中的 $distribution若仍报错,尝试清理缓存:sudo rm -rf /var/lib/apt/lists/* sudo apt-get update替代方案(若网络受限):# 通过 NVIDIA Docker 仓库安装 sudo apt-get install -y nvidia-docker2 sudo systemctl restart docker部署流程1. 部署 Ollama 服务# 创建持久化存储目录 mkdir -p ~/ollama_storage # 启动 Ollama 容器 docker run -d --name=ollama \ --gpus=all \ --restart unless-stopped \ -p 30037:11434 \ -v /home/$USER/dockerfile/ollama/data:/root/.ollama \ ollama/ollama # 下载 DeepSeek-R1 模型 docker exec -it ollama ollama run deepseek-r1:7b如果运行容器报错:xdboy@xdserver:~$ docker run -d --name=ollama \ --gpus=all \ --restart unless-stopped \ -p 30037:11434 \ -v /home/$USER/dockerfile/ollama/data:/root/.ollama \ ollama/ollama Unable to find image 'ollama/ollama:latest' locally latest: Pulling from ollama/ollama d9802f032d67: Pull complete 161508c220d5: Pull complete 6b78c8d09c74: Pull complete e0c387d586cc: Pull complete Digest: sha256:82956f40bb1f307c77f7a8c3ed91c7a37e072ed757ff143e34210a7b991b9480 Status: Downloaded newer image for ollama/ollama:latest 78a836df1c7ce1436b41b2d08e9d74764ae732fb06257308430ac9488ad8102d docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy' nvidia-container-cli: initialization error: load library failed: libnvidia-ml.so.1: cannot open shared object file: no such file or directory: unknown.你遇到的错误 libnvidia-ml.so.1: cannot open shared object file 表明 NVIDIA 容器运行时未能正确加载 GPU 驱动。以下是完整解决方案:问题原因NVIDIA 驱动未安装 Docker 容器需要宿主机已安装 NVIDIA 驱动并通过 nvidia-container-toolkit 暴露给容器。nvidia-container-toolkit 配置未生效 即使安装了工具包,Docker 可能未正确绑定 NVIDIA 驱动库。分步解决方案1. 确认 NVIDIA 驱动已安装运行以下命令检查驱动状态:nvidia-smi # 应有 GPU 信息输出若无输出,需先安装 NVIDIA 驱动:sudo ubuntu-drivers autoinstall # 自动安装推荐驱动 sudo reboot2. 修复 nvidia-container-toolkit 配置重新配置 NVIDIA 容器运行时并重启 Docker:# 确认工具包已安装 sudo apt-get install -y nvidia-container-toolkit # 重新生成配置 sudo nvidia-ctk runtime configure --runtime=docker # 重启 Docker 服务 sudo systemctl restart docker3. 验证容器 GPU 访问运行测试容器检查 GPU 是否可见:docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi若成功输出 GPU 信息,则配置已修复。4. 重新运行你的 Ollama 容器docker run -d --name=ollama \ --gpus=all \ --restart unless-stopped \ -p 30037:11434 \ -v /home/$USER/dockerfile/ollama/data:/root/.ollama \ ollama/ollama常见问题补充如果仍报错 libnvidia-ml.so.1强制绑定 NVIDIA 库(显式指定驱动路径):docker run -d --name=ollama \ --gpus=all \ -v /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1:/usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1 \ ollama/ollama若系统为 WSL2需在 Windows 宿主机安装 NVIDIA 驱动,并在 WSL2 中启用 GPU 支持:# 在 WSL2 中安装驱动兼容层 sudo apt-get install -y nvidia-cuda-toolkit关键日志检查若问题持续,检查 Docker 和 NVIDIA 容器日志:# Docker 日志 journalctl -u docker.service --since "5 minutes ago" # NVIDIA 容器日志 nvidia-container-cli -k -d /dev/tty info2. 部署 Open WebUIdocker run -d \ --name=open-webui \ -p 3000:8080 \ -e OLLAMA_API_BASE_URL=http://host.docker.internal:11434 \ --add-host=host.docker.internal:host-gateway \ --restart unless-stopped \ ghcr.io/open-webui/open-webui:main配置说明关键参数解析参数作用示例值--gpus=all启用全部 GPU必填-v ~/ollama_storage模型存储路径可自定义目录OLLAMA_API_BASE_URLOllama 服务地址保持默认网络架构示意图[用户浏览器] <-> [Open WebUI:3000] <-> [Ollama API:11434] ↑ | └── 模型数据持久化存储 ───┘验证部署1. 检查服务状态docker ps -a | grep -E "ollama|open-webui"2. 测试 API 接口curl http://localhost:11434/api/tags # 应返回包含 deepseek-r1 的模型列表3. 访问 Web 界面浏览器打开 http://[服务器IP]:3000,完成注册后:点击左下角模型选择器选择 deepseek-r1:7b开始对话测试高级配置多 GPU 分配docker update ollama --gpus '"device=0,1"' # 指定使用前两块 GPU中文支持优化登录 Open WebUI进入 Settings → Global Settings设置 Default Language 为 Chinese (Simplified)常见问题解决Q1: 容器启动报错 GPU not found# 重新配置 NVIDIA 容器 sudo nvidia-ctk runtime configure --runtime=docker sudo systemctl restart dockerQ2: 模型下载速度慢# 在 Ollama 容器内配置镜像加速 docker exec -it ollama bash echo 'OLLAMA_MIRROR="https://mirror.example.com"' >> /etc/ollama.envQ3: 对话历史丢失# 检查 Open WebUI 数据卷 docker inspect open-webui | grep "Mounts"应用场景示例智能客服集成import requests def ask_ai(question): response = requests.post( "http://localhost:11434/api/generate", json={ "model": "deepseek-r1:7b", "prompt": f"作为客服助手回答:{question}", "stream": False } ) return response.json()["response"]自动生成 SQL 查询性能优化建议量化部署:使用 GGUF 格式量化模型docker exec -it ollama ollama run deepseek-r1:7b-q4缓存优化:调整 Ollama 的 OLLAMA_NUM_PARALLEL 环境变量负载均衡:部署多个 Ollama 实例并使用 Nginx 分流总结本文方案相比传统部署方式具备三大优势:快速部署:一行命令完成环境搭建资源隔离:Docker 容器保证服务稳定性弹性扩展:轻松实现多模型并行服务建议企业用户在此基础上进一步:配置 HTTPS 安全访问集成 LDAP 身份验证设置自动化备份策略立即按照本指南部署您的 AI 助手吧!如有问题欢迎在评论区留言讨论。
2025年02月22日
60 阅读
0 评论
1 点赞
2025-01-26
查询IP地址信息的免费开放接口
在开发网络应用时,了解用户地理位置是提升用户体验的关键之一。本文将介绍多个免费的开放API来查询IP地址的具体信息,并展示其请求方式和返回结果。我们将以阿里巴巴接口文档规范为标准,详细说明每个接口的使用方法。1. 阿里巴巴IP查询接口请求地址https://ip.taobao.com/outGetIpInfo?ip=121.8.215.106&accessKey=alibaba-inc请求方法GET参数说明参数名必选类型说明ip是string待查询的IP地址accessKey是string访问密钥返回数据格式{ "data": { "area": "", "country": "中国", "isp_id": "100017", "queryIp": "121.8.215.106", "city": "广州", "ip": "121.8.215.106", "isp": "电信", "county": "", "region_id": "440000", "area_id": "", "county_id": null, "region": "广东", "country_id": "CN", "city_id": "440100" }, "msg": "query success", "code": 0 }2. 百度IP查询接口请求地址https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?query=119.135.194.24&co=&resource_id=6006&ie=utf8&oe=gbk&format=json请求方法GET参数说明参数名必选类型说明query是string待查询的IP地址resource_id是int资源IDie是string输入编码oe是string输出编码format是string数据格式返回数据格式{ "status": "0", "t": "", "set_cache_time": "", "data": [ { "location": "广东省清远市 电信", "origip": "119.135.194.24" } ] }3. VORE-API IP查询接口请求地址https://api.vore.top/api/IPdata?ip=121.8.215.106请求方法GET参数说明参数名必选类型说明ip是string待查询的IP地址返回数据格式{ "code": 200, "msg": "SUCCESS", "ipinfo": { "type": "ipv4", "text": "121.8.215.106", "cnip": true }, "ipdata": { "info1": "广东省", "info2": "广州市", "info3": "增城", "isp": "电信" }, "adcode": { "o": "广东省广州市增城 - 电信" }, "tips": "接口由VORE-API(https://api.vore.top/)免费提供" }4. 百度地图IP定位接口请求地址https://api.map.baidu.com/location/ip?ak=LA46NZu12hG3MHAfH9jhDRhObBd0uR9t&ip=121.8.215.106请求方法GET参数说明参数名必选类型说明ak是stringAPI密钥ip是string待查询的IP地址返回数据格式{ "address": "CN|广东省|广州市|None|None|100|100", "content": { "address_detail": { "province": "广东省", "city": "广州市", "district": "" }, "address": "广东省广州市", "point": { "x": "12609455.26", "y": "2631453.98" } }, "status": 0 }5. IP.cn API请求地址https://www.ip.cn/api/index?ip=121.8.215.106&type=1请求方法GET参数说明参数名必选类型说明ip是string待查询的IP地址type是int查询类型返回数据格式{ "rs": 1, "code": 0, "address": "中国 广东省 广州市 电信", "ip": "121.8.215.106", "isDomain": 0 }6. db-ip.com API请求地址https://db-ip.com/demo/home.php?s=121.8.215.106请求方法GET返回数据格式{ "demoInfo": { "ipAddress": "121.8.215.106", "continentName": "Asia", "countryName": "中国", "stateProv": "广东", "city": "广州", "timezone": "Asia/Shanghai", "latitude": 23.1317, "longitude": 113.266, "isp": "Chinanet", "organization": "Chinanet GD" } }7. OpenData百度API请求地址https://opendata.baidu.com/api.php?co=&resource_id=6006&oe=utf8&query=121.8.215.106请求方法GET参数说明参数名必选类型说明query是string待查询的IP地址resource_id是int资源IDoe是string输出编码返回数据格式{ "status": "0", "data": [ { "location": "广东省广州市 电信", "origip": "121.8.215.106" } ] }8. Whois.pconline.com.cn API请求地址https://whois.pconline.com.cn/ipJson.jsp?ip=121.8.215.106&json=true请求方法GET参数说明参数名必选类型说明ip是string待查询的IP地址json是bool是否返回JSON返回数据格式{ "ip": "121.8.215.106", "pro": "广东省", "city": "广州市", "addr": "广东省广州市 电信" }9. API.IP.SB GeoIP接口请求地址https://api.ip.sb/geoip/121.8.215.106请求方法GET返回数据格式{ "organization": "China Telecom", "longitude": 113.2539, "city": "Guangzhou", "timezone": "Asia/Shanghai", "isp": "China Telecom", "offset": 28800, "region": "Guangdong", "asn": 4134, "asn_organization": "Chinanet", "country": "China", "ip": "121.8.215.106", "latitude": 23.1181, "continent_code": "AS", "country_code": "CN", "region_code": "GD" }10. IPINFO.IO JSON接口请求地址https://ipinfo.io/121.8.215.106/json请求方法GET返回数据格式{ "ip": "121.8.215.106", "city": "Shenzhen", "region": "Guangdong", "country": "CN", "loc": "22.5455,114.0683", "org": "AS4134 CHINANET-BACKBONE", "postal": "518000", "timezone": "Asia/Shanghai", "readme": "https://ipinfo.io/missingauth" }11. IPINFO.IO Widget接口请求地址https://ipinfo.io/widget/demo/121.8.215.106请求方法GET返回数据格式{ "input": "121.8.215.106", "data": { "ip": "121.8.215.106", "city": "Shenzhen", "region": "Guangdong", "country": "CN", "loc": "22.5455,114.0683", "org": "AS4134 CHINANET-BACKBONE", "postal": "518000", "timezone": "Asia/Shanghai", "is_anycast": false, "is_mobile": false, "is_anonymous": false, "is_satellite": false, "is_hosting": false, "asn": { "asn": "AS4134", "name": "CHINANET-BACKBONE", "domain": "chinatelecom.com.cn", "route": "121.8.0.0/13", "type": "isp" }, "company": { "name": "CHINANET Guangdong province network", "domain": "chinatelecom.cn", "type": "isp" }, "privacy": { "vpn": false, "proxy": false, "tor": false, "relay": false, "hosting": false, "service": "" }, "abuse": { "address": "No.31 ,jingrong street,beijing, 100032", "country": "CN", "email": "anti-spam@chinatelecom.cn", "name": "ABUSE CHINANETCN", "network": "121.8.0.0/13", "phone": "+000000000" } } }12. API.IPBASE.COM IP查询接口请求地址https://api.ipbase.com/v1/json/121.8.215.106请求方法GET返回数据格式{ "ip": "121.8.215.106", "country_code": "CN", "country_name": "China", "region_code": "CN-GD", "region_name": "Guangdong", "city": "Guangzhou", "zip_code": "510140", "time_zone": "Asia/Shanghai", "latitude": 23.1273612976074, "longitude": 113.264572143555, "metro_code": 0 }13. IP-API.IO JSON接口请求地址https://ip-api.io/json?ip=121.8.215.106请求方法GET返回数据格式{ "ip": "27.158.109.238", "countryCode": "CN", "country_code": "CN", "countryName": "China", "country_name": "China", "isInEuropeanUnion": false, "is_in_european_union": false, "regionName": "Guangdong", "region_name": "Guangdong", "regionCode": "GD", "region_code": "GD", "city": "Guangzhou", "zipCode": "", "zip_code": "", "timeZone": "Asia/Shanghai", "time_zone": "Asia/Shanghai", "latitude": 23.1181, "longitude": 113.2539, "metroCode": 0, "metro_code": 0, "organisation": "Chinanet", "flagUrl": "https://www.countryflags.io/CN/flat/64.png", "emojiFlag": "https://www.countryflags.io/CN/emoji.png", "currencySymbol": "", "currency": "", "callingCode": "", "countryCapital": "", "suspiciousFactors": { "isProxy": false, "isTorNode": false, "isSpam": false, "isSuspicious": false } }14. API.IPAPI.IS 查询接口请求地址https://api.ipapi.is/?ip=121.8.215.106请求方法GET返回数据格式{ "ip": "121.8.215.106", "rir": "APNIC", "is_bogon": false, "is_mobile": false, "is_crawler": false, "is_datacenter": false, "is_tor": false, "is_proxy": true, "is_vpn": false, "is_abuser": true, "company": { "name": "CHINANET Guangdong province network", "abuser_score": "0.0003 (Very Low)", "domain": "chinatelecom.cn", "type": "isp", "network": "121.8.0.0 - 121.15.255.255", "whois": "https://api.ipapi.is/?whois=121.8.0.0" }, "abuse": { "name": "IPMASTER CHINANET-GD", "address": "NO.18,RO. ZHONGSHANER,YUEXIU DISTRIC,GUANGZHOU", "email": "anti-spam@chinatelecom.cn", "phone": "+86-20-87189274" }, "asn": { "asn": 4134, "abuser_score": "0.001 (Low)", "route": "121.8.0.0/13", "descr": "CHINANET-BACKBONE No.31,Jin-rong Street, CN", "country": "cn", "active": true, "org": "CHINANET BACKBONE", "domain": "chinatelecom.cn", "abuse": "anti-spam@chinatelecom.cn", "type": "business", "updated": "2021-06-15", "rir": "APNIC", "whois": "https://api.ipapi.is/?whois=AS4134" }, "location": { "is_eu_member": false, "calling_code": "86", "currency_code": "CNY", "continent": "AS", "country": "China", "country_code": "CN", "state": "Guangdong", "city": "Guangzhou", "latitude": 23.11667, "longitude": 113.25, "zip": "510000", "timezone": "Asia/Shanghai", "local_time": "2025-01-26T17:34:38+08:00", "local_time_unix": 1737884078, "is_dst": false }, "elapsed_ms": 0.92 }15. IPAPI.COM 查询接口请求地址https://ipapi.com/ip_api.php?ip=121.8.215.106请求方法GET返回数据格式{ "ip": "121.8.215.106", "hostname": "121.8.215.106", "type": "ipv4", "continent_code": "AS", "continent_name": "Asia", "country_code": "CN", "country_name": "China", "region_code": "GD", "region_name": "Guangdong", "city": "Guangzhou", "zip": "510000", "latitude": 23.124719619751, "longitude": 113.238609313965, "msa": null, "dma": null, "radius": null, "ip_routing_type": "fixed", "connection_type": "tx", "location": { "geoname_id": 1809858, "capital": "Beijing", "languages": [ { "code": "zh", "name": "Chinese", "native": "中文" } ], "country_flag": "https://assets.ipstack.com/flags/cn.svg", "country_flag_emoji": "🇨🇳", "country_flag_emoji_unicode": "U+1F1E8 U+1F1F3", "calling_code": "86", "is_eu": false }, "time_zone": { "id": "Asia/Shanghai", "current_time": "2025-01-26T17:27:58+08:00", "gmt_offset": 28800, "code": "CST", "is_daylight_saving": false }, "currency": { "code": "CNY", "name": "Chinese Yuan", "plural": "Chinese yuan", "symbol": "CN¥", "symbol_native": "CN¥" }, "connection": { "asn": 4134, "isp": "Chinanet", "sld": "kj-textile", "tld": "com", "carrier": "chinanet", "home": true, "organization_type": "Internet Service Provider", "isic_code": "J6110", "naics_code": "517311" }, "security": { "is_proxy": false, "proxy_type": null, "is_crawler": false, "crawler_name": null, "crawler_type": null, "is_tor": false, "threat_level": "low", "threat_types": null, "proxy_last_detected": null, "proxy_level": null, "vpn_service": null, "anonymizer_status": null, "hosting_facility": false } }16. API.IP2LOCATION.IO 查询接口请求地址https://api.ip2location.io/?ip=121.8.215.106请求方法GET返回数据格式{ "ip": "121.8.215.106", "country_code": "CN", "country_name": "China", "region_name": "Guangdong", "city_name": "Guangzhou", "latitude": 23.12736, "longitude": 113.26457, "zip_code": "510140", "time_zone": "+08:00", "asn": "4134", "as": "Asia Pacific Network Information Centre", "is_proxy": true, "message": "Limit to 500 queries per day. Sign up for a Free plan at https://www.ip2location.io to get 30K queries per month." }17. REALIP.CC 查询接口请求地址https://realip.cc/?ip=121.8.215.106请求方法GET返回数据格式{ "ip": "121.8.215.106", "city": "Guangzhou", "province": "Guangdong", "country": "China", "continent": "Asia", "isp": "Chinanet", "time_zone": "Asia/Shanghai", "latitude": 23.1181, "longitude": 113.2539, "postal_code": null, "iso_code": "CN", "network": "121.8.128.0/17", "notice": "api文档在/docs路径下,调用并发数是有限制的 ©2021-09-27->now", "provider": "Powered by Bboysoul", "blog": "https://www.bboy.app", "tg_group": "https://t.me/bboyapp", "data_updatetime": 20250102, "count": 195369546 }18. IPAPI.CO 查询接口请求地址https://ipapi.co/121.8.215.106/json/请求方法GET返回数据格式{ "ip": "121.8.215.106", "network": "121.8.128.0/17", "version": "IPv4", "city": "Guangzhou", "region": "Guangdong", "region_code": "GD", "country": "CN", "country_name": "China", "country_code": "CN", "country_code_iso3": "CHN", "country_capital": "Beijing", "country_tld": ".cn", "continent_code": "AS", "in_eu": false, "postal": null, "latitude": 23.1181, "longitude": 113.2539, "timezone": "Asia/Shanghai", "utc_offset": "+0800", "country_calling_code": "+86", "currency": "CNY", "currency_name": "Yuan Renminbi", "languages": "zh-CN,yue,wuu,dta,ug,za", "country_area": 9596960.0, "country_population": 1411778724, "asn": "AS4134", "org": "Chinanet" }19. GET.GEOJS.IO 查询接口请求地址https://get.geojs.io/v1/ip/geo/121.8.215.106.json请求方法GET返回数据格式{ "country_code3": "CHN", "continent_code": "AS", "region": "Guangdong", "latitude": "23.1181", "longitude": "113.2539", "accuracy": 20, "organization_name": "Chinanet", "timezone": "Asia/Shanghai", "asn": 4134, "organization": "AS4134 Chinanet", "city": "Guangzhou", "ip": "121.8.215.106", "area_code": "0", "country": "China", "country_code": "CN" }结语通过上述多个接口的对比和使用,开发者可以根据自身需求选择最适合的API进行IP地址查询。无论是获取详细的地理位置信息,还是简单的城市级别定位,这些接口都能提供丰富的支持。
2025年01月26日
22 阅读
0 评论
0 点赞
1
2
...
75
您的IP: