diff --git a/docs-2.0/nebula-dashboard/2.deploy-dashboard.md b/docs-2.0/nebula-dashboard/2.deploy-dashboard.md index 7b029dc8053..26693be6015 100644 --- a/docs-2.0/nebula-dashboard/2.deploy-dashboard.md +++ b/docs-2.0/nebula-dashboard/2.deploy-dashboard.md @@ -30,26 +30,24 @@ Download the tar package as needed, and it is recommended to select the latest v | :----- | :----- | | [nebula-dashboard-{{ dashboard.release }}.x86_64.tar.gz](https://oss-cdn.nebula-graph.com.cn/nebula-graph-dashboard/{{ dashboard.release }}/nebula-dashboard-{{ dashboard.release }}.x86_64.tar.gz) | 2.5.x~3.1.0 | -## Service +## Services Run `tar -xvf nebula-dashboard-{{ dashboard.release }}.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| +|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 Nebula Graph database. |8090| -The above four services should be deployed as follows. - -## Procedure +## Method One - Deploy Dashboard services one by one ### Deploy `node-exporter` -!!! note +!!! Caution - You need to deploy the `node-exporter` service on each machine in the cluster. + 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`: @@ -61,9 +59,9 @@ After the service is started, you can enter `:9100` in the browser to check ### Deploy `nebula-stats-exporter` -!!! note +!!! Caution - You only need to deploy the `nebula-stats-exporter` service on the machine where the `nebula-dashboard` service is installed. + 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: @@ -119,9 +117,9 @@ After the service is started, you can enter `:9200` in the browser to check ### Deploy `prometheus` -!!! note +!!! Caution - You only need to deploy the `prometheus` service on the machine where the `nebula-dashboard` service is installed. + 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: @@ -157,9 +155,9 @@ After the service is started, you can enter `:9090` in the browser to check ### Deploy `nebula-http-gateway` -!!! note +!!! Caution - You only need to deploy the `nebula-http-gateway` service on the machine where the `nebula-dashboard` service is installed. + 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`: @@ -169,7 +167,7 @@ $ nohup ./nebula-httpd & After the service is started, you can enter `:8090` in the browser to check whether the service is started normally. -### How to deploy the `nebula-dashboard` service +### 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: @@ -194,14 +192,151 @@ After the service is started, you can enter `:8090` in the browser to check After the service is started, you can enter `:7003` in the browser to check whether the service is started normally. +## Method Two - 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 Nebula Graph cluster, go to `vendors/node-exporter` and run the following command to start `node-exporter` respectively. + + ```bash + 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 Nebula Graph services. The example is as follows: + + ```yaml + 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: + + ```bash + 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. + + ```json + { + "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. + } + }, + "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. + + ```bash + docker network create nebula-net + ``` + +4. In `nebula-dashboard`, run the following command to start all the Dashboard services. + + ```bash + docker-compose -f docker-compose.yaml up -d + ``` + + For details about the parameter descriptions in `docker-compose.yaml`, see [Service configuration reference](https://docs.docker.com/compose/compose-file/compose-file-v3/#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 `:9200` to check the status of the `nebula-stats-exporter` service. + - Enter `:9100` to check the status of the `node-exporter` service. + - Enter `:9090` to check the status of the `prometheus` service. + - Enter `:8090` to check the status of the `nebula-http-gateway` service. + - Enter `:7003` to check the status of the `dashboard` service. + ## Stop Dashboard -You can enter `kill ` to stop Dashboard. The examples are as follows: +- If your Dashboard is started by deploying services one by one, run `kill ` to stop Dashboard. The examples are as follows: -```bash -$ 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 -``` + ```bash + $ 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 + ``` + +- If your Dashboard is started with Docker Compose, run `docker-compose stop`. + +## Next to do + +[Connect to Dashboard](3.connect-dashboard.md)