直接用docker 錯誤命令(這個我試了三遍,浪費了很多時間):
docker run -d --name milvus -p 19530:19530 -p 9091:9091 -v /var/lib/milvus:/var/lib/milvus milvusdb/milvus:latest
先看報錯:
2025-02-24 16:02:39 ERROR: ld.so: object '/milvus/lib/' from LD_PRELOAD cannot be preloaded (cannot read file data): ignored.
2025-02-24 16:02:39 tini (tini version 0.19.0 - git.de40ad0)
2025-02-24 16:02:39 Usage: tini [OPTIONS] PROGRAM -- [ARGS] | --version
2025-02-24 16:02:39
2025-02-24 16:02:39 Execute a program under the supervision of a valid init process (tini)
2025-02-24 16:02:39
2025-02-24 16:02:39 Command line options:
2025-02-24 16:02:39
2025-02-24 16:02:39 --version: Show version and exit.
2025-02-24 16:02:39 -h: Show this help message and exit.
2025-02-24 16:02:39 -s: Register as a process subreaper (requires Linux >= 3.4).
2025-02-24 16:02:39 -p SIGNAL: Trigger SIGNAL when parent dies, e.g. "-p SIGKILL".
2025-02-24 16:02:39 -v: Generate more verbose output. Repeat up to 3 times.
2025-02-24 16:02:39 -w: Print a warning when processes are getting reaped.
2025-02-24 16:02:39 -g: Send signals to the child's process group.
2025-02-24 16:02:39 -e EXIT_CODE: Remap EXIT_CODE (from 0 to 255) to 0.
2025-02-24 16:02:39 -l: Show license and exit.
2025-02-24 16:02:39
2025-02-24 16:02:39 Environment variables:
2025-02-24 16:02:39
2025-02-24 16:02:39 TINI_SUBREAPER: Register as a process subreaper (requires Linux >= 3.4).
2025-02-24 16:02:39 TINI_VERBOSITY: Set the verbosity level (default: 1).
2025-02-24 16:02:39 TINI_KILL_PROCESS_GROUP: Send signals to the child's process group.
2025-02-24 16:02:39
2025-02-24 16:06:03 ERROR: ld.so: object '/milvus/lib/' from LD_PRELOAD cannot be preloaded (cannot read file data): ignored.
2025-02-24 16:06:03 tini (tini version 0.19.0 - git.de40ad0)
2025-02-24 16:06:03 Usage: tini [OPTIONS] PROGRAM -- [ARGS] | --version
2025-02-24 16:06:03
2025-02-24 16:06:03 Execute a program under the supervision of a valid init process (tini)
2025-02-24 16:06:03
2025-02-24 16:06:03 Command line options:
2025-02-24 16:06:03
2025-02-24 16:06:03 --version: Show version and exit.
2025-02-24 16:06:03 -h: Show this help message and exit.
2025-02-24 16:06:03 -s: Register as a process subreaper (requires Linux >= 3.4).
2025-02-24 16:06:03 -p SIGNAL: Trigger SIGNAL when parent dies, e.g. "-p SIGKILL".
2025-02-24 16:06:03 -v: Generate more verbose output. Repeat up to 3 times.
2025-02-24 16:06:03 -w: Print a warning when processes are getting reaped.
2025-02-24 16:06:03 -g: Send signals to the child's process group.
2025-02-24 16:06:03 -e EXIT_CODE: Remap EXIT_CODE (from 0 to 255) to 0.
2025-02-24 16:06:03 -l: Show license and exit.
2025-02-24 16:06:03
2025-02-24 16:06:03 Environment variables:
2025-02-24 16:06:03
2025-02-24 16:06:03 TINI_SUBREAPER: Register as a process subreaper (requires Linux >= 3.4).
2025-02-24 16:06:03 TINI_VERBOSITY: Set the verbosity level (default: 1).
2025-02-24 16:06:03 TINI_KILL_PROCESS_GROUP: Send signals to the child's process group.
2025-02-24 16:06:03
這個錯誤信息主要有兩個部分:
-
ld.so: object '/milvus/lib/' from LD_PRELOAD cannot be preloaded
:這個錯誤通常與庫預加載配置有關,LD_PRELOAD
環境變量指定的庫文件無法被正確讀取。可能是路徑/milvus/lib/
指定不正確,或者是該路徑下沒有實際存在的庫文件。你可以檢查是否該路徑下有有效的.so
文件,并確保路徑配置正確。 -
tini
使用信息:這是容器啟動過程中調用tini
的輸出,tini
是一個用于處理進程管理的工具,通常用于確保容器中運行的程序是由一個有效的初始化進程管理的。這個輸出本身并不是錯誤,它只是提供了tini
的幫助信息。
然后去官網找到了安裝方法:?在 Docker(Linux)中運行 Milvus | Milvus 文檔
?步驟這邊貼出來:
前提條件:
-
安裝 Docker Desktop。
-
安裝 Windows Subsystem for Linux 2 (WSL 2)。
-
安裝 Python 3.8+。
在 Docker 中運行 Milvus
Milvus 提供了一個安裝腳本,可將其安裝為 Docker 容器。在 Microsoft Windows 上安裝 Docker Desktop 后,就可以在管理員模式下通過 PowerShell 或 Windows Command Prompt 以及 WSL 2 訪問 Docker CLI。
從 PowerShell 或 Windows 命令提示符
如果你更熟悉 PowerShell 或 Windows Command Prompt,命令提示符如下。
-
在管理員模式下右擊并選擇以管理員身份運行,打開 Docker Desktop。
-
下載安裝腳本并將其保存為
standalone.bat
?。
Invoke-WebRequest https://raw.githubusercontent.com/milvus-io/milvus/refs/heads/master/scripts/standalone_embed.bat -OutFile standalone.bat
運行下載的腳本,將 Milvus 作為 Docker 容器啟動。
C:\>standalone.bat start
Wait for Milvus starting...
Start successfully.
To change the default Milvus configuration, edit user.yaml and restart the service.
運行安裝腳本后
-
名為Milvus-standalone的 docker 容器已在19530?端口啟動。
-
嵌入式 etcd 與 Milvus 安裝在同一個容器中,服務端口為2379。其配置文件被映射到當前文件夾中的embedEtcd.yaml。
-
Milvus 數據卷被映射到當前文件夾中的volumes/milvus。
可以使用以下命令管理 Milvus 容器和存儲的數據。
C:\>standalone.bat stop
Stop successfully.C:\>standalone.bat delete
Delete Milvus container successfully. # Container has been removed.
Delete successfully. # Data has been removed.