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.
Nebula Graph releases¶
The correspondence between the Dashboard release and the Nebula Graph release is as follows.
Dashboard | Nebula Graph |
---|---|
1.0.1 | 2.x |
Prerequisites¶
Before you deploy Dashboard, you must confirm that:
- The Nebula Graph services are deployed and started. For more information, see Nebula Graph 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.16.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 | Nebula Graph version |
---|---|
nebula-graph-dashboard-1.0.1.x86_64.tar.gz | v2.5.1 |
Service¶
Run tar -xvf 1.0.1.tar.gz
to decompress the installation package. There are 5 services in the nebula-graph-dashboard
. The descriptions are as follows.
Name | Description |
---|---|
node-exporter | Collects the source information of machines in the cluster, including the CPU, memory, load, disk, and network. |
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). |
prometheus | The time series database that stores monitoring data. |
nebula-http-gateway | Provides HTTP ports for cluster services to execute nGQL statements to interact with the Nebula Graph database. |
nebula-graph-dashboard | Provides the Dashboard service. Note that its name is the same as its superordinate. The following nebula-graph-dashboard refers to this service. |
The above five 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-graph-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:version: v0.0.4 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-graph-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-exporter' static_configs: - targets: [ '192.168.xx.100:9200', # The IP address and port of the nebula-stats-exporter service. '192.168.xx.101:9200' ] - job_name: 'node-exporter' static_configs: - targets: [ '192.168.xx.101:9100' # The IP address and port of the node-exporter service. ]
- scrape_interval: The interval for collecting the monitoring data, which is 1 minute by default.
- evaluation_interval: The interval for running alarm 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-graph-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-graph-dashboard
service¶
-
Modify the
custom.json
file innebula-graph-dashboard/static/
to deploy the IP address and port of the Graph Service. The example is as follows:{ "connection": { "ip": "192.168.xx.4", "port": 9669 }, "alias": { "ip:port": "instance1" }, "chartBaseLine": { } } ...
-
To start the service, run the following statement in
nebula-graph-dashboard
:$ npm run start
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
$ cd nebula-graph-dashboard
$ npm run stop # stop the nebula-graph-dashboard service