From 8762c07d4a6eb35b470a5dd6b41260357a8721e9 Mon Sep 17 00:00:00 2001 From: "abby.huang" <78209557+abby-cyber@users.noreply.github.com> Date: Tue, 19 Jul 2022 11:16:06 +0800 Subject: [PATCH] Update 2.deploy-dashboard.md (#1522) --- .../nebula-dashboard/2.deploy-dashboard.md | 281 +++++++++--------- 1 file changed, 141 insertions(+), 140 deletions(-) diff --git a/docs-2.0/nebula-dashboard/2.deploy-dashboard.md b/docs-2.0/nebula-dashboard/2.deploy-dashboard.md index 6a6b767b521..595edf1fcb3 100644 --- a/docs-2.0/nebula-dashboard/2.deploy-dashboard.md +++ b/docs-2.0/nebula-dashboard/2.deploy-dashboard.md @@ -41,7 +41,145 @@ Run `tar -xvf nebula-dashboard-{{ dashboard.release }}.x86_64.tar.gz` to decompr |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| -## Method One - Deploy Dashboard services one by one +## 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 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. + }, + "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. + + ```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. + + +## Method Two - Deploy Dashboard services one by one ### Deploy `node-exporter` @@ -196,145 +334,10 @@ 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. - }, - "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. - - ```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 +- 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 ` to stop Dashboard. The examples are as follows: ```bash @@ -345,8 +348,6 @@ Docker has been installed on the node where Dashboard is deployed. $ 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)