In this guide, we will walk you through installing Milvus and your very first vector search Python codes with it. To learn more about how to use Milvus, please visit Milvus Docker User Guide.
-
Milvus installation is currently supported on Linux systems, make sure one of the following Linux distributions is used:
Linux Version CentOS 7.5 or later Ubuntu LTS 18.04 or later -
Hardware requirements:
Component Minimum Config CPU Intel CPU Haswell or later GPU Nvidia Pascal series or later GPU Driver CUDA 10.1, Driver 418.74 or later Memory 8 GB + (depends on data volume) Storage SATA 3.0 SSD or later -
Client browser requirements:
Milvus provides GUI monitoring dashboard based on Prometheus and Grafana, which visualizes performance metrics of the database. It is compatible with the mainstream web browsers such as Microsoft IE, Google Chrome, Mozilla Firefox and Safari, etc.
-
Make sure following software packages are installed so that Milvus can deployed through Docker:
-
Download Milvus Docker image.
# Download Milvus Docker image $ docker pull milvusdb/milvus:0.3.1
-
Create Milvus file, and add server_cofig and log_config to it.
# Create Milvus file $ mkdir /home/$USER/milvus $ cd /home/$USER/milvus $ mkdir conf $ cd conf $ wget https://raw.githubusercontent.com/milvus-io/docs/branch-0.3.1/assets/server_config.yaml $ wget https://raw.githubusercontent.com/milvus-io/docs/branch-0.3.1/assets/log_config.conf
-
Start Milvus server.
# Start Milvus $ nvidia-docker run -td --runtime=nvidia -p 19530:19530 -p 8080:8080 -v /home/$USER/milvus/db:/opt/milvus/db -v /home/$USER/milvus/conf:/opt/conf -v /home/$USER/milvus/logs:/opt/milvus/logs milvusdb/milvus:0.3.1
-
Get Milvus container id.
# Get Milvus container id $ docker ps -a
-
Confirm Milvus running status.
# Make sure Milvus is up and running $ docker logs <milvus container id>
Now, let's run a Python example program. You will need to create a vector data table, insert 10 vectors, and then run a vector similarity search.
-
Make sure Python 3.4 or higher is already installed and in use.
-
Install Milvus Python SDK.
# Install Milvus Python SDK $ pip install pymilvus==0.1.24
Note: To learn more about Milvus Python SDK, go to Milvus Python SDK Playbook.
-
Create a new file example.py, and add Python example code to it.
-
Run the example code.
# Run Milvus Python example $ python3 example.py
-
Confirm the program is running correctly.
Congratulations! You have successfully completed your first vector similarity search with Milvus.