Skip to content

Commit

Permalink
en: refactor monitoring docs (#1020)
Browse files Browse the repository at this point in the history
* en: refactor monitoring docs

Signed-off-by: Ran <huangran@pingcap.com>

* add aliases

Signed-off-by: Ran <huangran@pingcap.com>

* fix deadlink

Signed-off-by: Ran <huangran@pingcap.com>

* Apply suggestions from code review

Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>

Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
  • Loading branch information
ran-huang and TomShawn authored Jan 8, 2021
1 parent 4e564af commit c169148
Show file tree
Hide file tree
Showing 9 changed files with 294 additions and 360 deletions.
4 changes: 2 additions & 2 deletions en/TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
- [Deploy TiDB Binlog](deploy-tidb-binlog.md)
- [Deploy TiDB Enterprise Edition](deploy-tidb-enterprise-edition.md)
+ Deploy Monitoring
- [Monitor Kubernetes and TiDB Cluster](monitor-a-tidb-cluster.md)
- [Monitor TiDB Cluster Using TidbMonitor](monitor-using-tidbmonitor.md)
- [Deploy Monitoring and Alerts for TiDB](monitor-a-tidb-cluster.md)
- [Access TiDB Dashboard](access-dashboard.md)
+ Secure
- [Enable TLS for the MySQL Client](enable-tls-for-mysql-client.md)
Expand Down Expand Up @@ -90,6 +89,7 @@
- [Configure tidb-cluster Chart](tidb-cluster-chart-config.md)
- [Configure tidb-backup Chart](configure-backup.md)
- [Log Collection](logs-collection.md)
- [Monitoring and Alert on Kubernetes](monitor-kubernetes.md)
+ [TiDB Operator Roadmap](roadmap.md)
+ Release Notes
+ v1.1
Expand Down
2 changes: 1 addition & 1 deletion en/access-dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,4 @@ Due to the special environment of Kubernetes, some features of TiDB Dashboard ar

- The log search feature is unavailable. If you need to view the log of a component, execute `kubectl logs ${pod_name} -n {namespace}`. You can also view logs using the log service of the Kubernetes cluster.

- In **Cluster Info** -> **Hosts**, the **Disk Usage** cannot display correctly. You can view the disk usage of each component by viewing the component dashboards in [the TidbMonitor dashboard](monitor-a-tidb-cluster.md#access-the-grafana-monitoring-dashboard). You can also view the disk usage of Kubernetes nodes by deploying a [Kubernetes host monitoring system](monitor-a-tidb-cluster.md#monitor-kubernetes-components).
- In **Cluster Info** -> **Hosts**, the **Disk Usage** cannot display correctly. You can view the disk usage of each component by viewing the component dashboards in [the TidbMonitor dashboard](monitor-a-tidb-cluster.md#access-the-grafana-monitoring-dashboard). You can also view the disk usage of Kubernetes nodes by deploying a [Kubernetes host monitoring system](monitor-kubernetes.md#monitor-kubernetes-components).
2 changes: 1 addition & 1 deletion en/enable-tidb-cluster-auto-scaling.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ spec:

The TiDB component can be configured using `spec.tidb`. Currently, the auto-scaling API of TiDB is the same as that of TiKV.

In a `TidbClusterAutoScaler` object, the `cluster` attribute specifies the TiDB clusters to be auto-scaled. These clusters are marked by `name` and `namespace`. You need to provide the metrics collection and query service to `TidbClusterAutoScaler` because it captures resource usage through the metrics collection component. The `monitor` attribute refers to the `TidbMonitor` object. For more information, see [Monitor TiDB Clusters using TidbMonitor](monitor-using-tidbmonitor.md).
In a `TidbClusterAutoScaler` object, the `cluster` attribute specifies the TiDB clusters to be auto-scaled. These clusters are marked by `name` and `namespace`. You need to provide the metrics collection and query service to `TidbClusterAutoScaler` because it captures resource usage through the metrics collection component. The `monitor` attribute refers to the `TidbMonitor` object. For more information, see [Deploy Monitoring and Alerts for a TiDB Cluster](monitor-a-tidb-cluster.md).

For the external `Prometheus` other than `TidbMonitor`, you can fill in the Host by configuring `spec.metricsUrl` to specify the monitoring metrics collection service for the TiDB cluster. If you deploy the monitoring of the TiDB cluster using `Helm`, take the following steps to specify `spec.metricsUrl`.

Expand Down
2 changes: 1 addition & 1 deletion en/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ You can access Grafana dashboard at <http://localhost:3000> on the host where yo
The default username and password in Grafana are both `admin`.
For more information about monitoring the TiDB cluster in TiDB Operator, refer to [Monitor a TiDB Cluster Using TidbMonitor](monitor-using-tidbmonitor.md).
For more information about monitoring the TiDB cluster in TiDB Operator, refer to [Deploy Monitoring and Alerts for a TiDB Cluster](monitor-a-tidb-cluster.md).
## Upgrade a TiDB cluster
Expand Down
286 changes: 236 additions & 50 deletions en/monitor-a-tidb-cluster.md

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions en/monitor-kubernetes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: Monitoring and Alerts on Kubernetes
summary: Learn the monitoring and alerts on Kubernetes.
---

# Monitoring and Alerts on Kubernetes

This document describes how to monitor a Kubernetes cluster and configure alerts for the cluster.

## Monitor the Kubernetes cluster

The TiDB monitoring system deployed with the cluster only focuses on the operation of the TiDB components themselves, and does not include the monitoring of container resources, hosts, Kubernetes components, or TiDB Operator. To monitor these components or resources, you need to deploy a monitoring system across the entire Kubernetes cluster.

### Monitor the host

Monitoring the host and its resources works in the same way as monitoring physical resources of a traditional server.

If you already have a monitoring system for your physical server in your existing infrastructure, you only need to add the host that holds Kubernetes to the existing monitoring system by conventional means; if there is no monitoring system available, or if you want to deploy a separate monitoring system to monitor the host that holds Kubernetes, then you can use any monitoring system that you are familiar with.

The newly deployed monitoring system can run on a separate server, directly on the host that holds Kubernetes, or in a Kubernetes cluster. Different deployment methods might have differences in the deployment configuration and resource utilization, but there are no major differences in usage.

Some common open source monitoring systems that can be used to monitor server resources are:

- [CollectD](https://collectd.org/)
- [Nagios](https://www.nagios.org/)
- [Prometheus](http://prometheus.io/) & [node_exporter](https://github.com/prometheus/node_exporter)
- [Zabbix](https://www.zabbix.com/)

Some cloud service providers or specialized performance monitoring service providers also have their own free or chargeable monitoring solutions that you can choose from.

It is recommended to deploy a host monitoring system in the Kubernetes cluster via [Prometheus Operator](https://github.com/coreos/prometheus-operator) based on [Node Exporter](https://github.com/prometheus/node_exporter) and Prometheus. This solution can also be compatible with and used for monitoring the Kubernetes' own components.

### Monitor Kubernetes components

For monitoring Kubernetes components, you can refer to the solutions provided in the [Kubernetes official documentation](https://kubernetes.io/docs/tasks/debug-application-cluster/resource-usage-monitoring/) or use other Kubernetes-compatible monitoring systems.

Some cloud service providers may provide their own solutions for monitoring Kubernetes components. Some specialized performance monitoring service providers have their own Kubernetes integration solutions that you can choose from.

TiDB Operator is actually a container running in Kubernetes. For this reason, you can monitor TiDB Operator by choosing any monitoring system that can monitor the status and resources of a Kubernetes container without deploying additional monitoring components.

It is recommended to deploy a host monitoring system via [Prometheus Operator](https://github.com/coreos/prometheus-operator) based on [Node Exporter](https://github.com/prometheus/node_exporter) and Prometheus. This solution can also be compatible with and used for monitoring host resources.

### Alerts in Kubernetes

If you deploy a monitoring system for Kubernetes hosts and services using Prometheus Operator, some alert rules are configured by default, and an AlertManager service is deployed. For details, see [kube-prometheus](https://github.com/coreos/kube-prometheus).

If you monitor Kubernetes hosts and services by using other tools or services, you can consult the corresponding information provided by the tool or service provider.
301 changes: 0 additions & 301 deletions en/monitor-using-tidbmonitor.md

This file was deleted.

Loading

0 comments on commit c169148

Please sign in to comment.