milvus/INSTALL.md
Lutkin Wang 4636b7c724
Add troubleshooting information for INSTALL.md and enhance readability (#1274)
* Update INSTALL.md

1. Add new troubleshooting message;
2. Enhance readability.

Signed-off-by: Lutkin Wang <yamasite@qq.com>

* Update INSTALL.md

Signed-off-by: Lutkin Wang <yamasite@qq.com>

* Update INSTALL.md

Signed-off-by: Lutkin Wang <yamasite@qq.com>

* Update INSTALL.md

Add CentOS link.

Signed-off-by: Lutkin Wang <yamasite@qq.com>
2020-02-20 13:44:02 +08:00

5.3 KiB
Raw Blame History

Install Milvus from Source Code

Build from source

Requirements

  • Ubuntu 18.04 or higher
  • CentOS 7

If your operating system does not meet the requirements, we recommend that you pull a Docker image of Ubuntu 18.04 or CentOS 7 as your compilation environment.

  • GCC 7.0 or higher to support C++ 17
  • CMake 3.12 or higher

For GPU-enabled version, you will also need:

  • CUDA 10.0 or higher
  • NVIDIA driver 418 or higher

Compilation

Step 1 Install dependencies

$ cd [Milvus root path]/core
$ ./ubuntu_build_deps.sh

Step 2 Build

Build in Ubuntu
$ cd [Milvus root path]/core
$ ./build.sh -t Debug

or

$ ./build.sh -t Release
Build in CentOS
$ cd [Milvus root path]/core
$ ./centos7_build_deps.sh

By default, it will build CPU-only version. To build GPU version, add -g option.

$ ./build.sh -g

If you want to know the complete build options, run the following command.

$./build.sh -h

When the build is completed, all the stuff that you need in order to run Milvus will be installed under [Milvus root path]/core/milvus.

Launch Milvus server

$ cd [Milvus root path]/core/milvus

Add lib/ directory to LD_LIBRARY_PATH

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:[Milvus root path]/core/milvus/lib

Then start Milvus server:

$ cd scripts
$ ./start_server.sh

To stop Milvus server, run:

$ ./stop_server.sh

Compile Milvus on Docker

With the following Docker images, you should be able to compile Milvus on any Linux platform that run Docker. To build a GPU supported Milvus, you need to install NVIDIA Docker first.

Step 1 Pull Milvus Docker images

Pull CPU-only image:

$ docker pull milvusdb/milvus-cpu-build-env:latest

Pull GPU-enabled image:

$ docker pull milvusdb/milvus-gpu-build-env:latest

Step 2 Start the Docker container

Start a CPU-only container:

$ docker run -it -p 19530:19530 -d milvusdb/milvus-cpu-build-env:latest

Start a GPU container:

$ docker run --runtime=nvidia -it -p 19530:19530 -d milvusdb/milvus-gpu-build-env:latest

To enter the container:

$ docker exec -it [container_id] bash

Step 3 Download Milvus source code

Download latest Milvus source code:

$ cd /home
$ git clone https://github.com/milvus-io/milvus

To enter its core directory:

$ cd ./milvus/core

Step 4 Compile Milvus in the container

If you are using a CPU-only image, compile it like this:

$ ./build.sh -t Release

If you are using a GPU-enabled image, you need to add a -g parameter:

$ ./build.sh -g -t Release

Then start Milvus server

$ ./start_server.sh

Troubleshooting

Error message: protocol https not supported or disabled in libcurl

Follow the steps below to solve this problem:

  1. Make sure you have libcurl4-openssl-dev installed in your system.

  2. Try reinstalling the latest CMake from source with --system-curl option:

    $ ./bootstrap --system-curl
    $ make
    $ sudo make install
    

    If the --system-curl command doesn't work, you can also reinstall CMake in Ubuntu Software on your local computer.

Error message: internal compiler error

Try increasing the memory allocated to docker.

Error message: error while loading shared libraries: libmysqlpp.so.3

Follow the steps below to solve this problem:

  1. Check whether libmysqlpp.so.3 is correctly installed.
  2. If libmysqlpp.so.3 is installed, check whether it is added to LD_LIBRARY_PATH.

CMake version is not supported

Follow the steps below to install a supported version of CMake:

  1. Remove the unsupported version of CMake.

  2. Get CMake 3.12 or higher. Here we get CMake 3.12.

    $ wget https://cmake.org/files/v3.12/cmake-3.12.2-Linux-x86_64.tar.gz
    
  3. Extract the file and install CMake.

    $ tar zxvf cmake-3.12.2-Linux-x86_64.tar.gz
    $ mv cmake-3.12.2-Linux-x86_64 /opt/cmake-3.12.2
    $ ln -sf /opt/cmake-3.12.2/bin/* /usr/bin/