From a3852b058908cde2e78102a79e5a51292925cf93 Mon Sep 17 00:00:00 2001 From: "abby.huang" <78209557+abby-cyber@users.noreply.github.com> Date: Mon, 1 Nov 2021 16:31:36 +0800 Subject: [PATCH] Update 1.install-nebula-graph-by-compiling-the-source-code.md (#1117) * Update 1.install-nebula-graph-by-compiling-the-source-code.md * Update 1.install-nebula-graph-by-compiling-the-source-code.md * Update 1.install-nebula-graph-by-compiling-the-source-code.md * Update 1.install-nebula-graph-by-compiling-the-source-code.md * Update 1.install-nebula-graph-by-compiling-the-source-code.md Co-authored-by: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> --- ...bula-graph-by-compiling-the-source-code.md | 81 ++++++++----------- 1 file changed, 33 insertions(+), 48 deletions(-) diff --git a/docs-2.0/4.deployment-and-installation/2.compile-and-install-nebula-graph/1.install-nebula-graph-by-compiling-the-source-code.md b/docs-2.0/4.deployment-and-installation/2.compile-and-install-nebula-graph/1.install-nebula-graph-by-compiling-the-source-code.md index d58d45725d..22d4e66658 100644 --- a/docs-2.0/4.deployment-and-installation/2.compile-and-install-nebula-graph/1.install-nebula-graph-by-compiling-the-source-code.md +++ b/docs-2.0/4.deployment-and-installation/2.compile-and-install-nebula-graph/1.install-nebula-graph-by-compiling-the-source-code.md @@ -14,31 +14,35 @@ ## 安装步骤 +!!! Note + + 从{{ nebula.release }}版本开始,Nebula-Graph、Nebula-Storage、Nebula-Common的代码仓库合并为Nebula代码仓库,因此编译步骤与之前版本的步骤有所不同。 + 1. 克隆Nebula Graph的源代码到主机。 - - [推荐]如果需要安装v{{nebula.release}}版本的Nebula Graph,执行如下命令: + - [推荐]如果需要安装{{nebula.release}}版本的Nebula Graph,执行如下命令: - ```bash - $ git clone --branch v{{nebula.release}} https://github.com/vesoft-inc/nebula-graph.git - ``` + ```bash + $ git clone --branch {{nebula.branch}} https://github.com/vesoft-inc/nebula.git + ``` - - 如果需要安装最新的开发版本用于测试,执行如下命令克隆master分支的代码: + - 如果需要安装最新的开发版本用于测试,执行如下命令克隆master分支的代码: - ```bash - $ git clone https://github.com/vesoft-inc/nebula-graph.git - ``` + ```bash + $ git clone https://github.com/vesoft-inc/nebula.git + ``` -2. 进入目录`nebula-graph`。 +2. 进入目录`nebula`。 - ```bash - $ cd nebula-graph - ``` + ```bash + $ cd nebula + ``` 3. 创建目录`build`并进入该目录。 - ```bash - $ mkdir build && cd build - ``` + ```bash + $ mkdir build && cd build + ``` 4. 使用CMake生成makefile文件。 @@ -48,18 +52,9 @@ 更多CMake参数说明,请参见[CMake参数](#cmake)。 - - 如果在第1步下载了v{{nebula.release}}版本的源码,执行如下命令。选项`-DNEBULA_COMMON_REPO_TAG`和`-DNEBULA_STORAGE_REPO_TAG`用于指定[nebula-common](https://github.com/vesoft-inc/nebula-common)和[nebula-storage](https://github.com/vesoft-inc/nebula-storage)库的分支,以使各Nebula Graph组件的版本保持一致。 - - ```bash - $ cmake -DENABLE_BUILD_STORAGE=on -DENABLE_TESTING=OFF -DCMAKE_BUILD_TYPE=Release \ - -DNEBULA_COMMON_REPO_TAG=v{{ nebula.release }} -DNEBULA_STORAGE_REPO_TAG=v{{ nebula.release }} .. - ``` - - - 如果在第1步下载了master分支的代码,执行如下命令即可。 - - ```bash - $ cmake -DENABLE_BUILD_STORAGE=on -DENABLE_TESTING=OFF -DENABLE_MODULE_UPDATE=ON -DCMAKE_BUILD_TYPE=Release .. - ``` + ```bash + $ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nebula -DENABLE_TESTING=OFF -DCMAKE_BUILD_TYPE=Release .. + ``` 5. 编译Nebula Graph。 @@ -67,17 +62,17 @@ 检查[软硬件要求和安装三方库依赖包](../1.resource-preparations.md)。 - 为了适当地加快编译速度,可以使用选项`-j`并行编译。并行数量`N`建议为$\min(\text{CPU}核数,\frac{内存(GB)}{2})$。 + 为了适当地加快编译速度,可以使用选项`-j`并行编译。并行数量`N`建议为$\min(\text{CPU}核数,\frac{内存(GB)}{2})$。 - ```bash - $ make -j{N} # E.g., make -j2 - ``` + ```bash + $ make -j{N} # E.g., make -j2 + ``` 6. 安装Nebula Graph。 - ```bash - $ sudo make install-all - ``` + ```bash + $ sudo make install + ``` 7. 安装目录下的 `etc/` 目录中(默认为`/usr/local/nebula/etc`)的配置文件为参考模版,用户可以根据需要创建自己的配置文件。如果要使用 `script` 目录下的脚本,启动、停止、重启、中止和查看服务,配置文件需要命名为 `nebula-graph.conf`,`nebula-metad.conf`和`nebula-storaged.conf`。 @@ -89,11 +84,9 @@ master分支的代码更新速度快,如果安装了master分支对应的开发版Nebula Graph,可根据以下步骤更新版本。 - 1. 在目录`nebula-graph/`中,执行命令`git pull upstream master`更新源码。 +1. 在目录`nebula`中,执行命令`git pull upstream master`更新源码。 - 2. 在目录`nebula-graph/modules/common/`和`nebula-graph/modules/storage/`中,分别执行命令`git pull upstream master`。 - - 3. 在目录`nebula-graph/build/`中,重新执行`make -j{N}`和`make install-all`。 +2. 在目录`nebula/build`中,重新执行`make -j{N}`和`make install`。 ## 下一步 @@ -113,12 +106,6 @@ $ cmake -D= ... 下文的CMake参数可以在配置(CMake)阶段用来调整编译设置。 -### ENABLE_BUILD_STORAGE - -从{{ nebula.release }}版本开始,Nebula Graph的graph和storage代码仓库分离,可以各自单独编译。`ENABLE_BUILD_STORAGE`默认值为`OFF`,表示Storage服务不会和Graph服务一起安装。 - -如果单机部署Nebula Graph进行测试,可以设置`ENABLE_BUILD_STORAGE=ON`,安装时会自动下载和安装Storage服务。 - ### CMAKE_INSTALL_PREFIX `CMAKE_INSTALL_PREFIX`指定Nebula Graph服务模块、脚本和配置文件的安装路径,默认路径为`/usr/local/nebula`。 @@ -166,7 +153,7 @@ $ cmake -DCMAKE_C_COMPILER= -DCMAKE_CXX_COMPILER= -DCMAKE_CXX_COMPILER=