Skip to content
GFoniX edited this page Jan 7, 2023 · 9 revisions

The first step is to see how to install Milvus.

Install Milvus Standalone with docker compose

Download installer

Run the following command to download milvus-standalone-docker-compose.yml and save it as docker-compose.yml.

wget https://github.com/milvus-io/milvus/releases/download/v2.0.0-rc6/milvus-standalone-docker-compose.yml -O docker-compose.yml
$ docker-compose up -d
Docker Compose is now in the Docker CLI, try `docker compose up`
Creating milvus-etcd  ... done
Creating milvus-minio ... done
Creating milvus-standalone ... done

After Milvus standalone starts, three running docker containers appear including two infrastructure services and one Milvus service.

$ sudo docker-compose ps
      Name                     Command                  State                          Ports
----------------------------------------------------------------------------------------------------------------
milvus-etcd         etcd -listen-peer-urls=htt ...   Up (healthy)   2379/tcp, 2380/tcp
milvus-minio        /usr/bin/docker-entrypoint ...   Up (healthy)   9000/tcp
milvus-standalone   /tini -- milvus run standalone   Up             0.0.0.0:19530->19530/tcp,:::19530->19530/tcp

To stop Milvus standalone, run $ sudo docker-compose down.

To delete data after stopping Milvus, run $ sudo rm -rf volumes.

Install Milvus Standalone on kubenetes

  1. Start a K8s cluster
$ minikube start
  1. Start Milvus

Add a chart repository:

$ helm repo add milvus https://milvus-io.github.io/milvus-helm/

Update charts locally:

$ helm repo update

Install the chart:

Choose a release name for the chart instance.

Install Milvus standalone:

$ helm install my-release milvus/milvus --set cluster.enabled=false --set etcd.replicaCount=1 --set minio.mode=standalone --set pulsar.enabled=false

After Milvus starts, the READY column displays 1/1 for all pods.

$ kubectl get pods
NAME                                               READY   STATUS      RESTARTS   AGE
my-release-etcd-0                                  1/1     Running     0          30s
my-release-milvus-standalone-54c4f88cb9-f84pf      1/1     Running     0          30s
my-release-minio-5564fbbddc-mz7f5                  1/1     Running     0          30s
  1. Connect to Milvus Open a new terminal and run the following command to forward the local port to the port that Milvus uses.
$ kubectl port-forward service/my-release-milvus 19530
Forwarding from 127.0.0.1:19530 -> 19530
  1. Uninstall Milvus
$ helm uninstall my-release
  1. Stop the K8s cluster

Run the following command to stop the cluster and the minikube VM without deleting created resources.

$ minikube stop
  1. Delete the K8s cluster

Run the following command to delete the cluster, the minikube VM, and all created resources including persistent volumes.

minikube delete

Install Milvus Cluster with docker compose

Run the following command to download milvus-cluster-docker-compose.yml and save it as docker-compose.yml.

$ wget https://github.com/milvus-io/milvus/releases/download/v2.0.0-rc7/milvus-cluster-docker-compose.yml -O docker-compose.yml

You can also click here to download the file.

$ docker-compose up -d
Docker Compose is now in the Docker CLI, try `docker compose up`
Creating milvus-etcd   ... done
Creating milvus-minio  ... done
Creating milvus-pulsar ... done
Creating milvus-proxy      ... done
Creating milvus-rootcoord  ... done
Creating milvus-indexcoord ... done
Creating milvus-querycoord ... done
Creating milvus-datacoord  ... done
Creating milvus-querynode  ... done
Creating milvus-indexnode  ... done
Creating milvus-datanode   ... done

After Milvus cluster starts, 11 running docker containers appear including three infrastructure services and eight Milvus services.

$ sudo docker ps
      Name                     Command                  State                          Ports
----------------------------------------------------------------------------------------------------------------
milvus-datacoord    /tini -- milvus run datacoord    Up
milvus-datanode     /tini -- milvus run datanode     Up
milvus-etcd         etcd -listen-peer-urls=htt ...   Up (healthy)   2379/tcp, 2380/tcp
milvus-indexcoord   /tini -- milvus run indexcoord   Up
milvus-indexnode    /tini -- milvus run indexnode    Up
milvus-minio        /usr/bin/docker-entrypoint ...   Up (healthy)   9000/tcp
milvus-proxy        /tini -- milvus run proxy        Up             0.0.0.0:19530->19530/tcp,:::19530->19530/tcp
milvus-pulsar       bin/pulsar standalone            Up
milvus-querycoord   /tini -- milvus run querycoord   Up
milvus-querynode    /tini -- milvus run querynode    Up
milvus-rootcoord    /tini -- milvus run rootcoord    Up

To stop Milvus cluster, run $ sudo docker-compose down.

To delete data after stopping Milvus, run $ sudo rm -rf volumes.

Install Milvus Cluster with kubenetes

  1. Start a K8s cluster
$ minikube start
  1. Start Milvus

Add a chart repository:

$ helm repo add milvus https://milvus-io.github.io/milvus-helm/

Update charts locally:

$ helm repo update

Install the chart:

Choose a release name for the chart instance.

Install Milvus cluster:

$ helm install my-release milvus/milvus

After Milvus starts, the READY column displays 1/1 for all pods.

$ kubectl get pods
NAME                                              READY   STATUS    RESTARTS   AGE
my-release-etcd-0                                 1/1     Running   0          33s
my-release-milvus-datacoord-574b99bbb7-t898f      1/1     Running   0          33s
my-release-milvus-datanode-54568fc948-9rwbk       1/1     Running   0          33s
my-release-milvus-indexcoord-576b44d56-wh6vk      1/1     Running   0          33s
my-release-milvus-indexnode-67ff57745f-7lml8      1/1     Running   0          33s
my-release-milvus-proxy-55f98ffbbb-r68qt          1/1     Running   0          33s
my-release-milvus-pulsar-6475b86778-68r4l         1/1     Running   0          33s
my-release-milvus-querycoord-74d8895985-m5sdr     1/1     Running   0          33s
my-release-milvus-querynode-68486d847c-q5fg7      1/1     Running   0          33s
my-release-milvus-rootcoord-746d8b5b99-2strx      1/1     Running   0          33s
my-release-minio-68bbbf8459-2qxwv                 1/1     Running   0          33s
  1. Connect to Milvus Open a new terminal and run the following command to forward the local port to the port that Milvus uses.
$ kubectl port-forward service/my-release-milvus 19530
Forwarding from 127.0.0.1:19530 -> 19530
  1. Uninstall Milvus
$ helm uninstall my-release
  1. Stop the K8s cluster Run the following command to stop the cluster and the minikube VM without deleting created resources.
$ minikube stop
  1. Delete the K8s cluster Run the following command to delete the cluster, the minikube VM, and all created resources including persistent volumes.
minikube delete

Milvus offline installation

Manually downloading Docker images

Milvus installation may fail when images are not properly loaded from public Docker registries. To pull all images and save them into a directory that can be moved to the target host and loaded manually, perform the following procedures:

Step 1: Save Milvus manifests and Docker images

If you install Milvus with the docker-compose.yml file, use these commands:

1. Download Milvus standalone docker-compose.yml

$ wget https://raw.githubusercontent.com/milvus-io/milvus/master/deployments/docker/standalone/docker-compose.yml -O docker-compose.yml

    or download Milvus cluster docker-compose.yml

$ wget https://raw.githubusercontent.com/milvus-io/milvus/master/deployments/docker/cluster/docker-compose.yml -O docker-compose.yml

2. Pull and save Docker images

$ pip3 install -r requirements.txt
$ python3 save_image.py --manifest docker-compose.yml

If you install Milvus with Helm, use these commands:

1. Update Helm repo

$ helm repo add milvus https://milvus-io.github.io/milvus-helm/
$ helm repo update

2. Get Kubernetes manifests of Milvus standalone

$ helm template my-release milvus/milvus > milvus_manifest.yaml

   or get Kubernetes manifests of Milvus cluster

$ helm template --set cluster.enabled=true my-release milvus/milvus > milvus_manifest.yaml

3. Pull and save Docker images

$ pip3 install -r requirements.txt
$ python3 save_image.py --manifest milvus_manifest.yaml

The Docker images will be stored under images directory.

Step 2: Load Docker images

Enter the following command to load the Docker images:

$ cd images/
$ for image in $(find . -type f -name "*.tar.gz") ; do gunzip -c $image | docker load; done

Step3: Install Milvus

With Docker Compose

$ docker-compose -f docker-compose.yml up -d

On Kubernetes

$ kubectl apply -f milvus_manifest.yaml
Clone this wiki locally