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

deploy dashboard #569

Merged
merged 5 commits into from
Jul 27, 2021
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
195 changes: 195 additions & 0 deletions docs-2.0/nebula-dashboard/deploy-dashboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
# Deploy Dashboard

The deployment of Dashboard involve five services. This topic will describe how to deploy Dashboard in detail.

## Port

The deployment of Dashboard occupies the following ports:

- 9200

- 9100

- 9090

- 8090

- 7003

## Download Dashboard

Download the configuration files for the deployment.

```bash
wget https://oss-cdn.nebula-graph.com.cn/nebula-graph-dashboard/{{dashboard.release}}.tar.gz
```

## Service

Run `tar -xvf {{dashboard.release}}.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 access the prometheus service or 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`:

```bash
$ nohup ./node-exporter --web.listen-address=:9200 &
```

After the service is started, you can enter `<IP>:9200` 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.

1. Modify the `config.yaml` file in `nebula-stats-exporter` to deploy the HTTP ports of all the services. The example is as follows:

```bash
version: v0.0.2
nebulaItems:
- instanceName: metad0
endpointIP: 192.168.xx.1
endpointPort: 19559
componentType: metad
- instanceName: metad1
endpointIP: 192.168.xx.2
endpointPort: 19559
componentType: metad
- instanceName: metad2
endpointIP: 192.168.xx.3
endpointPort: 19559
componentType: metad
- instanceName: graphd0
endpointIP: 192.168.xx.4
endpointPort: 19669
componentType: graphd
- instanceName: storaged0
endpointIP: 192.168.xx.5
endpointPort: 19779
componentType: storaged
- instanceName: storaged1
endpointIP: 192.168.xx.6
endpointPort: 19779
componentType: storaged
- instanceName: storaged2
endpointIP: 192.168.xx.7
endpointPort: 19779
```

2. Run the following statement to start the service:

```bash
$ nohup ./nebula-stats-exporter --bare-metal --bare-metal-config=./config.yaml &
```

After the service is started, you can enter `<IP>:9100` 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.

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:

```bash
global:
scrape_interval: 5s
evaluation_interval: 5s
scrape_configs:
- job_name: 'nebula-exporter'
static_configs:
- targets: [
'192.168.xx.100:9100', # The IP address and port of the nebula-stats-exporter service.
]
- job_name: 'node-exporter'
static_configs:
- targets: [
'192.168.xx.101:9200' # 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.

2. Run the following statement to start the service.

```bash
$ 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`:

```bash
$ 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

1. Modify the `custom.json` file in `nebula-graph-dashboard/static/` to deploy the IP address and port of the Graph Service. The example is as follows:

```bash
{
"connection": {
"ip": "192.168.xx.4",
"port": 9669
},
"alias": {
"ip:port": "instance1"
},
"chartBaseLine": {

}
}
...
```

2. To start the service, run the following statement in `nebula-graph-dashboard`:

```bash
$ 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:

```bash
$ kill $(lsof -t -i :9200) # stop the node-exporter service
$ kill $(lsof -t -i :9100) # 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
```