orztv
commited on
Commit
·
72eeb27
1
Parent(s):
03f0612
update
Browse files- Dockerfile +2 -0
- run.sh +14 -0
Dockerfile
CHANGED
@@ -67,7 +67,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
67 |
# 创建 Qdrant 配置目录和数据目录
|
68 |
&& mkdir -p /home/pn/.n8n/qdrant/storage \
|
69 |
&& mkdir -p /home/pn/.n8n/qdrant/config \
|
|
|
70 |
&& chown -R pn:pn /home/pn/.n8n/qdrant \
|
|
|
71 |
# 清理
|
72 |
&& apt-get clean \
|
73 |
&& rm -rf /var/lib/apt/lists/* \
|
|
|
67 |
# 创建 Qdrant 配置目录和数据目录
|
68 |
&& mkdir -p /home/pn/.n8n/qdrant/storage \
|
69 |
&& mkdir -p /home/pn/.n8n/qdrant/config \
|
70 |
+
&& mkdir -p /home/pn/.n8n/qdrant/snapshots \
|
71 |
&& chown -R pn:pn /home/pn/.n8n/qdrant \
|
72 |
+
&& chmod -R 755 /home/pn/.n8n/qdrant \
|
73 |
# 清理
|
74 |
&& apt-get clean \
|
75 |
&& rm -rf /var/lib/apt/lists/* \
|
run.sh
CHANGED
@@ -64,6 +64,11 @@ start_qdrant() {
|
|
64 |
# 确保目录存在并有正确的权限
|
65 |
mkdir -p /home/pn/.n8n/qdrant/storage
|
66 |
mkdir -p /home/pn/.n8n/qdrant/config
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
# 创建 Qdrant 配置文件
|
69 |
cat > /home/pn/.n8n/qdrant/config/config.yaml <<EOF
|
@@ -74,10 +79,14 @@ service:
|
|
74 |
|
75 |
storage:
|
76 |
storage_path: /home/pn/.n8n/qdrant/storage
|
|
|
77 |
|
78 |
log_level: INFO
|
79 |
EOF
|
80 |
|
|
|
|
|
|
|
81 |
# 使用配置文件启动 Qdrant
|
82 |
qdrant --config-path /home/pn/.n8n/qdrant/config/config.yaml > /home/pn/.n8n/qdrant/qdrant.log 2>&1 &
|
83 |
|
@@ -100,12 +109,17 @@ EOF
|
|
100 |
if grep -i "error" /home/pn/.n8n/qdrant/qdrant.log >/dev/null 2>&1; then
|
101 |
echo "Error found in Qdrant logs:"
|
102 |
tail -n 10 /home/pn/.n8n/qdrant/qdrant.log
|
|
|
|
|
|
|
103 |
fi
|
104 |
done
|
105 |
|
106 |
echo "Failed to start Qdrant server"
|
107 |
echo "Last 10 lines of Qdrant log:"
|
108 |
tail -n 10 /home/pn/.n8n/qdrant/qdrant.log
|
|
|
|
|
109 |
exit 1
|
110 |
}
|
111 |
|
|
|
64 |
# 确保目录存在并有正确的权限
|
65 |
mkdir -p /home/pn/.n8n/qdrant/storage
|
66 |
mkdir -p /home/pn/.n8n/qdrant/config
|
67 |
+
mkdir -p /home/pn/.n8n/qdrant/snapshots
|
68 |
+
|
69 |
+
# 设置正确的权限
|
70 |
+
chmod -R 755 /home/pn/.n8n/qdrant
|
71 |
+
chown -R pn:pn /home/pn/.n8n/qdrant
|
72 |
|
73 |
# 创建 Qdrant 配置文件
|
74 |
cat > /home/pn/.n8n/qdrant/config/config.yaml <<EOF
|
|
|
79 |
|
80 |
storage:
|
81 |
storage_path: /home/pn/.n8n/qdrant/storage
|
82 |
+
snapshots_path: /home/pn/.n8n/qdrant/snapshots
|
83 |
|
84 |
log_level: INFO
|
85 |
EOF
|
86 |
|
87 |
+
# 确保配置文件有正确的权限
|
88 |
+
chmod 644 /home/pn/.n8n/qdrant/config/config.yaml
|
89 |
+
|
90 |
# 使用配置文件启动 Qdrant
|
91 |
qdrant --config-path /home/pn/.n8n/qdrant/config/config.yaml > /home/pn/.n8n/qdrant/qdrant.log 2>&1 &
|
92 |
|
|
|
109 |
if grep -i "error" /home/pn/.n8n/qdrant/qdrant.log >/dev/null 2>&1; then
|
110 |
echo "Error found in Qdrant logs:"
|
111 |
tail -n 10 /home/pn/.n8n/qdrant/qdrant.log
|
112 |
+
# 显示目录权限
|
113 |
+
echo "Directory permissions:"
|
114 |
+
ls -la /home/pn/.n8n/qdrant/
|
115 |
fi
|
116 |
done
|
117 |
|
118 |
echo "Failed to start Qdrant server"
|
119 |
echo "Last 10 lines of Qdrant log:"
|
120 |
tail -n 10 /home/pn/.n8n/qdrant/qdrant.log
|
121 |
+
echo "Directory permissions:"
|
122 |
+
ls -la /home/pn/.n8n/qdrant/
|
123 |
exit 1
|
124 |
}
|
125 |
|