Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add one new method to deploy dashboard #1451

Merged
merged 5 commits into from
Jul 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 157 additions & 22 deletions docs-2.0/nebula-dashboard/2.deploy-dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:

Expand All @@ -61,9 +59,9 @@ After the service is started, you can enter `<IP>: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:

Expand Down Expand Up @@ -119,9 +117,9 @@ After the service is started, you can enter `<IP>: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:

Expand Down Expand Up @@ -157,9 +155,9 @@ After the service is started, you can enter `<IP>: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`:

Expand All @@ -169,7 +167,7 @@ $ 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
### 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:

Expand All @@ -194,14 +192,151 @@ After the service is started, you can enter `<IP>:8090` in the browser to check

After the service is started, you can enter `<IP>: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.
abby-cyber marked this conversation as resolved.
Show resolved Hide resolved


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.
abby-cyber marked this conversation as resolved.
Show resolved Hide resolved
}
}
```

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 `<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.

## Stop Dashboard

You can enter `kill <pid>` to stop Dashboard. The examples are as follows:
- If your Dashboard is started by deploying services one by one, run `kill <pid>` 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)