orztv commited on
Commit ·
aa0785d
1
Parent(s): e5d67eb
update
Browse filesFiles changed (2)
- Dockerfile+4
- run.sh+43-3
63 unmodified lines64656667686963 unmodified lines&& tar xvf qdrant.tar.gz \&& mv qdrant /usr/local/bin/ \&& rm qdrant.tar.gz \# 清理&& apt-get clean \&& rm -rf /var/lib/apt/lists/* \63 unmodified lines6465666768697071727363 unmodified lines&& tar xvf qdrant.tar.gz \&& mv qdrant /usr/local/bin/ \&& rm qdrant.tar.gz \# 创建 Qdrant 配置目录和数据目录&& mkdir -p /home/pn/.n8n/qdrant/storage \&& mkdir -p /home/pn/.n8n/qdrant/config \&& chown -R pn:pn /home/pn/.n8n/qdrant \# 清理&& apt-get clean \&& rm -rf /var/lib/apt/lists/* \
59 unmodified lines60616263646566672 unmodified lines70717273747576777879808111 unmodified lines9394959697989959 unmodified lines# 启动 Qdrant 服务start_qdrant() {echo "Starting Qdrant server..."mkdir -p /home/pn/.n8n/qdrantqdrant > /home/pn/.n8n/qdrant/qdrant.log 2>&1 &# 等待 Qdrant 启动local timeout=302 unmodified lineswhile [ $SECONDS -lt $end ]; doif curl -s http://localhost:6333/health >/dev/null; thenecho "Qdrant server started successfully"return 0fisleep 1doneecho "Failed to start Qdrant server"exit 1}11 unmodified lines# 检查 Qdrantecho "Qdrant 状态:"curl -s http://localhost:6333/metrics}# 主流程59 unmodified lines60616263646566676869707172737475767778798081828384852 unmodified lines88899091929394959697989910010110210310410510610710810911011111 unmodified lines12312412512612712812913013113213313413513613713813959 unmodified lines# 启动 Qdrant 服务start_qdrant() {echo "Starting Qdrant server..."# 确保目录存在并有正确的权限mkdir -p /home/pn/.n8n/qdrant/storagemkdir -p /home/pn/.n8n/qdrant/config# 创建 Qdrant 配置文件cat > /home/pn/.n8n/qdrant/config/config.yaml <<EOFservice:host: 0.0.0.0port: 6333grpc_port: 6334storage:storage_path: /home/pn/.n8n/qdrant/storagelog_level: INFOEOF# 使用配置文件启动 Qdrantqdrant --config /home/pn/.n8n/qdrant/config/config.yaml > /home/pn/.n8n/qdrant/qdrant.log 2>&1 &# 等待 Qdrant 启动local timeout=302 unmodified lineswhile [ $SECONDS -lt $end ]; doif curl -s http://localhost:6333/health >/dev/null; thenecho "Qdrant server started successfully"# 输出版本信息echo "Qdrant version:"curl -s http://localhost:6333/versionreturn 0fiecho "Waiting for Qdrant to start..."sleep 1# 检查是否有错误日志if grep -i "error" /home/pn/.n8n/qdrant/qdrant.log >/dev/null 2>&1; thenecho "Error found in Qdrant logs:"tail -n 10 /home/pn/.n8n/qdrant/qdrant.logfidoneecho "Failed to start Qdrant server"echo "Last 10 lines of Qdrant log:"tail -n 10 /home/pn/.n8n/qdrant/qdrant.logexit 1}11 unmodified lines# 检查 Qdrantecho "Qdrant 状态:"if curl -s http://localhost:6333/metrics >/dev/null; thenecho "Qdrant 运行正常"curl -s http://localhost:6333/metrics# 显示集合信息echo "Qdrant 集合列表:"curl -s http://localhost:6333/collectionselseecho "Qdrant 服务异常"tail -n 10 /home/pn/.n8n/qdrant/qdrant.logfi}# 主流程
Dockerfile+4
run.sh+43-3