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

Update the content related to dashboard deployment #2086

Merged
merged 3 commits into from
May 12, 2023
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
138 changes: 81 additions & 57 deletions docs-2.0/nebula-dashboard-ent/2.deploy-connect-dashboard-ent.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ Before deploying Dashboard Enterprise Edition, you must do a check of these:
| Port | Description |
| ---- | ---- |
| 7005 | The port through which Dashboard Enterprise Edition provides the web service. |
| 9090 | The port of the prometheus service. |
| 9091 | The port of the prometheus service. |
| 9200 | The port of the nebula-stats-exporter service. |
| 9093 | The port of the Alertmanager service, used to receive Prometheus alerts and then send them to Dashboard.|
| 9100 | The port of the node-exporter service. The node-exporter is aumatically deployed on the target machine after a cluster is created or imported. It is used to collect the source information of machines in the cluster, including the CPU, memory, load, disk, and network. |
| 9100 | The port of the node-exporter service. The node-exporter is automatically deployed on the target machine after a cluster is created or imported. It is used to collect the source information of machines in the cluster, including the CPU, memory, load, disk, and network. |

- The [license](11.dashboard-ent-license.md) is ready.

Expand Down Expand Up @@ -178,21 +178,21 @@ Before deploying Dashboard Enterprise Edition, you must do a check of these:
cp -r nebula.license /usr/local/nebula-dashboard-ent
```

4. (Optional) Run the following commands to view the status of and start all the services.
4. Run the following commands to view the status of and start all the services.

```
sudo systemctl list-dependencies nebula-dashboard.target # View the status of all the services.
sudo systemctl start nebula-dashboard.target # Start all the services.
```

You can also view, start, and stop a single service. For example:
You can also view, start, and stop a single service.

```
sudo systemctl {status|stop|start} {nbd-prometheus.service|nbd-alert-manager.service|nbd-stats-exporter.service|nbd-webserver.service}
```


5. (Optional) To configure recipients of cluster alert notifications and to configure LDAP accounts, run `vim /usr/local/nebula-dashboard-ent/etc/config.yaml` and add the following settings.
5. To configure recipients of cluster alert notifications and to configure LDAP accounts, run `vim /usr/local/nebula-dashboard-ent/etc/config.yaml` and add the following settings.

```
# Information of the sender's Email used to invite LDAP accounts.
Expand Down Expand Up @@ -261,20 +261,20 @@ sudo rpm -e <package_name>
cp -r nebula.license /usr/local/nebula-dashboard-ent
```

4. (Optional) Run the following commands to view the status of and start all the services.
4. Run the following commands to view the status of and start all the services.

```
sudo systemctl list-dependencies nebula-dashboard.target # View the status of all the services.
sudo systemctl start nebula-dashboard.target # Start all the services.
```

You can also view, start, and stop a single service. For example:
You can also view, start, and stop a single service.

```
sudo systemctl {status|stop|start} {nbd-prometheus.service|nbd-alert-manager.service|nbd-stats-exporter.service|nbd-webserver.service}
```

5. (Optional) To configure the sender's email address used to invite LDAP and OAuth2.0 accounts and configure the duration for storing alert messages, run `vim /usr/local/nebula-dashboard-ent/etc/config.yaml` and add the following settings.
5. To configure the sender's email address used to invite LDAP and OAuth2.0 accounts and configure the duration for storing alert messages, run `vim /usr/local/nebula-dashboard-ent/etc/config.yaml` and add the following settings.

```
# Information of the sender's Email used to invite LDAP accounts.
Expand All @@ -299,68 +299,92 @@ sudo dpkg -r <package_name>

## Manage services in Dashboard

You can use the `dashboard.service` script to start, restart, stop, and check the Dashboard services.
The following section presents two methods for managing the Dashboard service. It's important to note that these methods are not interchangeable. For instance, you can't start the service using the `dashboard.service` script and then use the `systemctl` command to stop it.

```bash
sudo <dashboard_path>/scripts/dashboard.service
[-v] [-h]
<start|restart|stop|status> <prometheus|webserver|exporter|gateway|all>
```
- You can use the `dashboard.service` script to start, restart, stop, and check the Dashboard services.

| Parameter | Description |
| :------------------------- | :------------------- |
| `dashboard_path` | Dashboard installation path. |
| `-v` | Display detailed debugging information. |
| `-h` | Display help information. |
| `start` | Start the target services. |
| `restart` | Restart the target services. |
| `stop` | Stop the target services. |
| `status` | Check the status of the target services. |
| `prometheus` | Set the prometheus Service as the target service. |
| `webserver` | Set the webserver Service as the target service. |
| `exporter` | Set the exporter Service as the target service. |
| `gateway` | Set the gateway Service as the target service. |
| `all` | Set all the Dashboard services as the target services. |
```bash
sudo <dashboard_path>/scripts/dashboard.service
[-v] [-h] [-version]
<start|restart|stop|status> <prometheus|webserver|exporter|gateway|all>
```

!!! note
| Parameter | Description |
| :------------------------- | :------------------- |
| `dashboard_path` | Dashboard installation path. |
| `-v` | Display detailed debugging information. |
| `-h` | Display help information. |
| `-version` | Display the Dashboard version. |
| `start` | Start the target services. |
| `restart` | Restart the target services. |
| `stop` | Stop the target services. |
| `status` | Check the status of the target services. |
| `prometheus` | Set the prometheus Service as the target service. |
| `webserver` | Set the webserver Service as the target service. |
| `exporter` | Set the exporter Service as the target service. |
| `gateway` | Set the gateway Service as the target service. |
| `all` | Set all the Dashboard services as the target services. |

For example, if Dashboard is installed in the current directory, you can manage its services using the following commands:

To view the Dashboard version, run the command `./dashboard.service -version`.
```bash
sudo /dashboard/scripts/dashboard.service start all # Start Dashboard.
sudo /dashboard/scripts/dashboard.service stop all # Stop Dashboard.
sudo /dashboard/scripts/dashboard.service status all # Check Dashboard status.
sudo /dashboard/scripts/dashboard.service restart all # Restart Dashboard.
```

### Examples
- If you installed Dashboard using RPM or DEB packages, you can manage the service using systemd. You can start, view, restart and stop the service using the `systemctl` command.

Dashboard is installed in the current directory, and you can use the following commands to manage services.
```bash
sudo systemctl start nebula-dashboard.target # Start all service.
sudo systemctl status nebula-dashboard.target # Check Dashboard status.
sudo systemctl restart <nbd-prometheus.service|nbd-alert-manager.service|nbd-stats-exporter.service|nbd-webserver.service> # Restart service respectively.
sudo systemctl stop <nbd-prometheus.service|nbd-alert-manager.service|nbd-stats-exporter.service|nbd-webserver.service> # Stop service respectively.
```

For example, to stop the Prometheus service, run the following command:

```bash
sudo /dashboard/scripts/dashboard.service start all #Start Dashboard.
sudo /dashboard/scripts/dashboard.service stop all #Stop Dashboard.
sudo /dashboard/scripts/dashboard.service status all #Check Dashboard status.
sudo /dashboard/scripts/dashboard.service restart all #Restart Dashboard.
```
```bash
sudo systemctl stop nbd-prometheus.service
```

## View logs

You can view the Dashboard Enterprise Edition logs in the `logs` path.
- Users who manage services using `dashboard.service` can view the Dashboard Enterprise Edition logs in the `logs` directory.

For example:

For example:
```
cat logs/prometheus.log
```

```
cat logs/prometheus.log
```
The descriptions of the log files are as follows.

|Log file| Description |
|:--|:--|
|`alertmanager.log`| Alertmanager service log. |
|`nebula-stats-exporter.log`| nebula-stats-exporter service log. |
|`prometheus.log`| Prometheus service log. |
|`br`| Backup and restore service log. |
|`webserver.log`| Dashboard service log. </br>It takes effect only when the `Log.Mode` in the Dashboard configuration is `console`. |
|`access.log`| Access log. </br>It takes effect only when the `Log.Mode` in the Dashboard configuration is `file`. |
|`error.log`| Error log. </br>It takes effect only when the `Log.Mode` in the Dashboard configuration is `file`. |
|`severe.log`| Severe log. </br>It takes effect only when the `Log.Mode` in the Dashboard configuration is `file`. |
|`slow.log`| Slow log. </br>It takes effect only when the `Log.Mode` in the Dashboard configuration is `file`. |
|`stat.log`| Statistic log. </br>It takes effect only when the `Log.Mode` in the Dashboard configuration is `file`. |

- Users managing services with systemd can access the logs for each Dashboard Enterprise Edition service through `journalctl`.

The descriptions of the log files are as follows.

|Log file| Description |
|:--|:--|
|`alertmanager.log`| Alertmanager service log. |
|`nebula-stats-exporter.log`| nebula-stats-exporter service log. |
|`prometheus.log`| Prometheus service log. |
|`br`| Backup and restore service log. |
|`webserver.log`| Dashboard service log. </br>It takes effect only when the `Log.Mode` in the Dashboard configuration is `console`. |
|`access.log`| Access log. </br>It takes effect only when the `Log.Mode` in the Dashboard configuration is `file`. |
|`error.log`| Error log. </br>It takes effect only when the `Log.Mode` in the Dashboard configuration is `file`. |
|`severe.log`| Severe log. </br>It takes effect only when the `Log.Mode` in the Dashboard configuration is `file`. |
|`slow.log`| Slow log. </br>It takes effect only when the `Log.Mode` in the Dashboard configuration is `file`. |
|`stat.log`| Statistic log. </br>It takes effect only when the `Log.Mode` in the Dashboard configuration is `file`. |
```bash
journalctl -u {nbd-prometheus.service|nbd-alert-manager.service|nbd-stats-exporter.service|nbd-webserver.service} -b
```

For example, to view the logs of the Prometheus service:

```bash
journalctl -u nbd-prometheus.service -b
```

## Next to do

Expand Down