Milvus【部署 01】向量数据库Milvus在Linux环境下的在线+离线安装

向量数据库Milvus在Linux环境下的在线+离线安装

1.千问简介

Milvus 是一款专为处理高维向量数据设计的开源云原生数据库,旨在满足海量向量数据的实时召回需求。它由 Zilliz 公司开发并维护,基于Apache许可证2.0版本发布。Milvus的核心能力在于其高可用性、高性能及易拓展性,特别优化了对由深度神经网络和其他机器学习模型生成的嵌入(embedding)向量的管理、搜索和操作。

该数据库底层集成了诸如 FAISS、Annoy、HNSW 等高效的向量搜索库,用以解决稠密向量的相似度检索问题。通过支持数据分片、数据持久化、增量数据摄取、标量与向量混合查询以及时间旅行查询(time travel)等功能,Milvus能够应对复杂多变的向量检索场景,并且显著提升向量检索性能。

Milvus广泛应用于需要高效处理非结构化数据检索的领域,如推荐系统、图像检索、语音识别、自然语言处理、语义搜索等人工智能应用场景。为了实现最佳的可用性和弹性,通常建议通过Kubernetes来部署Milvus。其采用的共享存储架构将存储与计算分离,进一步增强了系统的灵活性和扩展性。

2.在线安装

bash 复制代码
[root@tcloud milvus]# yum install ./milvus-2.1.4-1.el7.x86_64.rpm

安装日志:

shell 复制代码
Loaded plugins: fastestmirror, langpacks
Examining ./milvus-2.1.4-1.el7.x86_64.rpm: milvus-2.1.4-1.el7.x86_64
Marking ./milvus-2.1.4-1.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package milvus.x86_64 0:2.1.4-1.el7 will be installed
--> Processing Dependency: libquadmath.so.0(QUADMATH_1.0)(64bit) for package: milvus-2.1.4-1.el7.x86_64
Loading mirror speeds from cached hostfile
epel                                                                                                                                     | 4.7 kB  00:00:00
extras                                                                                                                                   | 2.9 kB  00:00:00
os                                                                                                                                       | 3.6 kB  00:00:00
updates                                                                                                                                  | 2.9 kB  00:00:00
--> Processing Dependency: tbb-devel for package: milvus-2.1.4-1.el7.x86_64
--> Processing Dependency: libquadmath.so.0()(64bit) for package: milvus-2.1.4-1.el7.x86_64
--> Running transaction check
---> Package libquadmath.x86_64 0:4.8.5-44.el7 will be installed
---> Package tbb-devel.x86_64 0:4.1-9.20130314.el7 will be installed
--> Processing Dependency: tbb(x86-64) = 4.1-9.20130314.el7 for package: tbb-devel-4.1-9.20130314.el7.x86_64
--> Processing Dependency: libtbbmalloc_proxy.so.2()(64bit) for package: tbb-devel-4.1-9.20130314.el7.x86_64
--> Processing Dependency: libtbbmalloc.so.2()(64bit) for package: tbb-devel-4.1-9.20130314.el7.x86_64
--> Processing Dependency: libtbb.so.2()(64bit) for package: tbb-devel-4.1-9.20130314.el7.x86_64
--> Running transaction check
---> Package tbb.x86_64 0:4.1-9.20130314.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================
 Package                           Arch                         Version                                  Repository                                        Size
================================================================================================================================================================
Installing:
 milvus                            x86_64                       2.1.4-1.el7                              /milvus-2.1.4-1.el7.x86_64                       388 M
Installing for dependencies:
 libquadmath                       x86_64                       4.8.5-44.el7                             os                                               190 k
 tbb                               x86_64                       4.1-9.20130314.el7                       os                                               124 k
 tbb-devel                         x86_64                       4.1-9.20130314.el7                       os                                               218 k

Transaction Summary
================================================================================================================================================================
Install  1 Package (+3 Dependent packages)

Total size: 389 M
Total download size: 532 k
Installed size: 390 M
Is this ok [y/d/N]: y
Downloading packages:
(1/3): libquadmath-4.8.5-44.el7.x86_64.rpm                                                                                               | 190 kB  00:00:00
(2/3): tbb-4.1-9.20130314.el7.x86_64.rpm                                                                                                 | 124 kB  00:00:00
(3/3): tbb-devel-4.1-9.20130314.el7.x86_64.rpm                                                                                           | 218 kB  00:00:00
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                           1.2 MB/s | 532 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : tbb-4.1-9.20130314.el7.x86_64                                                                                                                1/4
  Installing : tbb-devel-4.1-9.20130314.el7.x86_64                                                                                                          2/4
  Installing : libquadmath-4.8.5-44.el7.x86_64                                                                                                              3/4
  Installing : milvus-2.1.4-1.el7.x86_64                                                                                                                    4/4
  Verifying  : milvus-2.1.4-1.el7.x86_64                                                                                                                    1/4
  Verifying  : tbb-devel-4.1-9.20130314.el7.x86_64                                                                                                          2/4
  Verifying  : libquadmath-4.8.5-44.el7.x86_64                                                                                                              3/4
  Verifying  : tbb-4.1-9.20130314.el7.x86_64                                                                                                                4/4

Installed:
  milvus.x86_64 0:2.1.4-1.el7

Dependency Installed:
  libquadmath.x86_64 0:4.8.5-44.el7                                  tbb.x86_64 0:4.1-9.20130314.el7                                  tbb-devel.x86_64 0:4.1-9.20130314.el7

Complete!

安装了3个依赖,让yum缓存下来,离线安装时可以使用,yum开启缓存及查找缓存文件地址:

bash 复制代码
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=1

安装成功后查看状态:

bash 复制代码
systemctl start milvus-etcd
systemctl start milvus-minio
systemctl start milvus

查看服务状态:

bash 复制代码
# systemctl status milvus-etcd
● milvus-etcd.service - Etcd of Milvus Standalone Server
   Loaded: loaded (/etc/systemd/system/milvus-etcd.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2024-06-13 09:09:54 CST; 19s ago
 Main PID: 18846 (milvus-etcd)
   CGroup: /system.slice/milvus-etcd.service
           └─18846 /usr/bin/milvus-etcd --data-dir /var/lib/milvus/etcd-data

# systemctl status milvus-minio
● milvus-minio.service - MinIO of Milvus Standalone Server
   Loaded: loaded (/etc/systemd/system/milvus-minio.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2024-06-13 09:10:05 CST; 1min 3s ago
 Main PID: 18961 (milvus-minio)
   CGroup: /system.slice/milvus-minio.service
           └─18961 /usr/bin/milvus-minio server /var/lib/milvus/minio-data

# systemctl status milvus
● milvus.service - Milvus Standalone Server
   Loaded: loaded (/etc/systemd/system/milvus.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2024-06-13 09:10:12 CST; 1s ago
 Main PID: 19058 (milvus-server)
   CGroup: /system.slice/milvus.service
           └─19058 /usr/bin/milvus-server run standalone
shell 复制代码
# milvus安装的文件
[root@tcloud ~]# rpm -ql milvus
/etc/ld.so.conf.d/milvus.conf
/etc/milvus/configs/advanced/etcd.yaml
/etc/milvus/configs/milvus.yaml
/etc/systemd/system/milvus-etcd.service
/etc/systemd/system/milvus-minio.service
/etc/systemd/system/milvus.service
/lib64/milvus/libgfortran.so.4
/lib64/milvus/libknowhere.so
/lib64/milvus/libmarisa.a
/lib64/milvus/libmarisa.la
/lib64/milvus/libmarisa.so
/lib64/milvus/libmarisa.so.0
/lib64/milvus/libmilvus_common.so
/lib64/milvus/libmilvus_index.so
/lib64/milvus/libmilvus_indexbuilder.so
/lib64/milvus/libmilvus_segcore.so
/lib64/milvus/libopenblas.so.0
/usr/bin/milvus
/usr/bin/milvus-etcd
/usr/bin/milvus-minio
/usr/bin/milvus-server

缓存的依赖包:

2.离线安装

离线安装要使用在线安装缓存的依赖文件:

bash 复制代码
# 安装
rpm -ivh libquadmath-4.8.5-44.el7.x86_64.rpm
rpm -ivh tbb-4.1-9.20130314.el7.x86_64.rpm
rpm -ivh tbb-devel-4.1-9.20130314.el7.x86_64.rpm
rpm -ivh milvus-2.1.4-1.el7.x86_64.rpm
bash 复制代码
# 启动
systemctl start milvus-etcd
systemctl start milvus-minio
systemctl start milvus
相关推荐
ac.char4 分钟前
在 Ubuntu 上安装 Yarn 环境
linux·运维·服务器·ubuntu
敲上瘾4 分钟前
操作系统的理解
linux·运维·服务器·c++·大模型·操作系统·aigc
tatasix21 分钟前
MySQL UPDATE语句执行链路解析
数据库·mysql
长弓聊编程23 分钟前
Linux系统使用valgrind分析C++程序内存资源使用情况
linux·c++
cherub.30 分钟前
深入解析信号量:定义与环形队列生产消费模型剖析
linux·c++
南城花随雪。34 分钟前
硬盘(HDD)与固态硬盘(SSD)详细解读
数据库
儿时可乖了35 分钟前
使用 Java 操作 SQLite 数据库
java·数据库·sqlite
懒是一种态度37 分钟前
Golang 调用 mongodb 的函数
数据库·mongodb·golang
天海华兮40 分钟前
mysql 去重 补全 取出重复 变量 函数 和存储过程
数据库·mysql
梅见十柒1 小时前
wsl2中kali linux下的docker使用教程(教程总结)
linux·经验分享·docker·云原生