部署Dashboard
Dashboard版本和Nebula Graph的版本对应关系如下。
前提条件
在部署 Dashboard 之前,用户需要确认以下信息:
Nebula Graph 服务已经部署并启动。详细信息参考。
确保以下端口未被使用:
9200
9100
9090
8090
7003
使用的 Linux 发行版为 CentOS ,安装有版本为 v10.12.0 以上的 Node.js,安装有版本为1.13及以上的Go。
根据需要下载 tar 包,建议选择最新版本。
目录结构说明
执行命令tar -xvf nebula-graph-dashboard-1.0.2.x86_64.tar.gz
解压缩,目录nebula-graph-dashboard
内一共有5个子目录,说明如下。
Note
集群中的每个机器都需要部署node-exporter
服务。
在目录node-exporter
内执行如下命令启动服务:
服务启动后,可以在浏览器中输入<IP>:9100
检查服务是否正常启动。
Note
只需要在nebula-graph-dashboard
服务所在机器部署nebula-stats-exporter
服务。
在目录
nebula-stats-exporter
内修改文件config.yaml
,配置所有服务的HTTP端口,示例如下:version: v0.0.4
clusters:
- name: nebula
instances:
- name: metad0
endpointPort: 19559
componentType: metad
- name: metad1
endpointIP: 192.168.8.155
endpointPort: 19559
componentType: metad
endpointIP: 192.168.8.154
endpointPort: 19559
componentType: metad
- name: graphd0
endpointIP: 192.168.8.157
endpointPort: 19669
componentType: graphd
- name: graphd1
endpointIP: 192.168.8.155
endpointPort: 19669
componentType: graphd
- name: graphd2
endpointIP: 192.168.8.154
endpointPort: 19669
componentType: graphd
- name: storaged0
endpointIP: 192.168.8.157
endpointPort: 19779
- name: storaged1
endpointIP: 192.168.8.155
endpointPort: 19779
componentType: storaged
- name: storaged2
endpointIP: 192.168.8.154
endpointPort: 19779
componentType: storaged
执行如下命令启动服务:
$ nohup ./nebula-stats-exporter --listen-address=":9200" --bare-metal --bare-metal-config=./config.yaml &
服务启动后,可以在浏览器中输入检查服务是否正常启动。
Note
只需要在nebula-graph-dashboard
服务所在机器部署prometheus
服务。
在目录
prometheus
内修改文件prometheus.yaml
,配置node-exporter
服务和nebula-stats-exporter
服务的IP地址和端口,示例如下:evaluation_interval:告警规则扫描时间间隔。默认为1分钟。
执行如下命令启动服务:
$ nohup ./prometheus --config.file=./prometheus.yaml &
服务启动后,可以在浏览器中输入<IP>:9090
检查服务是否正常启动。
Note
只需要在nebula-graph-dashboard
服务所在机器部署nebula-http-gateway
服务。
在目录nebula-http-gateway
内执行如下命令启动服务:
$ nohup ./nebula-httpd &
服务启动后,可以在浏览器中输入<IP>:8090
检查服务是否正常启动。
在目录
nebula-graph-dashboard/static/
内修改文件custom.json
,配置Graph服务的IP地址和端口,示例如下:在目录
nebula-graph-dashboard
内执行如下命令启动服务:$ npm run start
服务启动后,可以在浏览器中输入<IP>:7003
检查服务是否正常启动。
停止Dashboard
如果需要停止Dashboard,可以使用kill <pid>
的方式停止,示例如下:
$ kill $(lsof -t -i :9100) # 停止node-exporter服务
$ kill $(lsof -t -i :9200) # 停止nebula-stats-exporter服务
$ kill $(lsof -t -i :9090) # 停止prometheus服务
$ kill $(lsof -t -i :8090) # 停止nebula-http-gateway服务
$ cd nebula-graph-dashboard
$ npm run stop # 停止nebula-graph-dashboard服务