juechafun/01-项目/2602-物联实验室/城院附校-主机-.md

188 lines
4.9 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
#领域/未知
#复盘/0 #临时/备忘 #状态/待处理
20260312-备忘-主题名-文件内容
## 一句话描述
[________]
---
向日葵:
设备码289 699 930
密码cyfx-510
## Ubuntu
```bash
sudo apt update && sudo apt upgrade
sudo apt install openssh-server
```
服务器配置
静态IP 192.168.0.151
用户名 nyt
密码: 123456
## 1Panel
在线文档: [在线安装](https://1panel.cn/docs/v2/installation/online_installation/#2)
```bash
# 安装 1Panel
sudo apt install curl -y
sudo bash -c "$(curl -sSL https://resource.fit2cloud.com/1panel/package/v2/quick_start.sh)"
```
### 配置信息
安装路径: /opt
1Panel 端口: 8000
安全入口: cyfx
用户名admin
密码admin123456
内部地址http://192.168.0.151:8000/cyfx
## NVIDIA 驱动
```bash
# 检测 GPU 硬件
lspci | grep -i nvidia
sudo apt install ubuntu-drivers-common -y
# 查看推荐驱动版本
ubuntu-drivers devices
# driver   : nvidia-driver-580-open - distro non-free recommended
sudo apt install nvidia-driver-580-open -y
reboot
nvidia-smi
```
```bash
nyt@nyt-LEGION-REN7000K-26IRX:~/workspace$ nvidia-smi
Thu Mar 12 16:44:04 2026      
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.126.09             Driver Version: 580.126.09     CUDA Version: 13.0     |
+-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3060        Off |   00000000:01:00.0 Off |                  N/A |
|  0%   35C    P8             10W /  170W |     152MiB /  12288MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            1386      G   /usr/lib/xorg/Xorg                       52MiB |
|    0   N/A  N/A            1655      G   /usr/bin/gnome-shell                     76MiB |
+-----------------------------------------------------------------------------------------+
```
## 安装 NVIDIA docker Container Toolkit
```bash
sudo usermod -aG docker $USER
# 配置 NVIDIA Container Toolkit 仓库
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
# 更新包列表
sudo apt-get update
# 安装 NVIDIA Container Toolkit
sudo apt-get install -y nvidia-container-toolkit
# 重启 Docker
sudo systemctl restart docker
# 配置 Docker 守护进程以使用 NVIDIA 运行时
sudo nvidia-ctk runtime configure --runtime=docker
# 重启 Docker 使配置生效
sudo systemctl restart docker
```
## Ollama
端口8001
拉取qwen3.5:0.8b
## 安装 Dify
```bash
git clone https://github.com/langgenius/dify.git
cd dify/docker
# 复制环境配置示例文件(根据实际文件名调整)
cp .env.example .env
# 测试bug修改配置文件后长时间初始加载使用默认配置成功安装登录
```
```yaml
# API 服务绑定地址,默认 0.0.0.0 表示所有地址都可访问
DIFY_BIND_ADDRESS=0.0.0.0
# API 服务绑定端口,默认 5001
DIFY_PORT=8004
CONSOLE_API_URL=http://192.168.0.151
CONSOLE_WEB_URL=http://192.168.0.151
SERVICE_API_URL=http://192.168.0.151
TRIGGER_URL=http://192.168.0.151
APP_API_URL=http://192.168.0.151
APP_WEB_URL=http://192.168.0.151
FILES_URL=http://192.168.0.151
# HTTP 端口
NGINX_PORT=80
# 暴露的 Nginx 端口
EXPOSE_NGINX_PORT=8005
EXPOSE_NGINX_SSL_PORT=443
```
```yaml
# 暴露的 Nginx 端口
EXPOSE_NGINX_PORT=8005
```