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 Nebula Dashboard, follow the instructions on the nebula dashboard GitHub page.
Prerequisites¶
Before you deploy Dashboard, you must confirm that:
- The NebulaGraph services are deployed and started. For more information, see NebulaGraph Database Manual.
-
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-1.1.0.x86_64.tar.gz | 2.5.1~3.0.1 |
Service¶
Run tar -xvf nebula-dashboard-1.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 machines 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|
The above four services should be deployed as follows.
Procedure¶
Deploy node-exporter
¶
Note
You need to deploy the node-exporter
service on each machine 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
¶
Note
You only need to deploy the nebula-stats-exporter
service on the machine where the nebula-dashboard
service is installed.
-
Modify the
config.yaml
file innebula-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
-
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
¶
Note
You only need to deploy the prometheus
service on the machine where the nebula-dashboard
service is installed.
-
Modify the
prometheus.yaml
file inprometheus
to deploy the IP addresses and ports of thenode-exporter
service and thenebula-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.
-
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
¶
Note
You only need to deploy the nebula-http-gateway
service on the machine 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.
How to deploy the nebula-dashboard
service¶
-
Modify the
config.json
file innebula-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. nebulaServer: ip: "192.168.8.143" // The IP of the machine where your NebulaGraph is deployed. port: 9669 // The port of the NebulaGraph. ...
-
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¶
You can enter 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