-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cluster deploy #56
Merged
Merged
Cluster deploy #56
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
docs/manual-CN/3.build-develop-and-administration/2.install/4.cluster-deploy.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# 集群部署 | ||
|
||
在本文档中,我们将指导您使用部署 **Nebula Graph** 集群。同时我们也使用 [Docker](https://github.com/vesoft-inc/nebula-docker-compose/blob/master/README_zh-CN.md) 部署好了集群,以便您可以在几分钟之内试用。 | ||
|
||
## 前提条件 | ||
|
||
在开始部署 **Nebula Graph** 集群前,确保您已在集群的每一台机器上安装最新版本的 **Nebula Graph**。安装方式参考: | ||
|
||
- [包安装](1.install-with-rpm-deb.md) | ||
- [源码编译安装](../1.build/1.build-source-code.md) | ||
|
||
由于 **Nebula Graph** 依赖较多,推荐使用安装包安装。 | ||
|
||
本文档中,我们准备了 3 台装有 CentOS 7.5 系统的机器, IP 如下: | ||
|
||
```text | ||
192.168.8.14 # cluster-14 | ||
192.168.8.15 # cluster-15 | ||
192.168.8.16 # cluster-16 | ||
``` | ||
|
||
## 要部署的 Nebula Graph 服务 | ||
|
||
在本文档中我们将部署以下 **Nebula Graph** 服务: | ||
|
||
- 3 副本 `nebula-metad` 服务 | ||
- 3 副本 `nebula-storaged` 服务 | ||
- 3 副本 `nebula-graphd` 服务 | ||
|
||
```text | ||
- cluster-14: metad/storaged/graphd | ||
- cluster-15: metad/storaged/graphd | ||
- cluster-16: metad/storaged/graphd | ||
``` | ||
|
||
## 修改配置文件 | ||
|
||
**Nebula Graph** 的所有配置文件均位于 `/usr/local/nebula/etc` 目录下,并且提供了三份默认配置。 | ||
|
||
### nebula-metad.conf | ||
|
||
部署集群时,需要根据每个节点上部署的服务修改相应配置文件中的两个参数: `local_ip` 和 `meta_server_addrs`。 `local_ip` 要修改成节点的 IP, `meta_server_addrs` 需要修改成集群上 meta 服务的 ip:port 对。多个 ip:port 对之间需要用逗号隔开。 | ||
|
||
`cluster-14` 上的两项配置示例如下所示: | ||
|
||
```text | ||
# Peers | ||
--meta_server_addrs=192.168.8.14:45500,192.168.8.15:45500,192.168.8.16:45500 | ||
# Local ip | ||
--local_ip=192.168.8.14 | ||
# Meta daemon listening port | ||
--port=45500 | ||
``` | ||
|
||
### nebula-graphd.conf | ||
|
||
部署集群时,需要为 graphd 服务配置 metad 的地址和端口 `meta_server_addrs`。 cluster-14 上的部分配置如下: | ||
|
||
```text | ||
# Meta Server Address | ||
--meta_server_addrs=192.168.8.14:45500,192.168.8.15:45500,192.168.8.16:45500 | ||
``` | ||
|
||
### nebula-storaged.conf | ||
|
||
部署集群时,需要为 storaged 服务配置 metad 的地址和端口 `meta_server_addrs` 以及本机地址 `local_ip`。 cluster-14 上的部分配置如下: | ||
|
||
```text | ||
# Meta server address | ||
--meta_server_addrs=192.168.8.14:45500,192.168.8.15:45500,192.168.8.16:45500 | ||
# Local ip | ||
--local_ip=192.168.8.14 | ||
# Storage daemon listening port | ||
--port=44500 | ||
``` | ||
|
||
## 启动集群 | ||
|
||
集群启动请参考 [启停 Nebula Graph 服务文档](2.start-stop-service.md)。 | ||
|
||
## 测试集群 | ||
|
||
登录集群中的一台机器,执行如下命令: | ||
|
||
```ngql | ||
[(none)]> SHOW HOSTS; | ||
================================================================================================== | ||
| Ip | Port | Status | Leader count | Leader distribution | Partition distribution | | ||
================================================================================================== | ||
| 192.168.8.14 | 44500 | online | 0 | No valid partition | No valid partition | | ||
-------------------------------------------------------------------------------------------------- | ||
| 192.168.8.15 | 44500 | online | 3 | toy: 1, test: 1, NBA: 1 | NBA: 1, toy: 1, test: 1 | | ||
-------------------------------------------------------------------------------------------------- | ||
| 192.168.8.16 | 44500 | online | 0 | No valid partition | No valid partition | | ||
-------------------------------------------------------------------------------------------------- | ||
| Total | | | 3 | NBA: 1, toy: 1, test: 1 | NBA: 1, test: 1, toy: 1 | | ||
-------------------------------------------------------------------------------------------------- | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,8 @@ nebula> UPDATE CONFIGS graph:v=1; | |
`ws_h2_port` | 13002 | HTTP/2 协议监听端口(内部使用) | ||
`ws_ip` | "127.0.0.1" | web service 绑定地址 | ||
|
||
注意: `meta_server_addrs` 参数中推荐使用实际 IP,`127.0.0.1` 有时不会被正确解析。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
|
||
## authorization (安全相关) | ||
|
||
属性名 | 默认值 | 说明 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,8 @@ nebula> UPDATE CONFIGS storage:v=1; | |
`raft_heartbeat_interval_secs` | 5 (秒) | RAFT 选举通信超时时间 | 修改配置文件重启| | | ||
`raft_rpc_timeout_ms` | 500 (ms) | RAFT RPC 通信超时 | 修改配置文件重启| | | ||
|
||
注意: `meta_server_addrs` 参数中推荐使用实际 IP,`127.0.0.1` 有时不会被正确解析。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
|
||
## storage 数据持久化设置 | ||
|
||
属性名 | 默认值 | 说明 | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这篇文档里面没有讲到local_ip,所以我认为没有必要在这里加