Skip to content

Commit

Permalink
Added docs on deployment (#818)
Browse files Browse the repository at this point in the history
* deploy cluster CN

* fix expressions

* fix manual-CN/how-to-build expressions

* update

* update expression
  • Loading branch information
Amber1990Zhang authored and dutor committed Sep 3, 2019
1 parent 3c0b36f commit 6b453b1
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 56 deletions.
13 changes: 7 additions & 6 deletions docs/deploy-cluster.md
Expand Up @@ -22,7 +22,7 @@ dpkg -i nebula-{VERSION}.{SYSTEM_VERSION}.amd64.deb

By default, the config files are under `/usr/local/nebula/etc`, you should modify the `meta_server_addrs` to set the Meta Server's address.

In order to enable multi copy Meta service, you should set the meta addresses split by comma into `meta_server_addrs`.
In order to enable multi copy Meta services, you should set the meta addresses split by comma into `meta_server_addrs`.

Use `data_path` to set `Meta` and `Storage`'s underlying storage directory.

Expand Down Expand Up @@ -52,8 +52,8 @@ Property Name | Default Value | Description
--------------------------- | ------------------------ | -----------
`port` | 45500 | Meta daemon listening port.
`reuse_port` | true | Whether to turn on the SO_REUSEPORT option.
`data_path` | "" | Root data path.
`peers` | "" | It is a list of IPs split by comma, the ips number equals replica number. If empty, it means replica is 1.
`data_path` | "" | Root data path. Multi-path is not supported
`meta_server_addrs` | "" | It is a list of IPs split by comma, the ips number equals replica number. If empty, it means replica is 1.
`local_ip` | "" | Local ip speicified for NetworkUtils::getLocalIP.
`num_io_threads` | 16 | Number of IO threads.
`meta_http_thread_num` | 3 | Number of meta daemon's http thread.
Expand All @@ -62,8 +62,6 @@ Property Name | Default Value | Description
`pid_file` | "pids/nebula-metad.pid" | File to hold the process id.
`daemonize` | true | Whether run as a daemon process.
`cluster_id` | 0 | A unique id for each cluster.
`putTryNum` | 10 | Number of attempts to generate cluster ID.
`load_data_interval_secs` | 2 * 60 | Load data interval.
`meta_ingest_thread_num` | 3. | Meta daemon's ingest thread number.

**Storage Service** supports the following config properties.
Expand All @@ -73,7 +71,7 @@ Property Name | Default Value | Description
`port` | 44500 | Storage daemon listening port.
`reuse_port` | true | Whether to turn on the SO_REUSEPORT option.
`data_path` | "" | Root data path, multi paths should be split by comma. For rocksdb engine, one path one instance.
`local_ip` | "" | IP address which is used to identify this server, combined with the listen port.
`local_ip` | "" | IP address is used to identify this server, combined with the listen port.
`daemonize` | true | Whether to run the process as a daemon.
`pid_file` | "pids/nebula-storaged.pid" | File to hold the process id.
`meta_server_addrs` | "" | List of meta server addresses, the format looks like ip1:port1, ip2:port2, ip3:port3.
Expand Down Expand Up @@ -145,3 +143,6 @@ Property Name | Default Value | Description
`p` | "" | Password used to authenticate.
`enable_history` | false | Whether to force saving the command history.
`server_conn_timeout_ms` | 1000 | Connection timeout in milliseconds.

**Note:** Please make sure the ports are not blocked by the firewall during configuration.

8 changes: 5 additions & 3 deletions docs/get-started.md
Expand Up @@ -72,7 +72,7 @@ Run
to connect to the graph server. -->

**Connect to Nebula Graph**

connect to Nebula:

```
Expand Down Expand Up @@ -154,6 +154,7 @@ Then run the following command:
- port
- ws_http_port: metaservice HTTP port
- ws_h2_port: metaservice HTTP2 port
- meta_server_addrs: List of meta server addresses, the format looks like ip1:port1, ip2:port2, ip3:port3


* Configure nebula-storaged.conf
Expand All @@ -164,10 +165,10 @@ Then run the following command:

Modify configurations in nebula-storaged.conf:

- local_ip
- port
- ws_http_port: storageservice HTTP port
- ws_h2_port: storageservice HTTP2 port
- meta_server_addrs: List of meta server addresses, the format looks like ip1:port1, ip2:port2, ip3:port3

* Configure nebula-graphd.conf

Expand All @@ -181,6 +182,7 @@ Then run the following command:
- port
- ws_http_port: graphservice HTTP port
- ws_h2_port: graphservice HTTP2 port
- meta_server_addrs: List of meta server addresses, the format looks like ip1:port1, ip2:port2, ip3:port3

**Start Service**

Expand All @@ -202,7 +204,7 @@ Make sure all the services are working

* -u is to set the user name, `user` is the default Nebula user account
* -p is to set password, `password` is the default password for account `user`
<!--
<!--
`Add HOSTS` is to register the storage hosts:
```
Expand Down
144 changes: 144 additions & 0 deletions docs/manual-CN/deploy-cluster.md
@@ -0,0 +1,144 @@
---

本节介绍`Nebula`的部署
---

#### 下载并安装包

目前,Nebula官方提供 `CentOS 7.5``CentOS 6.5``Ubuntu 1604``Ubuntu 1804`包,rpm或deb包下载点击[此处](https://github.com/vesoft-inc/nebula/releases)

`CentOS`系统:

```
rpm -ivh nebula-{VERSION}.{SYSTEM_VERSION}.x86_64.rpm
```

`Ubuntu`系统:

```
dpkg -i nebula-{VERSION}.{SYSTEM_VERSION}.amd64.deb
```

配置文件默认目录为`/usr/local/nebula/etc`,请更改`meta_server_addrs`,配置 Meta Server 的地址。

启动多副本 Meta 服务需将多个地址配置到`meta_server_addrs`,地址间需使用逗号分隔。

使用`data_path`设置`Meta`的底层存储路径。
***

#### 启动 Nebula 集群


目前,nebula 集群由`scripts/services.sh`运维,可使用此脚本`start``stop``restart`重启集群。

示例命令如下:

```
scripts/services.sh <start|stop|restart|status|kill>
```

metas, storages 和 graphs 包含其自身的 hosts。

***

#### 配置引用

**Meta Service** 支持如下配置属性:

属性名 | 默认值 | 说明
--------------------------- | ------------------------ | -----------
`port` | 45500 | Meta daemon 监听端口
`reuse_port` | true | 开启 SO_REUSEPORT 选项
`data_path` | "" | 根数据目录,不支持多目录
`meta_server_addrs` | "" | 一系列由逗号分隔的IP地址,IP数与副本数相等,如果为空,则表明副本数为1
`local_ip` | "" | 指定本地IP NetworkUtils::getLocalIP.
`num_io_threads` | 16 | IO 线程数
`meta_http_thread_num` | 3 | meta daemon 的 http 线程数
`num_worker_threads` | 32 | worker 数
`part_man_type` | memory | memory,meta
`pid_file` | "pids/nebula-metad.pid" | 存储进程 ID 的文件
`daemonize` | true | 作为 daemon 进程运行
`load_config_interval_secs` | 2 * 60 | 加载配置间隔
`meta_ingest_thread_num` | 3. | Meta daemon的 ingest 线程数

**Storage Service** 支持如下配置属性:

属性名 | 默认值 | 说明
----------------------------------- | -------------------------- | -----------
`port` | 44500 | Storage daemon 监听端口
`reuse_port` | true | 开启 SO_REUSEPORT 选项
`data_path` | "" | 根数据目录,多条路径由逗号分隔,对 rocksdb 引擎,一个路径为一个实例
`local_ip` | "" | IP 地址和监听端口共同用于标识此服务器
`daemonize` | true | 作为 daemon 进程运行
`pid_file` | "pids/nebula-storaged.pid" | 存储进程 ID 的文件
`meta_server_addrs` | "" | meta server 地址列表,格式为 ip1:port1, ip2:port2, ip3:port3
`store_type` | "nebula" | storage daemon 使用的 KVStore 类型,可选类型为 \"nebula\"\"hbase\"
`num_io_threads` | 16 | IO 线程数
`storage_http_thread_num` | 3 | storage daemon 的 http 线程数
`num_worker_threads` | 32 | worker 数
`engine_type` | rocksdb | rocksdb, memory...
`custom_filter_interval_secs` | 24 * 3600 | 触发自定义压缩间隔
`num_workers` | 4 | worker 线程数
`rocksdb_disable_wal` | false | 禁用 rockdb 的 WAL
`rocksdb_db_options` | "" | DBOptions,每个选项以 <option_name>:<option_value> 格式给出,以.分隔
`rocksdb_column_family_options` | "" | ColumnFamilyOptions,每个选项以 <option_name>:<option_value> 格式给出,以.分隔
`rocksdb_block_based_table_options` | "" | BlockBasedTableOptions,每个选项以<option_name>:<option_value> 格式给出,以.分隔
`batch_size` | 4 * 1024 | 单个批处理的默认保留字节
`block_cache` | 4 | BlockBasedTable:block_cache : MB
`download_thread_num` | 3 | 下载线程数
`min_vertices_per_bucket` | 3 | 一个bucket中最小节点数
`max_appendlog_batch_size` | 128 | 每个appendLog批请求的最大log数
`max_outstanding_requests` | 1024 | outstanding appendLog 请求最大数
`raft_rpc_timeout_ms` | 500 | raft 客户端 RPC 超时时长,单位毫秒
`accept_log_append_during_pulling` | false | pull snapshot 过程中不接受新log
`raft_heartbeat_interval_secs` | 5 | 每次心跳间隔时长,单位秒
`max_batch_size` | 256 | 一个batch中最大log数

**Graph Service** 支持如下配置属性:

属性名 | 默认值 | 说明
------------------------------- | ------------------------ | -----------
`port` | 3699 | Nebula Graph daemon 监听端口
`client_idle_timeout_secs` | 0 | 关闭 idle 连接前的时长(单位秒), 0为 无穷大
`session_idle_timeout_secs` | 600 | idle sessions过期时长(单位秒),0为无穷大
`session_reclaim_interval_secs` | 10 | Period we try to reclaim expired sessions.
`num_netio_threads` | 0 | networking 线程数,0为物理 CPU 核数
`num_accept_threads` | 1 | 接受进入连接的线程数
`num_worker_threads` | 1 | 执行用户查询的线程数
`reuse_port` | true | 开启 SO_REUSEPORT 选项
`listen_backlog` | 1024 | listen socket 的 backlog
`listen_netdev` | "any" | 监听的网络服务
`pid_file` | "pids/nebula-graphd.pid" | 存储进程 ID 的文件
`redirect_stdout` | true | 将 stdout 和 stderr 重定向到单独的文件
`stdout_log_file` | "graphd-stdout.log" | stdout 目标文件名
`stderr_log_file` | "graphd-stderr.log" | stderr 目标文件名
`daemonize` | true | 作为 daemon 进程运行
`meta_server_addrs` | "" | meta server 地址列表,格式为 ip1:port1, ip2:port2, ip3:port3.



**Web Service** 支持如下配置属性:

属性名 | 默认值 | 说明
---------------------- | ------------- | -----------
`ws_http_port` | 11000 | HTTP 协议监听端口
`ws_h2_port` | 11002 | HTTP/2 协议监听端口
`ws_ip` | "127.0.0.1" | IP/Hostname 绑定地址
`ws_threads` | 4 | web service 线程数
`ws_meta_http_port` | 11000 | Meta HTTP 协议监听端口
`ws_meta_h2_port` | 11002 | Meta HTTP/2 协议监听端口
`ws_storage_http_port` | 12000 | Storage HTTP 协议监听端口
`ws_storage_h2_port` | 12002 | Storage HTTP/2 协议监听端口

**Console** 支持如下配置属性:

属性名 | 默认值 | 说明
------------------------ | ------------- | -----------
`addr` | "127.0.0.1" | Nebula daemon IP 地址
`port` | 0 | Nebula daemon 监听端口
`u` | "" | 用于身份验证的用户名
`p` | "" | 用于身份验证的密码
`enable_history` | false | 是否强制保存command历史
`server_conn_timeout_ms` | 1000 | 连接超时时长,单位毫秒

**注意:** 配置时请确保端口未被防火墙阻拦
8 changes: 6 additions & 2 deletions docs/manual-CN/get-started.md
Expand Up @@ -145,6 +145,7 @@ nebula 遵循 c++14 标准,依赖第三方库:
- port: 端口号
- ws_http_port: metaservice HTTP服务端口号
- ws_h2_port: metaservice HTTP2服务端口号
- meta_server_addrs: meta server 地址列表,格式为 ip1:port1, ip2:port2, ip3:port3

* 配置 nebula-storaged.conf

Expand All @@ -158,17 +159,19 @@ nebula 遵循 c++14 标准,依赖第三方库:
- port: 端口号
- ws_http_port: storageservice HTTP 服务端口号
- ws_h2_port: storageservice HTTP2 服务端口号
- meta_server_addrs: meta server 地址列表,格式为 ip1:port1, ip2:port2, ip3:port3

* 配置 nebula-graphd.conf

```
> cp etc/nebula-graphd.conf.default etc/nebula-graphd.conf
```
根据实际修改 nebula-graphd.conf 中的配置:
- local_ip: ip 地址

- port: 端口号
- ws_http_port: graphservice HTTP 服务端口号
- ws_h2_port: graphservice HTTP2 服务端口号
- meta_server_addrs: meta server 地址列表,格式为 ip1:port1, ip2:port2, ip3:port3

**启动服务**

Expand Down Expand Up @@ -443,4 +446,5 @@ nebula> $a=GO FROM 201 OVER like; GO FROM $a.id OVER select YIELD $^.student.nam
1. 首先在容器中执行ifconfig命令,查看您的容器地址,这里假设您的容器地址是172.17.0.3,那么就意味着您需要修改默认配置的IP地址.
2. 然后进入配置目录(cd /usr/local/nebula/etc), 查找所有IP地址配置的位置(grep "172.17.0.2" . -r).
3. 修改上一步查到的所有IP地址为您的容器地址(172.17.0.3).
4. 最后重新启动所有服务.
4. 最后重新启动所有服务.

0 comments on commit 6b453b1

Please sign in to comment.