Skip to content

Commit

Permalink
[doc]minor updates and add how to start nebula (vesoft-inc#1645)
Browse files Browse the repository at this point in the history
Co-authored-by: dutor <440396+dutor@users.noreply.github.com>
  • Loading branch information
wilsonyou and dutor committed Jan 19, 2020
1 parent 18572a2 commit f3cf76a
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* CMake: 3.5.0 或更高版本,通过命令`cmake --version`查看
* 能够访问互联网

_请注意,**Nebula Graph** 目前仅支持 x86_64 架构。_
**注意**: **Nebula Graph** 目前仅支持 x86_64 架构。

## 快速编译步骤

Expand Down Expand Up @@ -105,10 +105,42 @@ etc/ bin/ share/ scripts/

由于 **Nebula Graph** 使用了大量的 C++ 模板,尤其是 Folly,fbthrift 和 boost,因此编译会非常耗时。比如,如果使用 Intel E5-2697 v3 处理器,在 16 个任务并发运行的情况下,需要花费大约 4 分钟完成编译,总的 CPU 时间大约 35 分钟。

除默认选项外,**Nebula Graph** 的编译系统还提供诸多选项来调整编译行为。
### 启动 **Nebula Graph** 服务

在编译安装 **Nebula Graph** 后,可以启动 **Nebula Graph** 服务。默认情况下,**Nebula Graph** 安装在 `/home/username/nebula/build/install` 路径下,其中 *username* 需要替换成您自己的用户名。

1. 把您当前的路径切换到 **Nebula Graph** 的安装路径下。

```bash
$ cd /home/username/nebula/build/install
```

2. 重命名 **Nebula Graph** 服务的配置文件。

```bash
$ cp etc/nebula-graphd.conf.default etc/nebula-graphd.conf
$ cp etc/nebula-metad.conf.default etc/nebula-metad.conf
$ cp etc/nebula-storaged.conf.default etc/nebula-storaged.conf
```

3. 启动 **Nebula Graph** 服务。

```bash
$ ./scripts/nebula.service start all
```

4. 连接到 **Nebula Graph** 服务。

```bash
$ ./bin/nebula -u user -p password --port 3699 --addr="127.0.0.1"
```

**注意**:如果您成功连接到 **Nebula Graph** 服务,则可以看到 `Welcome to Nebula Graph` 信息,并自动进入到 `ngql` 命令行界面。

## 编译选项

除默认选项外,**Nebula Graph** 的编译系统还提供诸多选项来调整编译行为。

### CMake 参数

可通过 `cmake -DArgument=Value ..` 调整 CMake 参数。
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build From Source
# Build From Source Code

## Caveats
## Overview

We have tested building on various environments, including CentOS 6 to 8, Ubuntu 16.04 to 19.04, Fedora 28 to 30, GCC 7.1.0 to 9.2.0 and recent Clang++ and the devtoolset of Red Hat and CentOS. But due to the complexity of building environments, we still cannot guarantee that we have covered all kinds of situations. If any problem encountered, please fire an issue or open a pull request to let us know.

Expand Down Expand Up @@ -43,7 +43,7 @@ $ yum install -y make \
curl \
redhat-lsb-core

# For CentOS 8+, RedHat 8+, and Fedora, you need install libstdc++-static, libasan
# For CentOS 8+, RedHat 8+, and Fedora, you need to install libstdc++-static, libasan
$ yum install -y libstdc++-static libasan
```

Expand Down Expand Up @@ -96,7 +96,7 @@ $ cd nebula
$ mkdir build
$ cd build
$ cmake -DENABLE_TESTING=OFF -DCMAKE_INSTALL_PREFIX=$PWD/install ..
# N is suggested to the minimum of number of cores and half of available memory in Gigabytes
# Assuming cores is the number of cores and mem_gb is the memory size (in GB), the value of N is recommended to select the smaller one from cores and mem_gb / 2
$ make -jN
$ make install
$ ls install/
Expand All @@ -106,10 +106,42 @@ etc/ bin/ share/ scripts/
Since C++ templates are heavily used by **Nebula Graph** and its third party dependencies, especially Folly, fbthrift and boost, the building is very time-consuming.
For your reference, it is expected to take about 35 minutes in CPU time(less than 4 minutes with `-j16`), given an Intel E5-2697 v3 processor and unit tests are disabled.

Until now, you might already have built **Nebula Graph** successfully. If so or not, we also provide ways to tweak the building process.
### Starting **Nebula Graph** Services

After compiling and installing **Nebula Graph**, you can start **Nebula Graph** services. By default, **Nebula Graph** is installed in the `/home/username/nebula/build/install` directory, in which the *username* must be replaced by your username.

1. Change your current directory to the directory where **Nebula Graph** is installed.

```bash
$ cd /home/username/nebula/build/install
```

2. Rename the configuration files for **Nebula Graph** services.

```bash
$ cp etc/nebula-graphd.conf.default etc/nebula-graphd.conf
$ cp etc/nebula-metad.conf.default etc/nebula-metad.conf
$ cp etc/nebula-storaged.conf.default etc/nebula-storaged.conf
```

3. Start **Nebula Graph** services.

```bash
$ ./scripts/nebula.service start all
```

4. Connect to **Nebula Graph** services.

```bash
$ ./bin/nebula -u user -p password --port 3699 --addr="127.0.0.1"
```

**Note**: If you successfully connect to **Nebula Graph** services, you can see the `Welcome to Nebula Graph` message is displayed and automatically enter the `ngql` command line.

## Ways to Tweak the Building

Until now, you might already have built **Nebula Graph** successfully. If so or not, we also provide ways to tweak the building process.

### CMake Arguments/Variables

We provide several options to make one tweak the building, while some of these are builtins from CMake. These arguments are used at the configure(cmake) stage, like `cmake -DArgument=Value ..`.
Expand Down

0 comments on commit f3cf76a

Please sign in to comment.