Skip to content

Deploy Dashboard

The deployment of Dashboard involves five services. This topic will describe how to deploy Dashboard in detail. To download and compile the latest source code of NebulaGraph Dashboard, follow the instructions on the NebulaGraph dashboard GitHub page.

Prerequisites

Before you deploy Dashboard, you must confirm that:

  • Before the installation starts, the following ports are not occupied.

    • 9200
    • 9100
    • 9090
    • 8090
    • 7003
  • The Linux distribution is CentOS, installed with Node.js of version above v10.12.0 and Go of version above 1.13.

Download Dashboard

Download the tar package as needed, and it is recommended to select the latest version.

Dashboard package NebulaGraph version
nebula-dashboard-3.1.0.x86_64.tar.gz 2.5.x~3.1.0

Services

Run tar -xvf nebula-dashboard-3.1.0.x86_64.tar.gz to decompress the installation package. There are four services in the nebula-dashboard/vendors. The descriptions are as follows.

Name Description Port
node-exporter Collects the source information of nodes in the cluster, including the CPU, memory, load, disk, and network. 9100
nebula-stats-exporter Collects the performance metrics in the cluster, including the IP addresses, versions, and monitoring metrics (such as the number of queries, the latency of queries, the latency of heartbeats, and so on). 9200
prometheus The time series database that stores monitoring data. 9090
nebula-http-gateway Provides HTTP ports for cluster services to execute nGQL statements to interact with the NebulaGraph database. 8090

Method One - Deploy Dashboard with Docker Compose

You can follow the below steps to deploy Dashboard with Docker Compose.

Prerequisite

Docker has been installed on the node where Dashboard is deployed.

Steps

  1. In the nebula-dashboard directory on each node of your NebulaGraph cluster, go to vendors/node-exporter and run the following command to start node-exporter respectively.

    nohup ./node-exporter --web.listen-address=":9100" &
    

    Note

    You can decide whether to start the node-exporter service on each node in the cluster as needed.

  2. In the nebula-dashboard directory on the node where Dashboard to be installed, deploy Dashboard services.

    1. Modify the config.yaml file in the vendors/nebula-stats-exporter directory to set the ports and IP addresses of all the NebulaGraph services. The example is as follows:

      clusters:
        - name: nebula
          instances:
            - name: metad0
              endpointIP: 192.168.8.157
              endpointPort: 19559
              componentType: metad
            - name: metad1
              endpointIP: 192.168.8.155
              endpointPort: 19559
              componentType: metad
            - name: metad2
              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
              componentType: storaged
            - name: storaged1
              endpointIP: 192.168.8.155
              endpointPort: 19779
              componentType: storaged
            - name: storaged2
              endpointIP: 192.168.8.154
              endpointPort: 19779
              componentType: storaged
      
    2. Modify the prometheus.yaml file in the vendors/prometheus directory to set the port and IP address of the node-exporter service, and the port and hostname of the nebula-stats-exporter service. The example is as follows:

      global:
        scrape_interval:     5s  # The interval for collecting the monitoring data, which is 1 minute by default.
        evaluation_interval: 5s  # The interval for running alert rules, which is 1 minute by default.
      scrape_configs:
        - job_name: 'node-exporter'
          static_configs:
            - targets: [
                '192.168.8.154:9100',
                '192.168.8.155:9100',
                '192.168.8.157:9100'  # The IP address of the node where the node-exporter service is set and the port of the node-exporter service.
              ]
        - job_name: 'nebula-stats-exporter'
          static_configs:
            - targets: [
              'nebula-stats-exporter:9200',  # The hostname of the nebula-stats-exporter container and the port of the nebula-stats-exporter service.
              ]
      
    3. Modify the config.json file in the nebula-dashboard directory to configure the proxy information.

      {
        "port": 7003,
        "proxy":{
          "gateway":{
            "target": "nebula-http-gateway:8090"  # The hostname of the nebula-http-gateway container and the port of the nebula-http-gateway service. 
          },
          "prometheus":{
            "target": "prometheus:9090"    # The hostname of the prometheus container and the port of the prometheus service. 
          },
          "graph":{
            "target": "graphd:19669"    # Used to get the running configurations of the Graph service.
          },
          "storage":{
            "target": "graphd:19779"   # Used to get the running configurations of the Storage service.
          }   
        },
        "nebulaServer": {                  # The access information of any Graph service.
          "ip": "192.168.8.131",           # The IP address of the node where the Graph service is deployed.
          "port": 9669                     # The port of the Graph service. 
        }
      }
      
  3. Run the following command in any directory to create a network for all the Dashboard service containers communicating with each other.

    docker network create nebula-net
    
  4. In nebula-dashboard, run the following command to start all the Dashboard services.

    docker-compose -f docker-compose.yaml up -d
    

    For details about the parameter descriptions in docker-compose.yaml, see Service configuration reference.

  5. Run docker ps to view the status of all the services, and then conduct the following performance to check if the services are all started.

    • Enter <IP>:9200 to check the status of the nebula-stats-exporter service.
    • Enter <IP>:9100 to check the status of the node-exporter service.
    • Enter <IP>:9090 to check the status of the prometheus service.
    • Enter <IP>:8090 to check the status of the nebula-http-gateway service.
    • Enter <IP>:7003 to check the status of the dashboard service.

Method Two - Deploy Dashboard services one by one

Deploy node-exporter

Caution

You need to deploy the node-exporter service on each node in the cluster.

To start the service, run the following statement in node-exporter:

$ nohup ./node-exporter --web.listen-address=":9100" &

After the service is started, you can enter <IP>:9100 in the browser to check whether the service is started normally.

Deploy nebula-stats-exporter

Caution

You only need to deploy the nebula-stats-exporter service on the node where the nebula-dashboard service is installed.

  1. Modify the config.yaml file in nebula-stats-exporter to deploy the HTTP ports of all the services. The example is as follows:

    clusters:
      - name: nebula
        instances:
          - name: metad0
            endpointIP: 192.168.8.157
            endpointPort: 19559
            componentType: metad
          - name: metad1
            endpointIP: 192.168.8.155
            endpointPort: 19559
            componentType: metad
          - name: metad2
            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
            componentType: storaged
          - name: storaged1
            endpointIP: 192.168.8.155
            endpointPort: 19779
            componentType: storaged
          - name: storaged2
            endpointIP: 192.168.8.154
            endpointPort: 19779
            componentType: storaged
    
  2. Run the following statement to start the service:

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

After the service is started, you can enter <IP>:9200 in the browser to check whether the service is started normally.

Deploy prometheus

Caution

You only need to deploy the prometheus service on the node where the nebula-dashboard service is installed.

  1. Modify the prometheus.yaml file in prometheus to deploy the IP addresses and ports of the node-exporter service and the nebula-stats-exporter. The example is as follows:

    global:
      scrape_interval:     5s
      evaluation_interval: 5s
    scrape_configs:
      - job_name: 'nebula-stats-exporter'
        static_configs:
          - targets: [
              '192.168.xx.100:9200',  # IP address and port of nebula-stats-exporter.
            ]
      - job_name: 'node-exporter'
        static_configs:
          - targets: [
              '192.168.xx.100:9100',  # IP address and port of node-exporter.
              '192.168.xx.101:9100'
            ]
    
    • scrape_interval: The interval for collecting the monitoring data, which is 1 minute by default.
    • evaluation_interval: The interval for running alert rules, which is 1 minute by default.
  2. Run the following statement to start the service.

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

After the service is started, you can enter <IP>:9090 in the browser to check whether the service is started normally.

Deploy nebula-http-gateway

Caution

You only need to deploy the nebula-http-gateway service on the node where the nebula-dashboard service is installed.

To start the service, run the following statement in nebula-http-gateway:

$ nohup ./nebula-httpd &

After the service is started, you can enter <IP>:8090 in the browser to check whether the service is started normally.

Deploy nebula-dashboard

  1. Modify the config.json file in nebula-dashboard/ to deploy the IP address and port of the Graph Service and Proxy. The example is as follows:

      port: 7003
      proxy:
        gateway:
          target: "127.0.0.1:8090"  // The IP address and port of the gateway service.
        prometheus:
          target: "127.0.0.1:9090"  // The IP address and port of the prometheus service.
        graph:
          target: "127.0.0.1:19669"    // Used to get the running configurations of the Graph service.
        storage:
          target: "127.0.0.1:19779"   // Used to get the running configurations of the Storage service. 
        nebulaServer:
          ip: "192.168.8.143"  // The IP address of any Graph service.
          port: 9669 // The port of the NebulaGraph.
      ...
    
  2. To start the service, run the following statement in nebula-dashboard:

    $ nohup ./dashboard &
    

After the service is started, you can enter <IP>:7003 in the browser to check whether the service is started normally.

Stop Dashboard

  • If your Dashboard is started with Docker Compose, run docker-compose stop.
  • If your Dashboard is started by deploying services one by one, run kill <pid> to stop Dashboard. The examples are as follows:

    $ kill $(lsof -t -i :9100) # stop the node-exporter service
    $ kill $(lsof -t -i :9200) # stop the nebula-stats-exporter service
    $ kill $(lsof -t -i :9090) # stop the prometheus service
    $ kill $(lsof -t -i :8090) # stop the nebula-http-gateway service
    $ kill $(lsof -t -i :7003) # stop dashboard service
    

Next to do

Connect to Dashboard


Last update: February 1, 2023