文章目录
概述
1、命令行安装
bash
wget https://github.com/milvus-io/milvus/releases/download/v2.6.21/milvus_2.6.21-1_amd64.rpm -O milvus_2.6.21-1_amd64.rpm
bash
apt install -y ./milvus_2.6.17-1_amd64.deb
# 或者
# dpkg -i milvus_2.6.17-1_amd64.deb
启动
bash
systemctl start milvus
如果是在轻量容器中无法使用systemctl
bash
/usr/bin/milvus run standalone
遇到问题
bash
[2026/08/03 10:36:26.866 +08:00] [WARN] [grpclog/grpclog.go:155] ["[core][Channel #3 SubChannel #4] grpc: addrConn.createTransport failed to connect to {Addr: \"localhost:2379\", ServerName: \"localhost:2379\", }. Err: connection error: desc = \"transport: Error while dialing: dial tcp 127.0.0.1:2379: connect: connection refused\""]
bash
apt update
apt install -y etcd-server etcd-client
启动etcd存储元数据
bash
nohup etcd \
--name milvus-etcd \
--data-dir /var/lib/etcd \
--listen-client-urls http://127.0.0.1:2379 \
--advertise-client-urls http://127.0.0.1:2379 \
--listen-peer-urls http://127.0.0.1:2380 \
--initial-advertise-peer-urls http://127.0.0.1:2380 \
--initial-cluster milvus-etcd=http://127.0.0.1:2380 \
--initial-cluster-state new \
> /var/log/etcd/etcd.log 2>&1 &
再次执行启动milvus命令
bash
/usr/bin/milvus run standalone
其他问题
bash
export DEPLOY_MODE=STANDALONE
export MILVUSCONF=/etc/milvus/configs/
export LD_LIBRARY_PATH=/usr/lib/milvus:$LD_LIBRARY_PATH
bash
cat > /etc/milvus/configs/user.yaml <<'EOF'
mq:
type: woodpecker
common:
storageType: local
localStorage:
path: /var/lib/milvus/data
woodpecker:
storage:
type: local
rootPath: default
EOF
bash
/usr/bin/milvus run standalone
多次启动残留问题:重新删除旧pid配置
bash
ps -ef | grep -E 'milvus|etcd' | grep -v grep
netstat -ltnp | grep -E ':2379|:2380|:19530|:9091'
pkill -f milvus
pkill -f etcd
sleep 2
netstat -ltnp | grep -E ':2379|:2380|:19530|:9091'
rm -rf default.etcd
rm -f /run/milvus/standalone.pid
export DEPLOY_MODE=STANDALONE
export MILVUSCONF=/etc/milvus/configs/
export LD_LIBRARY_PATH=/usr/lib/milvus:$LD_LIBRARY_PATH
mkdir -p /var/milvus/
nohup /usr/bin/milvus run standalone >/var/milvus/log.log 2>&1 &