当前位置:网站首页>[log service CLS] initial experience of Tencent cloud CLS log service

[log service CLS] initial experience of Tencent cloud CLS log service

2022-06-24 15:19:00 Third shopkeeper

Reading guide

The log service (Cloud Log Service,CLS) It is a one-stop log service platform provided by Tencent cloud , Provides data collection from logs 、 Log storage to log retrieval analysis 、 Real time consumption 、 Log delivery and other services , Assist users to solve business operation through logs 、 Safety monitoring 、 Log audit 、 Log analysis and other issues . Users don't need to pay attention to resource expansion , Five minutes of easy access , You can enjoy stable and reliable log service .

As a server, Xiaobai , From an introductory perspective , A simple way to see Tencent cloud CLS The log service . In this article, let's share about using CLS The first experience of log service .

Concept

Log Service Center : Tencent cloud log service CLS, Log service is responsible for the storage of logs 、 Filter 、 Push and other tasks , Push and filter operations are operated by the console . Define the log index through the console key, Index keyword search can quickly locate the corresponding log record , After logging, the feedback information can quickly analyze and locate business problems .

LogListener: Log collection Agent, Install... On the server LogListener Real time collection of logs on the specified path , And the original data of the log is structured , Finally, it is pushed to the log service center .

COS Storage : Configure push tasks through the console log service , Store logs , Data is stored in object storage , Linkage Tencent cloud big data COS Pull the stored data , And log analysis processing .

CkafkaCLS Message queuing products for logging services Ckafka Real time consumer services , Just open the corresponding button on the console to realize this function .

practice

One 、 Tencent builds on the cloud Nginx service .

1、 install Nginx service

yum install nginx -y

2、 Change configuration

 vim /etc/nginx/conf.d/default.conf // Enter the configuration file 
 7  #    listen       [::]:80 default_server;  // Comment the seventh line of the configuration file 

3、 start-up Nginx service

 nginx  

Two 、Nginx Install the deployment on the server Agent Collection services

1、 download LogListener

Download address :https://main.qcloudimg.com/raw/ee52812a5bf211d08f7ed1a4c894a747/loglistener.2.2.0.tar.gz

2、 Install tools to upload files

 yum install lrzsz -y

3、 Upload through the upload file tool LogListener Installation package

 rz
 tar -zxvf loglistener.tar.gz  && cd loglistener/tools/

4、 obtain API secret key ID

 ./install.sh  $(SecretId)  $(secretkey)  $(region)

5、 start-up Agent service

 ./start.sh

3、 ... and 、 Open the log service CLS

1、 Create a log set and set the configuration

Open Tencent cloud CLS Service website :https://cloud.tencent.com/product Find the log service option ,

Then click to enter the homepage of log service products , Click on “ Immediate use ” Button ,

After entering the log service console , If it's the first time , Need to click “ Open now ” Button ,

Click to open CLS The first thing you need to do after the service is to create a log theme , The specific operation is shown below :

2、 Index configuration settings

Open the log service platform , Find the search analysis option in the left menu bar , Click to enter

3、 Log retrieval

Search analysis grammar matching rules , Set according to the actual situation , For the specific configuration index, please check the document details of Tencent cloud log service , I won't introduce .

4、 Delivery configuration task management

Open the log service platform , Find... In the menu bar on the left “ Delivery task configuration ”—>“ Post to COS”, Then click to enter

Click on “ Add delivery task ” Button , Enter the basic configuration of configuration options ,

Click on “ next step ”, Go to advanced configuration , After setting up , Click on “ determine ” Button , You can set the delivery configuration task

Last

Through this article, Tencent cloud CLS Log service experience , I think Tencent cloud's log service is quite good , By analyzing the server log , It is convenient for developers to find solutions to corresponding problems accurately and quickly , Greatly improve work efficiency , Save a lot of time and cost , And Tencent cloud log service visualization analysis operation , It's more convenient for developers . The overall operation is OK , But for Xiaobai, it's a bit hard to feel his head , We need to do a little more streamlining , It works better , The above views are personal views only , If there is something wrong , Also please correct me .

The above is the whole content of this article , Welcome to WeChat official account of three shopkeeper. “ Program the ape by Three shopkeepers ”, Three shopkeepers' Sina Weibo “ Three shopkeepers 666”, Welcome to your attention !

原网站

版权声明
本文为[Third shopkeeper]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/05/20210517102207141v.html