Use docker to build Milvus vector database

What is the Milvus vector database?

The official website says this:

Milvus was created in 2019 with a single goal: to store, index, and manage the massive embedding vectors generated by deep neural networks and other machine learning (ML) models.

As a database dedicated to processing input vector queries, it is capable of indexing trillion-scale vectors. Different from existing relational databases, Milvus mainly processes structured data according to a predefined schema, and it is designed bottom-up to process embedding vectors converted from unstructured data.

As the Internet has grown and evolved, unstructured data has become more prevalent, including emails, papers, IoT sensor data, Facebook photos, protein structures, and more. In order for computers to understand and process unstructured data, this data is converted into vectors using embedding techniques. Milvus stores and indexes these vectors. Milvus is able to analyze the correlation between two vectors by calculating their similarity distance. If two embedding vectors are very similar, it means that the original data sources are also similar.

Milvus product highlights:

  • Millisecond Searches for Tera Vectors
  • Simplified Unstructured Data Management
  • Stable and reliable user experience
  • Highly scalable and elastically scalable
  • mixed query
  • Stream-batch integrated data storage based on Lambda architecture
  • Widely supported by the community and recognized by the industry

quick start

Use docker to install Milvus stand-alone version:

Generally, it is installed under linux, first install docker, and then install docker-compose, the specific installation method will not be mentioned, just Baidu.

1. DownloadYAML文件

下载milvus-standalone-docker-compose.yml并手动或使用以下命令将其保存为docker-compose.yml。

wget https://github.com/milvus-io/milvus/releases/download/v2.0.2/milvus-standalone-docker-compose.yml -O docker-compose.yml

2. Start Milvus

In the same directory as the docker-compose.yml file, start Milvus by running the following command:

sudo docker-compose up -d

Notice:

If your system has Docker Compose V2 installed instead of V1, please use "Docker Compose" instead of "Docker-Compose". "$docker compose version" checks the version number

Check that the container is up and running:

sudo docker-compose ps

After the Milvus stand-alone version is started, there will be three docker containers running, which include the Milvus standalone service and its two dependencies.

3. Stop Milvus

To stop Milvus standalone, run:

sudo docker-compose down

To delete data after stopping Milvus, run:

sudo rm -rf  volumes

Install the Milvus visualization tool Attu

Attu is an efficient open source management tool for Milvus

The following code installs the Attu image and runs it:

docker run -p 8000:3000  -e MILVUS_URL={你的IP地址}:19530 zilliz/attu:latest

After starting docker, visit http://your_ip_address:8000 in your browser and click "Connect" to enter the Attu service. TLS connections, usernames and passwords are also supported.

I have created a Collection (equivalent to a database table) Face

You can create a Collection by clicking Create Collection, which contains at least an id and a Vector field, and can add an index to the vector field

Guess you like

Origin blog.csdn.net/lwpoor123/article/details/130150179