Eco integrated Istio on ACK (1): Integrated memory TSDB booster Observability

Ali cloud container services Kubernetes (referred to as ACK) to support the deployment of a key Istio, can refer to the documentation deployed using Isito on ACK. Istio on ACK provides rich monitoring capabilities for grid service collects telemetry data, which is responsible for providing Istio Mixer policy control components and telemetry collection. Prometheus is one of the monitored using monitoring capabilities Istio provided. Prometheus is an open source monitoring and alarm systems, less reliance Prometheus, full-featured, widely used for surveillance system Kubernetes cluster. Istio since the beginning of the default version 0.8 will be included Prometheus, Mixer Adapter for support to the monitoring facilities of Prometheus. Users can see the operating status and Prometheus addresses by querying service or pod. You can also view the monitoring data through clear and concise Prometheus UI interface.

Prometheus storage challenges and solutions

Prometheus local storage design can reduce the complexity of their operation and maintenance and management to meet the needs of most users monitor size, but also means that the local store persistent data Prometheus can not, can not store large amounts of historical data, but also not flexible expansion . Prometheus itself does not attempt to solve the above problems, but by defining a set of remote storage adapter standard interface, so that users can decide which set of standard interfaces based on the monitoring sample Promthues of data storage to third-party remote storage services to solve local storage problems caused.

TSDB for Prometheus is a high performance, low cost, stable and reliable online sequence database service, built by Prometheus realized the remote storage adapter, as Promtheus natural native support for third-party online remote storage services.

Compared to other third-party remote storage purposes, TSDB for Prometheus has a high degree of integration, while supporting literacy and other advantages.

  • High degree of integration
    mainstream practice Prometheus docking third-party storage system is to achieve an independent third-party storage to remote storage adapter system, the adapter requires a separate deployment and operation and maintenance, remote storage adapter Separately deployed there and read single point of failure write performance issues.

TSDB for Prometheus built-in server Prometheus remote storage adapter to achieve, just in the configuration file prometheus.yaml Prometheus's modified remote read and write configuration, you can directly read and write native support for Prometheus TSDB, high degree of integration, no additional deployment alone adapter, which greatly reduces the risk of failure and operation and maintenance costs of a single point adapter.

  • Supports reading and writing
    of the current third-party support only remote storage Prometheus will monitor the sample data is written, does not support reading. For example OpenTSDB, Graphite and Elasticsearch and other third-party storage, adapter Prometheus community to provide support only write mode, read mode is not supported. The TSDB for Prometheus supports both reading and writing. To learn more the degree of support for third-party storage systems to read and write Prometheus, see Remote Endpoints and Storage .

TSDB for Prometheus

Temporal sequence database (Time Series & Spatial Temporal Database, TSDb of abbreviation) is a high performance, low cost, reliable timing temporal line database services, provide efficient reading and writing, high compression ratio is stored, and the polymerization time series data interpolation computing services . TSDB second stage includes the sequential data writing one million performance, low-cost storage to provide high compression ratio, pre-downsampling, interpolation calculation multidimensional polymerization, the results of visual query functions.

TSDB for Prometheus is a high performance cloud Ali timing spatio-temporal database TSDB to provide Prometheus, low-cost, reliable online remote storage service that offers the ability to:

  • Provide efficient reading and writing, high compression storage capacity than can be seamlessly integrated Prometheus, Prometheus protocol natively support docked to remote storage TSDB.
  • To solve the problem in the past need to develop remote storage adapter for additional Prometheus, greatly reducing the cost of Prometheus remote storage docking TSDB.
  • TSDB for the greatest degree of Prometheus Prometheus is PromQL compatible query syntax, thus reducing the user development, migration and maintenance costs.
  • Problem solving Prometheus local stroge not store large amounts of historical data of the scene, and can not be extended.
  • Prometheus achieved through the built-in remote storage adapter, as Promtheus natural native support for third-party online remote storage services.
  • Compared to other third-party remote storage purposes, TSDB for Prometheus has a high degree of integration, while supporting literacy and other advantages.

TSDB for Prometheus can be found using the requirements of a particular use requirements

TSDB examples of different specifications provided by Ali cloud, set different maximum write TPS, TPS avoid excessive lead TSDB examples unavailable protection TSDB instances running. When writing TPS TPS exceed the maximum allowable TSDB example, it will trigger TSDB protection rules limiting example, can cause abnormal write failure. It is necessary to adjust the configuration Prometheus remote_write specifications according TSDB example, to achieve smooth and reliable indicators of the Prometheus collected in the writing TSDB.

About Remote Write configuration, in addition to the official reference Prometheus Remote Write configuration instructions, you can also write reference configuration when Prometheus docking Ali cloud TSDB best practices .

Creating TSDB examples

TSDB create a very simple example, login TSDB console , referring to create an instance of a document can be created.
Examples of obtaining TSDB opened the address, you can refer to the official documentation TSDB Quick Start

Prometheus confirm where the machine can be accessed TSDB instance. Direct access using the http address TSDB instance, if we can get that contains "Welcome to use the TSDB" string representing the Prometheus instance where the machine can access TSDB normal.

TSDB set an example for the public address: ts-xxxxxxxxxxxx.hitsdb.rds.aliyuncs.com:3242, in Istio where Kubernetes cluster of Prometheus enabled, execute the command:
kubectl exec -it -n istio-system $(kubectl get pods -n istio-system -l app=prometheus -o jsonpath='{.items[0].metadata.name}') sh

After entering the container Prometheus, execute the command wget -S ts-xxxxxxxxxxxx.hitsdb.rds.aliyuncs.com:3242, the following results can be obtained:

Connecting to ts-bp1839ak5uf20igcw.hitsdb.rds.aliyuncs.com:3242 (101.37.143.44:3242)
  HTTP/1.1 200 OK
  Content-Type: Content-Type

index.html           100% |*****************************************************************************************|   361   0:00:00 ETA

Then Run cat index.html, the following results can be obtained:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv=content-type content="text/html;charset=utf-8"><title>TSDB</title>
<style><!--
body{font-family:arial,sans-serif;margin-left:2em}A.l:link{color:#6f6f6f}A.u:link{color:green}.fwf{font-family:monospace;white-space:pre-wrap}//--></style><div>Welcome to use the TSDB!</div>

Integrated TSDB to Istio on ACK

The first deployment Istio

Ali cloud container services Kubernetes (referred to as ACK) to support the deployment of a key Istio, can refer to the documentation deploy Isito on ACK.
If this is the first time deployed using Isito, you can follow the steps to deploy a document directly.
Note, check Enable Prometheus metrics log collection option is enabled by default, and check the persistent storage , suggesting the need to provide access to the TSDB address. Fill this has been verified in the step above examples may be used TSDB address, e.g. ts-xxxxxxxxxxxx.hitsdb.rds.aliyuncs.com:3242.

Then click deployment Istio , start the deployment. After successful deployment, Prometheus monitoring persistent data corresponding to TSDB instance.

Change has Isito deployment configuration

If you have previously deployed Istio, but do not enable persistent storage Prometheus, you can configure the following steps.

  • Login container service management console.
  • In Kubernetes menu, click Apply in the left navigation bar> released into the publication page.
  • Click Helm, select the cluster, select Istio to be updated, click the operation to update the column.
  • In the dialog box, the parameters of Prometheus Istio be modified:
Configuration Explanation
enabled true or false, indicating whether to enable Prometheus collect metrics log. Enabled by default, that is true.
replicaCount The number of copies prometheus groups of containers, the default value is 1.
persist true or false, indicating whether to enable persistent storage. When set to true, you must specify the instance TSDB address.
tsdbEndpoint TSDB instance address, you must specify when to enable persistent storage.
retention The default data retention time, 8760h0m0s that is 24 * 365 hours, that is 1 year
scrapeInterval The global default Fetch interval, the default is 15s

  • When you're done, click update .

View Prometheus Configuration

Log in container services management console, click the left-hand navigation application configuration under configuration items , configuration items into the list page. Click prometheus item name for the configuration, the process proceeds configuration item details page, as shown below, you can see an example of the address corresponding to FIG TSDB:

Write and read verification TSDB

TSDB write verification

可以简单的通过TSDB实例的管理控制台界面的“实例监控”界面,观察写入的TPS是否有所变化来验证。一般刚开始没有任何数据写入时,写入的TPS为0;若TPS开始从0变为正数时,则说明Prometheus已经将数据上报到了TSDB中,如下图所示。

读取验证

在启用了Prometheus的Istio所在Kubernetes集群下,执行命令:
kubectl port-forward -n istio-system svc/prometheus 9090:9090

打开浏览器,输入地址http://localhost:9090,进入Prometheus控制台页面。

Istio提供了一系列的默认监控指标,以Prometheus采集到Istio的一个监控指标istio_request_bytes_count为例进行查询认证,结果如下图所示。

至此,一个完整集成TSDB到Istio可观性Prometheus服务的过程已经结束。

总结

在阿里云Kubernetes容器服务基础之上,快速搭建一套用于连接、管理以及安全化微服务的开放平台Istio,为应用引入和配置多个相关服务。使用Prometheus进行监控是Istio提供的监控能力之一,通过集成TSDB有效地解决持久化存储的问题。

 

原文链接
本文为云栖社区原创内容,未经允许不得转载。

Guess you like

Origin blog.csdn.net/weixin_43970890/article/details/91438350