2021-06-21 08:06:08 +00:00
# Build and Start Milvus from Source Code
2021-04-20 05:53:56 +00:00
2021-06-21 08:06:08 +00:00
This article describes how to build and start Milvus Standalone and Cluster from source code.
2021-04-20 05:53:56 +00:00
2021-06-21 08:06:08 +00:00
- [Prerequisites ](#prerequisites )
- [Build Milvus ](#build-milvus )
- [Start Milvus ](#start-milvus )
2021-04-20 05:53:56 +00:00
2021-06-21 08:06:08 +00:00
## Prerequisites
2021-04-20 05:53:56 +00:00
2021-06-21 08:06:08 +00:00
Install the following before building Milvus from source code.
2021-04-20 05:53:56 +00:00
2021-06-21 08:06:08 +00:00
- [Git ](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git ) for version control.
- [Golang ](https://golang.org/doc/install ) version 1.15 or higher and associated toolkits.
- [CMake ](https://cmake.org/install/ ) version 3.14 or higher for compilation.
- [OpenBLAS ](https://github.com/xianyi/OpenBLAS/wiki/Installation-Guide ) (Basic Linear Algebra Subprograms) library version 0.3.9 or higher for matrix operations.
2021-04-20 05:53:56 +00:00
2021-06-21 08:06:08 +00:00
## Build Milvus
2021-04-20 05:53:56 +00:00
2021-06-21 08:06:08 +00:00
1. Clone Milvus' GitHub repository:
2021-04-20 05:53:56 +00:00
```
2021-06-21 08:06:08 +00:00
$ cd /home/$USER
$ git clone https://github.com/milvus-io/milvus.git
2021-04-20 05:53:56 +00:00
```
2021-06-21 08:06:08 +00:00
2. Install third-party dependencies:
2021-04-20 05:53:56 +00:00
```
2021-06-21 08:06:08 +00:00
$ cd milvus
$ ./scripts/install_deps.sh
2021-04-20 05:53:56 +00:00
```
2021-06-21 08:06:08 +00:00
3. Compile executed binary for Milvus:
2021-04-20 05:53:56 +00:00
```
2021-06-21 08:06:08 +00:00
$ make milvus
2021-04-20 05:53:56 +00:00
```
2021-06-21 08:06:08 +00:00
## Start Milvus
2021-04-20 05:53:56 +00:00
2021-06-21 08:06:08 +00:00
1. Start infrastructure services:
2021-04-20 05:53:56 +00:00
```
2021-06-21 08:06:08 +00:00
$ cd /home/$USER/milvus/deployments/docker/dev
$ sudo docker-compose up -d
2021-04-20 05:53:56 +00:00
```
2021-06-21 08:06:08 +00:00
2. Start Milvus:
2021-04-20 05:53:56 +00:00
2021-06-21 08:06:08 +00:00
- For Milvus Standalone
2021-04-20 05:53:56 +00:00
```
2021-06-21 08:06:08 +00:00
$ cd /home/$USER/milvus
./bin/milvus run standalone > /tmp/standalone.log 2>& 1 &
2021-04-20 05:53:56 +00:00
```
2021-06-21 08:06:08 +00:00
- For Milvus Cluster:
2021-04-20 05:53:56 +00:00
```
2021-06-21 08:06:08 +00:00
$ cd /home/$USER/milvus
#start RootCoord
./bin/milvus run rootcoord > /tmp/rootcoord.log 2>& 1 &
#start coord
./bin/milvus run datacoord > /tmp/datacoord.log 2>& 1 &
./bin/milvus run indexcoord > /tmp/indexcoord.log 2>& 1 &
./bin/milvus run querycoord > /tmp/querycoord.log 2>& 1 &
#start node
./bin/milvus run proxy > /tmp/proxy.log 2>& 1 &
./bin/milvus run datanode > /tmp/data_node.log 2>& 1 &
./bin/milvus run indexnode > /tmp/index_node.log 2>& 1 &
./bin/milvus run querynode > /tmp/query_node.log 2>& 1 &
2021-04-20 05:53:56 +00:00
```