Compilation and Installation
This section describes how to download the NebulaGraph installation package and third-party dependencies, and how to compile and install NebulaGraph.
- Download the installation package.
1 2
cd ~ git clone --branch release-3.8 https://github.com/vesoft-inc/nebula.git
- Install third-party dependencies. There are two installation methods. To improve the pass rate of developer tests, you are advised to use source code compilation.
- Download the RPM packages of the third-party dependencies.
1 2
cd nebula/third-party bash ./install-third-party.sh
The script checks the versions of components such as the server kernel, GCC, and glibc, and then selects precompiled third-party dependency scripts by matching versions that are less than or equal to the current ones. As a result, the script may fetch non-existent dependency library scripts, leading to installation failure.
To address this, you can delete the unmatched versions in the current environment.
- Open the install-third-party.sh script file.
1vim install-third-party.sh - Locate line 30 or search for gcc_preset_versions, and change
1gcc_preset_versions=( 11.2.0 10.1.0 9.3.0 9.2.0 9.1.0 8.3.0 7.5.0 7.1.0 )
To1gcc_preset_versions=( 9.3.0 9.2.0 9.1.0 8.3.0 7.5.0 7.1.0 )
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the install-third-party.sh script file.
- Compile the source code.
If you want to perform local function tests later, you are advised to use source code compilation. Otherwise, many test cases may fail due to version inconsistency.
1 2 3 4 5 6 7 8
cd ~ git clone https://github.com/vesoft-inc/nebula-third-party.git cd nebula-third-party/ git checkout release-3.3 mkdir -p ~/nebula-third-party-native-build cd ~/nebula-third-party-native-build bash ~/nebula-third-party/build.sh
During script execution, compilation errors may occur due to network issues. If this happens, perform the following steps:
- Open the build.sh script file.
1vim ~/nebula-third-party/build.sh - Search for wget -c and change it to wget -c --no-check-certificate.
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the config_guess.sh script file.
1vim ~/nebula-third-party/project/externals/config_guess.sh - Search for curl -fsSL and change it to curl -fsSLk.
- Press Esc, type :wq!, and press Enter to save the file and exit.
A persistent Boost error at this point usually indicates an older Boost version conflicting with a newer NumPy version in your system Python environment. In this case, run the pip uninstall numpy command to resolve it.
- Open the build.sh script file.
- Download the RPM packages of the third-party dependencies.
- Perform the compilation.
Return to the nebula directory, create the build directory, and then go to the directory.
1 2
cd ~/nebula mkdir build && cd build
Use cmake to generate a makefile. The default installation path is /usr/local/nebula. To change the path, modify the -DCMAKE_INSTALL_PREFIX=<installation_path> parameter in the following command. The default third-party dependency directory is /opt/vesoft/third-party. The dependencies downloaded by the script are installed in this directory. For source code compilation, you can specify the path using the NEBULA_THIRDPARTY_ROOT parameter. The following command uses source code compilation and the root account as an example. (As cmake does not support the ~ notation, the path specified by NEBULA_THIRDPARTY_ROOT needs to be changed for different users.)
1cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nebula -DNEBULA_THIRDPARTY_ROOT=/root/nebula-third-party-native-build/install -DENABLE_WERROR=OFF -DENABLE_TESTING=OFF -DCMAKE_BUILD_TYPE=Release ..
If local function tests are required, set ENABLE_TESTING to ON.
For details about CMake parameters, see CMake variables.
Perform the compilation.
1make -j`nproc`
- Perform the installation.
1make install
The configuration files in the etc/ directory (/usr/local/nebula/etc by default) in the installation directory are reference templates. You can create your own configuration files in this directory as required. If you want to use the scripts in the script/ directory to start, stop, restart, terminate, and view services, name the configuration files as nebula-graph.conf, nebula-metad.conf, and nebula-storaged.conf.