当前位置: 首页 > 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.jsqmd.com/news/979974/

相关文章:

  • 平顶山市黄金回收本地靠谱店铺指南+白银回收+铂金回收+彩金回推荐收门店 及地联系方式址推荐 - 盛世金银回收
  • Arduino 433MHz无线收发实战包:VirtualWire源码+DHT11传输示例+全文档
  • 从Copilot到Agent--我的开发工作流正在被颠覆
  • 金昌市黄金回收本地靠谱店铺指南+白银回收+铂金回收+彩金回推荐收门店 及地联系方式址推荐 - 盛世金银回收
  • 2025-2026年上海屋宁遮阳设备有限公司电话查询:选择遮阳产品前先了解服务范围 - 品牌推荐
  • 终极指南:3分钟掌握N_m3u8DL-CLI-SimpleG图形化下载工具
  • CVE-2026-43284 CVE-2026-43500 CVE-2026-46300 Dirty Frag 漏洞分析 --前车之鉴,后事之师
  • 从摘要到关键词:搞定论文‘门面’的完整流程与常见误区避坑(以计算机/材料学为例)
  • 平凉市黄金回收本地靠谱店铺指南+白银回收+铂金回收+彩金回推荐收门店 及地联系方式址推荐 - 盛世金银回收
  • Unlock Music音乐解锁工具:3分钟快速解密所有加密音乐格式
  • STM32F103用RS485跑Modbus RTU,直连中达优控HMI一体机的可调试工程
  • matchexpression和matchlabels的区别
  • 金华市黄金回收本地靠谱店铺指南+白银回收+铂金回收+彩金回推荐收门店 及地联系方式址推荐 - 盛世金银回收
  • 智能容量规划:基于时序预测的弹性伸缩实践,从经验估算到数据驱动
  • 算力中心环境感知体系中POE传感终端的关键技术探析
  • 2026华北金融行业RAID数据恢复服务商推荐:北京服务器数据恢复/北京硬盘数据恢复/北京远程数据恢复/北京上门数据恢复/选择指南 - 优质品牌商家
  • 市面上靠谱的商务出行制造商哪家强
  • 别再让日志散落一地:Hadoop YARN日志聚合(yarn-site.xml)配置详解与避坑指南
  • LGTV Companion终极指南:让LG电视与电脑实现智能联动
  • 浏览器用户画像分析 - 大屏数据接入
  • Arduino小球平衡台全套搭建资料:PID代码+3D打印件+接线调试指南
  • Android Studio可直接运行的Java计算器项目,含完整工程结构与四则运算逻辑
  • 萍乡市黄金回收本地靠谱店铺指南+白银回收+铂金回收+彩金回推荐收门店 及地联系方式址推荐 - 盛世金银回收
  • 晋城市黄金回收本地靠谱店铺指南+白银回收+铂金回收+彩金回推荐收门店 及地联系方式址推荐 - 盛世金银回收
  • Codex ran out of room in the model‘s context window.
  • 剪辑问题不知道问谁怎么办?5款工具实测对比
  • 2025-2026年上海屋宁遮阳设备有限公司电话查询:选购户外遮阳产品前需了解的事项 - 品牌推荐
  • STM32 与 GD32
  • PHP写的电视直播系统,网页和手机都能推流看直播
  • 小程序毕设项目:基于springboot+微信小程序的民宿预订管理系统设计与实现 (源码+文档,讲解、调试运行,定制等)