部署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服务。

    1. 在目录nebula-stats-exporter内修改文件config.yaml,配置所有服务的HTTP端口,示例如下:

      1. version: v0.0.4
      2. clusters:
      3. - name: nebula
      4. instances:
      5. - name: metad0
      6. endpointPort: 19559
      7. componentType: metad
      8. - name: metad1
      9. endpointIP: 192.168.8.155
      10. endpointPort: 19559
      11. componentType: metad
      12. endpointIP: 192.168.8.154
      13. endpointPort: 19559
      14. componentType: metad
      15. - name: graphd0
      16. endpointIP: 192.168.8.157
      17. endpointPort: 19669
      18. componentType: graphd
      19. - name: graphd1
      20. endpointIP: 192.168.8.155
      21. endpointPort: 19669
      22. componentType: graphd
      23. - name: graphd2
      24. endpointIP: 192.168.8.154
      25. endpointPort: 19669
      26. componentType: graphd
      27. - name: storaged0
      28. endpointIP: 192.168.8.157
      29. endpointPort: 19779
      30. - name: storaged1
      31. endpointIP: 192.168.8.155
      32. endpointPort: 19779
      33. componentType: storaged
      34. - name: storaged2
      35. endpointIP: 192.168.8.154
      36. endpointPort: 19779
      37. componentType: storaged
    2. 执行如下命令启动服务:

      1. $ nohup ./nebula-stats-exporter --listen-address=":9200" --bare-metal --bare-metal-config=./config.yaml &

    服务启动后,可以在浏览器中输入检查服务是否正常启动。

    Note

    只需要在nebula-graph-dashboard服务所在机器部署prometheus服务。

    1. 在目录prometheus内修改文件prometheus.yaml,配置node-exporter服务和nebula-stats-exporter服务的IP地址和端口,示例如下:

      • evaluation_interval:告警规则扫描时间间隔。默认为1分钟。

    2. 执行如下命令启动服务:

      1. $ nohup ./prometheus --config.file=./prometheus.yaml &

    服务启动后,可以在浏览器中输入<IP>:9090检查服务是否正常启动。

    Note

    只需要在nebula-graph-dashboard服务所在机器部署nebula-http-gateway服务。

    在目录nebula-http-gateway内执行如下命令启动服务:

    1. $ nohup ./nebula-httpd &

    服务启动后,可以在浏览器中输入<IP>:8090检查服务是否正常启动。

    1. 在目录nebula-graph-dashboard/static/内修改文件custom.json,配置Graph服务的IP地址和端口,示例如下:

    2. 在目录nebula-graph-dashboard内执行如下命令启动服务:

      1. $ npm run start

    服务启动后,可以在浏览器中输入<IP>:7003检查服务是否正常启动。

    停止Dashboard

    如果需要停止Dashboard,可以使用kill <pid>的方式停止,示例如下:

    1. $ kill $(lsof -t -i :9100) # 停止node-exporter服务
    2. $ kill $(lsof -t -i :9200) # 停止nebula-stats-exporter服务
    3. $ kill $(lsof -t -i :9090) # 停止prometheus服务
    4. $ kill $(lsof -t -i :8090) # 停止nebula-http-gateway服务
    5. $ cd nebula-graph-dashboard
    6. $ npm run stop # 停止nebula-graph-dashboard服务