Install and Start CPU-only Milvus
Prerequisites
Operating System Requirements
Operating system | Supported versions |
---|---|
CentOS | 7.5 or higher |
Ubuntu LTS | 18.04 or higher |
Hardware Requirements
Component | Recommended configuration |
---|---|
CPU | Intel CPU Sandy Bridge or higher. |
CPU Instruction Set |
|
RAM | 8 GB or more (depends on the data volume) |
Hard Drive | SATA 3.0 SSD or higher |
Software Requirements
Software | Version |
---|---|
Docker | 19.03 or higher |
cache.insert_buffer_size
and cache.cache_size
set in the server_config.yaml file.
Confirm Docker Status
Confirm that the Docker daemon is running in the background:
$ sudo docker info
- If you do not see the server listed, start the Docker daemon.
- On Linux, Docker needs
sudo
privileges. To run Docker commands withoutsudo
privileges, create adocker
group and add your users (see Post-installation Steps for Linux for details).
Pull Docker Image
Pull the CPU-only image:
$ sudo docker pull milvusdb/milvus:1.1.1-cpu-d061621-330cc6
- If you cannot use your host to acquire Docker images and configuration files online because of network restrictions, please acquire them online from another available host, save them as a TAR file, pass it on to your local machine, and then load the TAR file as a Docker image:
Click here to view the sample code.
- Save the Docker image as a TAR file, and pass it on to your local machine:
$ docker save milvusdb/milvus > milvus_image.tar
- Load the TAR file as a Docker image:
$ docker load < milvus_image.tar
- Save the Docker image as a TAR file, and pass it on to your local machine:
- If pulling the docker image is too slow or keeps failing, see Operational FAQ for solutions.
Download Configuration Files
$ mkdir -p /home/$USER/milvus/conf
$ cd /home/$USER/milvus/conf
$ wget https://raw.githubusercontent.com/milvus-io/milvus/v1.1.1/core/conf/demo/server_config.yaml
wget
command, you can create a server_config.yaml file under /home/$USER/milvus/conf, and then copy the content from server config to it.
Start Docker Container
Start Docker container and map the paths to the local files to the container:
$ sudo docker run -d --name milvus_cpu_1.1.1 \
-p 19530:19530 \
-p 19121:19121 \
-v /home/$USER/milvus/db:/var/lib/milvus/db \
-v /home/$USER/milvus/conf:/var/lib/milvus/conf \
-v /home/$USER/milvus/logs:/var/lib/milvus/logs \
-v /home/$USER/milvus/wal:/var/lib/milvus/wal \
milvusdb/milvus:1.1.1-cpu-d061621-330cc6
The docker run
options used in the above command are defined as follows:
-d
: Runs container in the background and prints container ID.--name
: Assigns a name to the container.-p
: Publishes a container’s port(s) to the host.-v
: Mounts the directory into the container.
Confirm the running state of Milvus:
$ sudo docker ps
If the Milvus server does not start up properly, check the error logs:
$ sudo docker logs milvus_cpu_1.1.1
FAQ
Can I install Milvus on Windows?
Yes, so long as you have set up a Docker environment on your operating system.Why does Milvus return Illegal instruction
during startup?
If your CPU does not support SSE42, AVX, AVX2, or AVX512, Milvus cannot start properly. You can use cat /proc/cpuinfo
to check the supported instruction sets.
How to migrate data in Milvus?
For details, see data migration.Is Docker the only way to install and run Milvus?
No. You can also build Milvus from source code in Linux. See Build Milvus from source code for more information.How to set nlist
or nprobe
for IVF indexes?
In general terms, the recommended value of nlist
is 4 × sqrt(n)
, where n is the total number of entities in a segment.
Determining nprobe
is a trade-off between search performance and accuracy, and based on your dataset and scenario. It is recommended to run several rounds of tests to determine the value of nprobe
.
The following charts are from a test running on the sift50m dataset and IVF_SQ8 index. The test compares search performance and recall rate between different nlist
/nprobe
pairs.
We only show the results of GPU-enabled Milvus here, because the two distributions of Milvus show similar results.
Key takeaways: This test shows that the recall rate increases with the nlist
/nprobe
pair.
Key takeaways: When nlist
is 4096 and nprobe
128, Milvus shows the best search performance.
What's next
-
If you're just getting started with Milvus:
-
If you're ready to run Milvus in production:
- Build a monitoring and alerting system to check real-time application performance.
- Tune Milvus performance through configuration.
-
If you want to use GPU-accelerated Milvus for search in large datasets: