-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b8c72e
commit 4a8f962
Showing
7 changed files
with
427 additions
and
235 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
## NEBULAGRAPH Dashboard 贡献指南 | ||
感谢您感兴趣参与贡献 NebulaGraph Dashboard. 请阅读完本篇指南以了解如何进行开发和提交代码至仓库。 | ||
|
||
## 本地部署 | ||
![](./architecture.png) | ||
|
||
### 开发环境 | ||
- nodejs >= v16 | ||
|
||
### 技术栈 | ||
- typescript | ||
- nodejs | ||
|
||
### 本地启动项目 | ||
1. fork 本仓库至您的github个人仓库中 | ||
2. clone[仓库代码](https://github.com/vesoft-inc/nebula-dashboard.git) | ||
``` | ||
git clone https://github.com/vesoft-inc/nebula-dashboard.git | ||
``` | ||
3. 安装node modules | ||
``` | ||
npm install | ||
``` | ||
4. 将vendors/config-relaease.yaml 复制到devserver文件夹,并改名为config.yaml.并修改config.yaml,以使本地web可以连接获取到prometheus数据以及知道监控哪个 NebulaGraph 集群 | ||
|
||
4. 启动项目 | ||
``` | ||
npm run dev | ||
``` | ||
5. 访问 ```http://localhost:7003```查看本地web页面 | ||
|
||
### 如何提交 | ||
1. 创建提交 | ||
``` | ||
git add . | ||
git commit -m "your commit info" | ||
git push [your self origin] | ||
``` | ||
|
||
2. 创建pull request |
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,40 @@ | ||
## NEBULAGRAPH Dashboard Contributing Guide | ||
Thank you for your interest in contributing to the NebulaGraph Dashboard. Please read this guide to learn how to develop and submit code to the repository. | ||
|
||
## 本地部署 | ||
![](./architecture.png) | ||
|
||
### Development Environment | ||
- nodejs >= v16 | ||
|
||
### Technology Stack | ||
- typescript | ||
- nodejs | ||
|
||
### Get Start in Local | ||
1. fork this repository to your personal github repository. | ||
2. clone[repository code](https://github.com/vesoft-inc/nebula-dashboard.git) | ||
``` | ||
git clone https://github.com/vesoft-inc/nebula-dashboard.git | ||
``` | ||
3. install node modules | ||
``` | ||
npm install | ||
``` | ||
4. Copy vendors/config-relaease.yaml to the devserver folder and rename it to config.yaml. And modify config.yaml so that the local web can connect to get prometheus data and know which NebulaGraph cluster to monitor. | ||
|
||
4. Start Project | ||
``` | ||
npm run dev | ||
``` | ||
5. Visit ```http://localhost:7003``` to view the local web page | ||
|
||
### How to commit | ||
1. Create Commit | ||
``` | ||
git add . | ||
git commit -m "your commit info" | ||
git push [your self origin] | ||
``` | ||
|
||
2. create pull request |
This file was deleted.
Oops, something went wrong.
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,126 @@ | ||
## 前提条件 | ||
|
||
在部署 Dashboard 之前,用户需要确认以下信息: | ||
|
||
- NebulaGraph 服务已经部署并启动。详细信息参考 [NebulaGraph 安装部署](https://docs.nebula-graph.com.cn/master/4.deployment-and-installation/1.resource-preparations/ "点击前往 NebulaGraph 安装部署")。 | ||
|
||
- 确保以下端口未被使用: | ||
|
||
- 9200 | ||
|
||
- 9100 | ||
|
||
- 9090 | ||
|
||
- 8090 | ||
|
||
- 7003 | ||
|
||
- 待监控的机器上已经安装 node_exporter。安装方法请参见 [node-exporter 官方文档](https://prometheus.io/docs/guides/node-exporter/)。 | ||
|
||
## 操作步骤 | ||
1. 下载 TAR 包 [nebula-dashboard-{{ dashboard.release }}.x86_64.tar.gz](https://oss-cdn.nebula-graph.com.cn/nebula-graph-dashboard/{{ dashboard.release }}/nebula-dashboard-{{ dashboard.release }}.x86_64.tar.gz)。 | ||
2. 执行命令`tar -xvf nebula-dashboard-{{ dashboard.release }}.x86_64.tar.gz`解压缩。 | ||
3.进入解压缩的`nebula-dashboard`文件夹内,修改配置文件`config.yaml`。 | ||
配置文件内主要包含 4 种依赖服务的配置和集群的配置。依赖服务的说明如下。 | ||
|
||
|服务名称|默认端口号|说明| | ||
|:---|:---|:---| | ||
|nebula-http-gateway | 8090| 为集群服务提供 HTTP 接口,执行 nGQL 语句与 NebulaGraph 数据库进行交互。| | ||
|nebula-stats-exporter | 9200| 收集集群的性能指标,包括服务 IP 地址、版本和监控指标(例如查询数量、查询延迟、心跳延迟 等)。| | ||
|node-exporter | 9100| 收集集群中机器的资源信息,包括 CPU、内存、负载、磁盘和流量。| | ||
|prometheus | 9090| 存储监控数据的时间序列数据库。| | ||
|
||
配置文件说明如下。 | ||
|
||
```yaml | ||
port: 7003 # Web 服务端口。 | ||
gateway: | ||
ip: hostIP # 部署 Dashboard 的机器 IP。 | ||
port: 8090 | ||
https: false # 是否为 HTTPS 端口。 | ||
runmode: dev # 程序运行模式,包括 dev、test、prod。一般用于区分不同运行环境。 | ||
stats-exporter: | ||
ip: hostIP # 部署 Dashboard 的机器 IP。 | ||
nebulaPort: 9200 | ||
https: false # 是否为 HTTPS 端口。 | ||
node-exporter: | ||
- ip: nebulaHostIP_1 # 部署 NebulaGraph 的机器 IP。 | ||
port: 9100 | ||
https: false # 是否为 HTTPS 端口。 | ||
# - ip: nebulaHostIP_2 | ||
# port: 9100 | ||
# https: false | ||
prometheus: | ||
ip: hostIP # 部署 Dashboard 的机器 IP。 | ||
prometheusPort: 9090 | ||
https: false # 是否为 HTTPS 端口。 | ||
scrape_interval: 5s # 收集监控数据的间隔时间。默认为 1 分钟。 | ||
evaluation_interval: 5s # 告警规则扫描时间间隔。默认为 1 分钟。 | ||
# 集群节点信息 | ||
nebula-cluster: | ||
name: 'default' # 集群名称 | ||
metad: | ||
- name: metad0 | ||
endpointIP: nebulaMetadIP # 部署 Meta 服务的机器 IP。 | ||
port: 9559 | ||
endpointPort: 19559 | ||
# - name: metad1 | ||
# endpointIP: nebulaMetadIP | ||
# port: 9559 | ||
# endpointPort: 19559 | ||
graphd: | ||
- name: graphd0 | ||
endpointIP: nebulaGraphdIP # 部署 Graph 服务的机器 IP。 | ||
port: 9669 | ||
endpointPort: 19669 | ||
# - name: graphd1 | ||
# endpointIP: nebulaGraphdIP | ||
# port: 9669 | ||
# endpointPort: 19669 | ||
storaged: | ||
- name: storaged0 | ||
endpointIP: nebulaStoragedIP # 部署 Storage 服务的机器 IP。 | ||
port: 9779 | ||
endpointPort: 19779 | ||
# - name: storaged1 | ||
# endpointIP: nebulaStoragedIP | ||
# port: 9779 | ||
# endpointPort: 19779 | ||
``` | ||
|
||
1. 执行`sudo ./dashboard.service start all`一键启动服务。 | ||
>`dashboard.service`脚本可以一键管理 Dashboard 服务。支持`start`、`restart`、`stop`、`status`操作。 | ||
2. 执行`sudo ./dashboard.service status all`查看服务启动状态,显示全部服务RUNNING之后,浏览器访问 `http://ip:7003`查看Dashboard页面 | ||
|
||
### 容器部署 | ||
如果使用容器部署 Dashboard,同样是修改配置文件`config.yaml`,修改完成后,执行`docker-compose up -d`即可启动容器。 | ||
|
||
执行`docker-compose stop`命令停止容器部署的 Dashboard。 | ||
|
||
## 管理 Dashboard 服务 | ||
|
||
Dashboard 使用脚本`dashboard.service`管理服务,包括启动、停止和查看。 | ||
|
||
```bash | ||
$ sudo <dashboard_path>/dashboard.service | ||
[-v] [-h] | ||
<start|stop|status> <prometheus|webserver|exporter|gateway|all> | ||
``` | ||
|
||
| 参数 | 说明 | | ||
| :------------------------- | :------------------- | | ||
| `dashboard_path` | Dashboard 安装路径。 | | ||
| `-v` | 显示详细调试信息。 | | ||
| `-h` | 显示帮助信息。 | | ||
| `start` | 启动服务。 | | ||
| `restart` | 重启服务。 | | ||
| `stop` | 停止服务。 | | ||
| `status` | 查看服务状态。 | | ||
| `prometheus` | 管理 prometheus 服务。 | | ||
| `webserver` | 管理 webserver 服务。 | | ||
| `exporter` | 管理 exporter 服务。 | | ||
| `gateway` | 管理 gateway 服务。 | | ||
| `all` | 管理所有服务。 | | ||
|
||
> 查看 Dashboard 版本可以使用命令`./dashboard.service -version`。 |
Oops, something went wrong.