安装运行
This commit is contained in:
39
resize.sh
39
resize.sh
@@ -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
|
25
start.sh
25
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
|
||||
|
Reference in New Issue
Block a user