当前位置: 首页 > news >正文

使用docker 部署向量数据库Milvus

在执行之前需要配置docker 的镜像加速地址,需要编辑daemon.json:

vim /etc/docker/daemon.json

可以通过阿里云获取自己的官方云镜像(不会可以搜索阿里云镜像加速)

[root@localhost milvus]# cat > /etc/docker/daemon.json <<-'EOF'{"registry-mirrors":["你的阿里云镜像地址"],"debug":false,"experimental":false}EOF

之后使用下面的命令使地址生效

systemctl daemon-reload

如果还不生效则重启docker

systemctl restart docker

验证镜像地址是否生效

docker info | grep -A 3 "Registry Mirrors"

这样就生效了:

Registry Mirrors: https://你的镜像地址/ Live Restore Enabled: false

docker拉取Milvus

docker pull docker.m.daocloud.io/milvusdb/milvus:v2.5.3

启动milvus脚本

这里用的是milvus:v2.5.3版本,复制下方的脚本到官方的standalone_embed.sh脚本中

#!/usr/bin/env bash# Licensed to the LF AI & Data foundation under one# or more contributor license agreements. See the NOTICE file# distributed with this work for additional information# regarding copyright ownership. The ASF licenses this file# to you under the Apache License, Version 2.0 (the# "License"); you may not use this file except in compliance# with the License. You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.run_embed(){cat<<EOF>embedEtcd.yamllisten-client-urls: http://0.0.0.0:2379 advertise-client-urls: http://0.0.0.0:2379 quota-backend-bytes: 4294967296 auto-compaction-mode: revision auto-compaction-retention: '1000' EOFcat<<EOF>user.yaml# Extra config to override default milvus.yaml EOFif[!-f"./embedEtcd.yaml"]thenecho"embedEtcd.yaml file does not exist. Please try to create it in the current directory."exit1fiif[!-f"./user.yaml"]thenecho"user.yaml file does not exist. Please try to create it in the current directory."exit1fisudodockerrun-d\--namemilvus-standalone\--security-opt seccomp:unconfined\-eETCD_USE_EMBED=true\-eETCD_DATA_DIR=/var/lib/milvus/etcd\-eETCD_CONFIG_PATH=/milvus/configs/embedEtcd.yaml\-eCOMMON_STORAGETYPE=local\-eDEPLOY_MODE=STANDALONE\-v$(pwd)/volumes/milvus:/var/lib/milvus\-v$(pwd)/embedEtcd.yaml:/milvus/configs/embedEtcd.yaml\-v$(pwd)/user.yaml:/milvus/configs/user.yaml\-p19530:19530\-p9091:9091\-p2379:2379\--health-cmd="curl -f http://localhost:9091/healthz"\--health-interval=30s\--health-start-period=90s\--health-timeout=20s\--health-retries=3\milvusdb/milvus:v2.5.3\milvus run standalone1>/dev/null}wait_for_milvus_running(){echo"Wait for Milvus Starting..."whiletruedores=`sudodockerps|grepmilvus-standalone|grephealthy|wc-l`if[$res-eq1]thenecho"Start successfully."echo"To change the default Milvus configuration, add your settings to the user.yaml file and then restart the service."breakfisleep1done}start(){res=`sudodockerps|grepmilvus-standalone|grephealthy|wc-l`if[$res-eq1]thenecho"Milvus is running."exit0fires=`sudodockerps-a|grepmilvus-standalone|wc-l`if[$res-eq1]thensudodockerstart milvus-standalone1>/dev/nullelserun_embedfiif[$?-ne0]thenecho"Start failed."exit1fiwait_for_milvus_running}stop(){sudodockerstop milvus-standalone1>/dev/nullif[$?-ne0]thenecho"Stop failed."exit1fiecho"Stop successfully."}delete_container(){res=`sudodockerps|grepmilvus-standalone|wc-l`if[$res-eq1]thenecho"Please stop Milvus service before delete."exit1fisudodockerrmmilvus-standalone1>/dev/nullif[$?-ne0]thenecho"Delete milvus container failed."exit1fiecho"Delete milvus container successfully."}delete(){read-p"Please confirm if you'd like to proceed with the delete. This operation will delete the container and data. Confirm with 'y' for yes or 'n' for no. > "checkif["$check"=="y"]||["$check"=="Y"];thendelete_containersudorm-rf$(pwd)/volumessudorm-rf$(pwd)/embedEtcd.yamlsudorm-rf$(pwd)/user.yamlecho"Delete successfully."elseecho"Exit delete"exit0fi}upgrade(){read-p"Please confirm if you'd like to proceed with the upgrade. The default will be to the latest version. Confirm with 'y' for yes or 'n' for no. > "checkif["$check"=="y"]||["$check"=="Y"];thenres=`sudodockerps-a|grepmilvus-standalone|wc-l`if[$res-eq1]thenstop delete_containerficurl-sfLhttps://raw.githubusercontent.com/milvus-io/milvus/master/scripts/standalone_embed.sh-ostandalone_embed_latest.sh&&\bashstandalone_embed_latest.sh start1>/dev/null&&\echo"Upgrade successfully."elseecho"Exit upgrade"exit0fi}case$1inrestart)stop start;;start)start;;stop)stop;;upgrade)upgrade;;delete)delete;;*)echo"please use bash standalone_embed.sh restart|start|stop|upgrade|delete";;esac

之后执行命令

bashstandalone_embed.sh start

命令执行结果如下就代表成功了

访问milvus,如果显示下方图片就表示部署成功了

在这里插入图片描述

http://www.zskr.cn/news/1491700.html

相关文章:

  • CVE-2026-43284 CVE-2026-43500 CVE-2026-46300 Dirty Frag 漏洞分析 --前车之鉴,后事之师
  • 从Copilot到Agent--我的开发工作流正在被颠覆
  • 2025-2026年上海屋宁遮阳设备有限公司电话查询:选择遮阳产品前先了解服务范围 - 品牌推荐
  • 金昌市黄金回收本地靠谱店铺指南+白银回收+铂金回收+彩金回推荐收门店 及地联系方式址推荐 - 盛世金银回收
  • STM32F103用RS485跑Modbus RTU,直连中达优控HMI一体机的可调试工程
  • 从摘要到关键词:搞定论文‘门面’的完整流程与常见误区避坑(以计算机/材料学为例)
  • 算力中心环境感知体系中POE传感终端的关键技术探析
  • 市面上靠谱的商务出行制造商哪家强
  • 萍乡市黄金回收本地靠谱店铺指南+白银回收+铂金回收+彩金回推荐收门店 及地联系方式址推荐 - 盛世金银回收
  • Android Studio可直接运行的Java计算器项目,含完整工程结构与四则运算逻辑
  • 晋城市黄金回收本地靠谱店铺指南+白银回收+铂金回收+彩金回推荐收门店 及地联系方式址推荐 - 盛世金银回收
  • 小程序毕设项目:基于springboot+微信小程序的民宿预订管理系统设计与实现 (源码+文档,讲解、调试运行,定制等)
  • 文安县源翔机床维修部:机床翻新喷漆/机床表面喷漆/液压机喷漆/液压机翻新/设备油漆翻新喷漆/设备翻新喷漆/车床喷漆/选择指南 - 优质品牌商家
  • Claude-Sonnet-4-6 技术深度解析 + startapi.top 国内中转调用实战
  • 避开S32K3开发坑:EIM/ERM配置与FCCU联动实战指南
  • PCB布局的关键和核心要点
  • 无锡黄金回收 卖黄金怎么不被坑 实用避坑技巧分享 - 润富黄金回收
  • 【计算机毕业设计案例】基于springboot+微信小程序的民宿预订管理系统设计与实现(程序+文档+讲解+定制)
  • 游戏ping值60ms,但延迟体验像200ms?延迟的真相
  • 视频消重,5款工具实测对比
  • 荆门市黄金回收本地靠谱店铺指南+白银回收+铂金回收+彩金回推荐收门店 及地联系方式址推荐 - 盛世金银回收
  • 避坑指南:RT1064 FlexPWM输出无波形?可能是故障保护在捣鬼
  • 华为USG6000防火墙升级血泪史:从V1R1C30到V500R005,我踩过的那些坑
  • 校园二手交易小程序全套源码:Spring Boot后端 + Layui后台 + MySQL数据库一键部署
  • Flutter网络请求
  • 从城市交通到微服务调用链:介数中心度如何帮你发现系统中的“脆弱咽喉”?
  • 荆州市黄金回收本地靠谱店铺指南+白银回收+铂金回收+彩金回推荐收门店 及地联系方式址推荐 - 盛世金银回收
  • 不露脸怎么做口播视频?5款数字人工具实测对比
  • 华硕笔记本性能优化革命:G-Helper轻量控制工具完全指南
  • 4万Star的paperless-ngx,把纸质文档变成可全文搜索的数字档案