diff --git a/docs-2.0/4.deployment-and-installation/1.resource-preparations.md b/docs-2.0/4.deployment-and-installation/1.resource-preparations.md index 68d12f9c238..8511b6cbf39 100644 --- a/docs-2.0/4.deployment-and-installation/1.resource-preparations.md +++ b/docs-2.0/4.deployment-and-installation/1.resource-preparations.md @@ -2,18 +2,6 @@ 本文介绍编译、安装 Nebula Graph 的要求和建议,以及如何预估集群运行所需的资源。 -## 阅读指南 - -如果是带着如下问题阅读本文,可以直接单击问题跳转查看对应的说明。 - -- [编译 Nebula Graph 源码的要求是什么?](#nebula_graph_1) - -- [测试环境中运行 Nebula Graph 的要求是什么?](#nebula_graph_2) - -- [生产环境中运行 Nebula Graph 的要求是什么?](#nebula_graph_3) - -- [需要预留多少内存和硬盘空间给 Nebula Graph 集群?](#nebula_graph_4) - ## 编译 Nebula Graph 源码要求 ### 硬件要求 @@ -26,7 +14,11 @@ ### 操作系统要求 -当前仅支持在 Linux 系统中编译 Nebula Graph,建议使用内核版本为`2.6.32`及以上版本的 Linux 系统。 +当前仅支持在 Linux 系统中编译 Nebula Graph,建议使用内核版本为`4.15`及以上版本的 Linux 系统。 + +!!! note + + 在内核版本低于要求的 Linux 系统中安装 Nebula Graph 可使用 [RPM、DEB](2.compile-and-install-nebula-graph/2.install-nebula-graph-by-rpm-or-deb.md) 或者 [TAR](2.compile-and-install-nebula-graph/4.install-nebula-graph-from-tar.md) 文件。 ### 软件要求 @@ -44,10 +36,8 @@ | readline-devel | 任意稳定版本 | - | | ncurses-devel | 任意稳定版本 | - | | zlib-devel | 任意稳定版本 | - | -| gcc | 7.5.0 及以上 | 执行命令`gcc -v`检查版本。 | -| gcc-c++ | 任意稳定版本 | - | -| cmake | 3.9.0 及以上 | 执行命令`cmake --version`检查版本。 | -| gettext | 任意稳定版本 | - | +| g++ | 8.5.0 及以上 | 执行命令`g++ -v`检查版本。 | +| cmake | 3.14.0 及以上| 执行命令`cmake --version`检查版本。 | | curl | 任意稳定版本 | - | | redhat-lsb-core | 任意稳定版本 | - | | libstdc++-static | 任意稳定版本 | 仅在 CentOS 8+、RedHat 8+、Fedora 中需要。 | @@ -58,104 +48,78 @@ ### 安装编译所需软件 -本小节指导下载和安装 Nebula Graph 编译时需要的软件。 +如果部分依赖软件缺失或者版本不满足要求,根据如下步骤手动安装。可根据实际情况删减命令中要安装的软件、跳过无需执行的步骤。 1. 安装依赖包。 - - CentOS、RedHat、Fedora 用户请执行如下命令: - - ```bash - $ yum update - $ yum install -y make \ - m4 \ - git \ - wget \ - unzip \ - xz \ - readline-devel \ - ncurses-devel \ - zlib-devel \ - gcc \ - gcc-c++ \ - cmake \ - gettext \ - curl \ - redhat-lsb-core \ - bzip2 - // 仅 CentOS 8+、RedHat 8+、Fedora 需要安装 libstdc++-static 和 libasan。 - $ yum install -y libstdc++-static libasan - ``` - - - Debian 和 Ubuntu 用户请执行如下命令: - - ```bash - $ apt-get update - $ apt-get install -y make \ - m4 \ - git \ - wget \ - unzip \ - xz-utils \ - curl \ - lsb-core \ - build-essential \ - libreadline-dev \ - ncurses-dev \ - cmake \ - gettext - ``` - -2. 检查主机上的 GCC 和 CMake 版本是否正确。版本信息请参见[软件要求](#_4)。 - - ```bash - $ g++ --version - $ cmake --version - ``` - - 如果版本正确,用户可以跳过本小节。如果不正确,请根据如下步骤安装: - - 1. 克隆仓库`nebula`到主机。 - - ```bash - $ git clone -b {{ nebula.branch}} https://github.com/vesoft-inc/nebula.git - ``` - - 如需安装特定版本的 Nebula Graph,使用`--branch`或`-b`选项指定相应的 nebula-common 分支。 例如,指定{{ nebula.release }},命令如下: - - ```bash - $ git clone --branch {{ nebula.branch}} https://github.com/vesoft-inc/nebula.git - ``` - - 2. 进入目录`nebula`。 - - ```bash - $ cd nebula - ``` - - 3. 执行如下命令安装和启用 GCC 和 CMake。 - - ```bash - // 安装 CMake。 - $ ./third-party/install-cmake.sh cmake-install - - // 启用 CMake。 - $ source cmake-install/bin/enable-cmake.sh - - //opt 目录添加写权限。 - $ sudo mkdir /opt/vesoft && sudo chmod -R a+w /opt/vesoft - - // 安装 GCC。安装到 opt 目录需要写权限,用户也可以修改为其他目录。 - $ ./third-party/install-gcc.sh --prefix=/opt - - // 启用 GCC。 - $ source /opt/vesoft/toolset/gcc/9.3.0/enable - ``` - -3. 执行脚本`install-third-party.sh`。 - - ```bash - $ ./third-party/install-third-party.sh - ``` + - CentOS、RedHat、Fedora 用户请执行如下命令: + + ```bash + $ yum update + $ yum install -y make \ + m4 \ + git \ + wget \ + unzip \ + xz \ + readline-devel \ + ncurses-devel \ + zlib-devel \ + gcc \ + gcc-c++ \ + cmake \ + curl \ + redhat-lsb-core \ + bzip2 + // 仅 CentOS 8+、RedHat 8+、Fedora 需要安装 libstdc++-static 和 libasan。 + $ yum install -y libstdc++-static libasan + ``` + + - Debian 和 Ubuntu 用户请执行如下命令: + + ```bash + $ apt-get update + $ apt-get install -y make \ + m4 \ + git \ + wget \ + unzip \ + xz-utils \ + curl \ + lsb-core \ + build-essential \ + libreadline-dev \ + ncurses-dev \ + cmake + ``` + +2. 检查主机上的 G++ 和 CMake 版本是否正确。版本信息请参见[软件要求](#_4)。 + + ```bash + $ g++ --version + $ cmake --version + ``` + + 如果版本正确,则软件依赖已准备完毕,忽略后续步骤;如果不正确,根据不符合版本要求的软件执行后续步骤。 + +3. 如果 CMake 版本不符合要求,访问 CMake 官网以获取符合需要的版本。 + +4. 如果 G++ 版本不符合要求,自行到 GCC 官网获取相应版本或根据以下方法安装合适版本的 GCC。 + + - CentOS 系统的用户依次执行以下命令: + + ``` + yum install centos-release-scl + yum install devtoolset-11 + scl enable devtoolset-11 'bash' + ``` + + - Ubuntu 系统的用户依次执行以下命令: + + ``` + add-apt-repository ppa:ubuntu-toolchain-r/test + apt install gcc-11 g++-11 + ``` ## 测试环境运行 Nebula Graph 要求 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 0d1c5445c8f..eccdbaf9c15 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,10 +14,6 @@ ## 安装步骤 -!!! Note - - 从{{ nebula.release }}版本开始,Nebula-Graph、Nebula-Storage、Nebula-Common 的代码仓库合并为 Nebula 代码仓库,因此编译步骤与之前版本的步骤有所不同。 - 1. 克隆 Nebula Graph 的源代码到主机。 - [推荐] 如果需要安装{{nebula.release}}版本的 Nebula Graph,执行如下命令: @@ -74,11 +70,7 @@ $ sudo make install ``` -7. 安装目录下的 `etc/` 目录中(默认为`/usr/local/nebula/etc`)的配置文件为参考模版,用户可以根据需要创建自己的配置文件。如果要使用 `script` 目录下的脚本,启动、停止、重启、中止和查看服务,配置文件需要命名为 `nebula-graph.conf`,`nebula-metad.conf`和`nebula-storaged.conf`。 - - !!! compatibility - - 在 2.0.1 中,可以直接使用 `script` 目录下的脚本,不需要将配置文件重新命名。 +7. 安装目录下`etc/`目录中(默认为`/usr/local/nebula/etc`)的配置文件为参考模版,用户可以根据需要创建自己的配置文件。如果要使用 `script` 目录下的脚本,启动、停止、重启、中止和查看服务,配置文件需要命名为 `nebula-graph.conf`,`nebula-metad.conf`和`nebula-storaged.conf`。 ## 更新 master 版本 @@ -110,15 +102,15 @@ $ cmake -D= ... ### ENABLE_WERROR -`ENABLE_WERROR`默认值为`ON`,表示将所有警告(warning)变为错误(error)。如果有必要,用户可以设置为`OFF`。 +默认值为`ON`,表示将所有警告(warning)变为错误(error)。如果有必要,用户可以设置为`OFF`。 ### ENABLE_TESTING -`ENABLE_TESTING`默认值为`ON`,表示单元测试服务由 Nebula Graph 服务构建。如果只需要服务模块,可以设置为`OFF`。 +默认值为`ON`,表示单元测试服务由 Nebula Graph 服务构建。如果只需要服务模块,可以设置为`OFF`。 ### ENABLE_ASAN -`ENABLE_ASAN`默认值为`OFF`,表示关闭内存问题检测工具 ASan(AddressSanitizer)。该工具是为 Nebula Graph 开发者准备的,如果需要开启,可以设置为`ON`。 +默认值为`OFF`,表示关闭内存问题检测工具 ASan(AddressSanitizer)。该工具是为 Nebula Graph 开发者准备的,如果需要开启,可以设置为`ON`。 ### CMAKE_BUILD_TYPE @@ -126,7 +118,7 @@ $ cmake -D= ... - `Debug` - `CMAKE_BUILD_TYPE`的默认值,build 过程中只记录 debug 信息,不使用优化选项。 + `CMAKE_BUILD_TYPE`的默认值,表示 build 过程中只记录 debug 信息,不使用优化选项。 - `Release` @@ -140,6 +132,18 @@ $ cmake -D= ... build 过程中仅通过优化选项控制代码大小,不记录 debug 信息。 +### ENABLE_INCLUDE_WHAT_YOU_USE + +默认值为`OFF`。当其值为`ON`且系统中安装了include-what-you-use,系统将在生成 makefile 过程中报告工程源码中包含的冗余头文件。 + +### NEBULA_USE_LINKER + +指定链接程序的方式: + +- 默认值为`bfd`,表示使用 ld.bfd 链接程序。 +- 如果系统中安装了 lld 链接器, 可设置参数值为`lld`,表示使用 ld.lld 链接程序。 +- 如果系统中安装了 gold 链接器,可设为`gold`,表示使用 ld.gold 链接程序。 + ### CMAKE_C_COMPILER/CMAKE_CXX_COMPILER 通常情况下,CMake 会自动查找并使用主机上的 C/C++编译器,但是如果编译器没有安装在标准路径,或者想使用其他编译器,请执行如下命令指定目标编译器的安装路径: