From 543998b673b2e9014cc9a4457d17fe5fdb7c72c5 Mon Sep 17 00:00:00 2001 From: satori Date: Mon, 4 Nov 2024 06:06:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E8=A3=85=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resize.sh | 39 --------------------------------------- start.sh | 25 +++++++++++-------------- update.sh | 4 ---- 3 files changed, 11 insertions(+), 57 deletions(-) delete mode 100755 resize.sh delete mode 100755 update.sh diff --git a/resize.sh b/resize.sh deleted file mode 100755 index 13fcf3f..0000000 --- a/resize.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -# 定时整理 etcd 空间防止 etcd 服务挂掉 -# 将此脚本加入定时任务(每日1次, 一次一片) - -# crontab -e -# 15 * * * * /bin/sh /home/milvus/resize.sh - -# 查看 Milvus 及其依賴的狀態(etcd 和 MinIO) -# sudo systemctl status milvus -# sudo systemctl status milvus-etcd -# sudo systemctl status milvus-minio - -echo "使用API3:" -export ETCDCTL_API=3 - -echo "查看空间占用:" -etcdctl endpoint status --write-out table - -echo "查看告警状态:" -etcdctl alarm list - -echo "获取当前版本:" -rev=$(etcdctl --endpoints=http://127.0.0.1:2379 endpoint status --write-out="json" | egrep -o '"revision":[0-9]*' | egrep -o '[0-9].*') - -echo "压缩掉所有旧版本:" -etcdctl --endpoints=http://127.0.0.1:2379 compact $rev - -echo "整理多余的空间:" -etcdctl --endpoints=http://127.0.0.1:2379 defrag - -echo "取消告警信息:" -etcdctl --endpoints=http://127.0.0.1:2379 alarm disarm - -echo "再次查看空间占用:" -etcdctl endpoint status --write-out table - -echo "再次查看告警状态:" -etcdctl alarm list diff --git a/start.sh b/start.sh index d130fc9..054c05e 100755 --- a/start.sh +++ b/start.sh @@ -1,22 +1,19 @@ #!/bin/sh + +# 安装依赖(使用清华镜像) +pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple + + +# 启动服务 +cd ~/reverse_image_search_gpu +pm2 start python3 --name reverse_image_search_gpu -- main.py 5002 + + # pip freeze > requirements.txt -#pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple #python3 -m pip install -U pyOpenSSL cryptography +#python main.py >/dev/null 2>&1 & -# 使用 uvicorn 启动两个工作进程, 并支持自动重载 -#uvicorn main:app --host 0.0.0.0 --port 5001 --workers 2 --reload >/dev/null 2>&1 & -#uvicorn main:app --host 0.0.0.0 --port 5002 >/dev/null 2>&1 & - -python main.py >/dev/null 2>&1 & - -# 为容器设定自动重启 -#docker update --restart=always 51bb94aa2726 - -#cd ~/reverse_image_search -#pm2 start python3 --name reverse-1 -- main.py 5001 -#pm2 start python3 --name reverse-2 -- main.py 5002 -#pm2 start python3 --name reverse-3 -- main.py 5003 # 某些系统下,需要手动安装指定版本 opencv-python (4.7引用zlib错误) # pip install opencv-python==4.6.0.66 -i https://pypi.tuna.tsinghua.edu.cn/simple diff --git a/update.sh b/update.sh deleted file mode 100755 index b026c87..0000000 --- a/update.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# 服务器跟随更新 -ssh ai "cd ~/reverse_image_search_gpu; git pull;"