Movatterモバイル変換


[0]ホーム

URL:


CN110311817A - Container log processing system for Kubernetes cluster - Google Patents

Container log processing system for Kubernetes cluster
Download PDF

Info

Publication number
CN110311817A
CN110311817ACN201910578033.7ACN201910578033ACN110311817ACN 110311817 ACN110311817 ACN 110311817ACN 201910578033 ACN201910578033 ACN 201910578033ACN 110311817 ACN110311817 ACN 110311817A
Authority
CN
China
Prior art keywords
log
module
container
kubernetes cluster
processing system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910578033.7A
Other languages
Chinese (zh)
Other versions
CN110311817B (en
Inventor
白伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Changhong Electric Co Ltd
Original Assignee
Sichuan Changhong Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan Changhong Electric Co LtdfiledCriticalSichuan Changhong Electric Co Ltd
Priority to CN201910578033.7ApriorityCriticalpatent/CN110311817B/en
Publication of CN110311817ApublicationCriticalpatent/CN110311817A/en
Application grantedgrantedCritical
Publication of CN110311817BpublicationCriticalpatent/CN110311817B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The present invention relates to container technical fields, disclose a kind of container log processing system for Kubernetes cluster, solve the problems, such as how the log of random distribution container collects, searches in kubernetes cluster, filing.Specific label is stamped the present invention is based on Kubernetes deployment services and configuration log collection assembly is collected for the label that deployment services are stamped, searches for, files, and using message as log collection buffer-stored, compression storage is carried out on archive log to solve the problems, such as to influence service feature and the high problem of carrying cost during log collection, and the discarding event for configuring Filebeat is the specific label of deployment services, accomplishes log collection dynamic switch.The present invention is suitable for data center's transmission control.

Description

Container log processing system for Kubernetes cluster
Technical field
The present invention relates to container technical fields, in particular to are used for the container log processing system of Kubernetes cluster.
Background technique
With the popularization of micro services framework, more and more companies are built the business platform of oneself using micro services and adoptedMicro services are administered to the container platform that Kubernetes is representative, carry out scheduling of resource, dynamically scalable with KubernetesThe a series of container editing operations such as appearance.And important information of the log as record container operating status, and in daily productionCritical data as diagnosis, orientation problem, meaning have obtained people and have more and more paid attention to.Especially holding on a large scaleIn device cluster, a micro services can have multiple copies and be assigned randomly on different host nodes, how collect random distributionContainer daily record data, and a series of problems, such as providing distributed container log filing and function of search etc., becomes containerChange deployment to have to face one challenge in the process.
Summary of the invention
The technical problem to be solved by the present invention is providing a kind of container log processing system for Kubernetes clusterSystem, solves the problems, such as how the log of random distribution container collects, searches in kubernetes cluster, filing.
To solve the above problems, the technical solution adopted by the present invention is that: at the container log of Kubernetes clusterReason system, including the storage of log acquisition module, log collection module, log consumption module, log filing procedure, log bufferMould, searching analysis service module and two specific labels;
Two specific labels depend on the application disposed in Kubernets cluster, the label value of one of label A withApplication name is identical, another label B is for determining whether need to be collected, file using log;
Log acquisition module is used for acquisition applications daily record data;
Log buffer memory module is written in the log that log collection module is used to acquire log acquisition module, and configures dayWill abandons event condition wherein, and the daily record data of write-in log buffer memory module need to include two above-mentioned specific labels;
Log consumption module is used to consume the daily record data in buffered memory module, and post-consumer daily record data will be writeEnter in searching analysis service module, wherein the daily record data of write-in searching analysis service module need to be specific comprising above-mentioned twoLabel;
The daily record data that log filing procedure is used to collect searching analysis service module is filed, log filing procedureDetermine whether applied business log needs to be archived by label B before filing, with the inspection of label A removal search service module when filingRope returns file data.
Further, the parameter of setting log acquisition module is needed before the log acquisition module acquisition, to ensure individually to holdDevice log can roll update, while prevent single container log excessive.
Further, the log acquisition module can be Docker.
Further, the log buffer memory module can be Kafka.
Further, log collection module can be Filebeat.
Further, Filebeat is deployed in Kubernetes cluster in a manner of DaemonSet, to ensureEach host node runs portion pod copy in Kubernetes cluster, when new node is added in Kubernetes cluster, orWhen person removes old node, Filebeat meeting Automatic dispatching pod to new node or deletes extra copy, it is ensured that each nodeLog can correctly be collected.
Further, the log consumption module can be Logstash.
Further, the filing procedure can also have retry mechanism, to guarantee that filing data are not lost.
Further, described search service module can be Elasticsearch.
The beneficial effects of the present invention are: the present invention is all adopted for container log collection, filing in Kubernetes clusterIt is handled with asynchronization, i.e., log buffer memory module is written into the log of log acquisition module acquisition, thus reduce cluster dayWill, which is collected, influences performance caused by business itself in archiving process.And it provides distributed information log and searches in real time and return with historyThe comprehensive daily record data of shelves guarantees that data are not lost, and log filing greatly reduces log using storage method after compression and depositsStore up cost.
Detailed description of the invention
Fig. 1 is the flow diagram of embodiment.
Fig. 2 is the structural schematic diagram of embodiment.
Specific embodiment
In order to solve the problems, such as how the log of random distribution container collects in kubernetes cluster, search for, filing, the present inventionTwo specific labels are stamped when application deployment in Kubernets cluster, the value of one of label A is identical as application name, justIn being filed to distributed information log and being searched for, the value of another label B determines whether need to be collected, file using log.The application for not needing collector journal convenient for control causes the unnecessary wasting of resources to system.
It is written to standard output using by log, all nodes pass through log acquisition module in kubernetes clusterDocker will be written in host node file system using log, and Docker can be called by one of ownThe module of LogDriver is handled, and LogDriver is exactly module that Docker is used to process container standard output.Docker supports various processing mode, the present invention to default JSON File log using Docker.For large-scaleThe growth rate of cluster container, log file size is exceedingly fast, this can undoubtedly exhaust the disk space of host node quickly, thereforeWe need to be arranged container log and roll size.
The present invention disposes log collection module Filebeat in Kubernetes cluster and passes through each host nodeWhat Docker was collected is uploaded to that log is centrally stored, and Filebeat is deployed in a manner of DaemonSet using logIn Kubernetes cluster, DaemonSet ensures that each host node operation portion pod copy in Kubernetes cluster,When being added new node in Kubernetes cluster, or removing old node, it can Automatic dispatching pod to new node orPerson deletes extra copy, it is ensured that the log of each node can be collected correctly.It is generated in real time since application log has, dataBig feature is measured, Filebeat is uploaded to simultaneously centrally stored to log can cause huge I/O to centrally stored using logPressure even causes daily record data to lose, thus configures Filebeat and daily record data is directly reached log buffer memory moduleMultiple subregions under the Topic specified in Kafka cluster, the characteristic that we support superelevation concurrently to write using Kafka, temporal cacheUsing log.The label and open that the daily record data that we need to configure Filebeat transmission simultaneously is beaten when needing plus application deploymentIt opens log and abandons event, whether log, which needs to be passed value Kafka, depends on whether opening log collection when application deployment.
The present invention disposes log consumption module Logstash in Kubernetes cluster, and Logstash consumes FilebeatThe centrally stored search service module of log will be written using log in the message of incoming Kafka specified TopicElasticsearch.The template for configuring Logstash write-in Elasticsearch is a daily Index, is prevented singleIndex is excessive, causes performance to influence blog search and the daily record data that Elasticsearch is written includes that application is beaten when disposingOn specific label.All logs are collectively written into Elasticsearch in cluster, and very high, configuration is occupied for memory spaceTimed task ensures that Elasticsearch only stores the daily record data in 6 months, guarantees blog search interface capability.
The present invention disposes log filing procedure in Kubernetes cluster, to Elasticsearch collector journalMore copies dispersion daily record data is filed according to the level of cluster, space, application, is divided into once every hour, returns between filingFiling data are retrieved with label A removal search service module when shelves, daily record data is uploaded to object storage Ceph after filing.Log is returnedShelves program counts change in resources in cluster using Kubernetes Watcher mechanism, and only to stamping log collection markLabel application carries out log filing, and filing procedure can compress before being uploaded to Ceph to using log, and log can pole after compressionBig to reduce memory space, 6 months time restrictions can only be provided by permanently storing solution blog search convenient for archive log.
To make the object, technical solutions and advantages of the present invention clearer, the present invention is done into one below with reference to embodimentStep ground detailed description.
Embodiment
Referring to figs. 1 and 2, embodiment provides container log processing method in a kind of Kubernetes cluster, mainWant the following steps are included:
Step 1: application deployment app and opening log collection in systems, and system stamps matrix- to using appTwo specific labels of application=app, matrix-logger=on.
Step 2: modification Docker log collection relevant parameter, to ensure that single container log can roll update, simultaneouslySetting -- log-opt max-size=100m, to prevent single container log excessive.
Step 3: disposing Filebeat in cluster in systems, and specified Filebeat arrives daily record data asynchronous writeUnder the Topic of the entitled matrix of Kafka, and increase drop_event in Filebeat configuration template, specifies matrix-Event is abandoned when logger=off, not collector journal data, increase add_kubernetes_ at processorsMetadata needs to be added the specific label matrix-application of application deployment in include_fields, is convenient forIt is subsequent that distributed information log is scanned for, is filed.
Step 4: disposing LogstashLogstash in systems, consumes the Topic message of the entitled matrix of Kafka, willConsumption data is written to Elasticsearch, and configuring Logstash output plug-in unit is Elasticsearch, is specifiedIt is daily one that index, which creates format,.System provides Retrieval Interface and carries out in fact to application app deposit Elasticsearch logWhen search for.
Step 5: in system dispose log filing procedure to Elasticsearch collector journal according to cluster, space, answerLevel files more copies dispersion daily record data, and log filing procedure is examined using Kubernetes Watcher mechanismMatrix-logger=on is looked into, discovery opens log collection using app, and filing procedure passes through matrix-application=app attribute retrieves the Elasticsearch daily record data stored, and the log of application app is write sequentially in timeEnter to being locally stored, and gz compression is carried out to local log, log is passed to Ceph after having compressed, and write the result into dataLibrary is downloaded Historical archiving log convenient for business and checks, files whole process if any interruption, filing procedure can be to this numberAccording to filing retry, guarantee that daily record data is not lost.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the inventionMade any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within mind and principle.

Claims (9)

CN201910578033.7A2019-06-282019-06-28Container log processing system for Kubernetes clusterActiveCN110311817B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910578033.7ACN110311817B (en)2019-06-282019-06-28Container log processing system for Kubernetes cluster

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910578033.7ACN110311817B (en)2019-06-282019-06-28Container log processing system for Kubernetes cluster

Publications (2)

Publication NumberPublication Date
CN110311817Atrue CN110311817A (en)2019-10-08
CN110311817B CN110311817B (en)2021-09-28

Family

ID=68079456

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910578033.7AActiveCN110311817B (en)2019-06-282019-06-28Container log processing system for Kubernetes cluster

Country Status (1)

CountryLink
CN (1)CN110311817B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111190875A (en)*2019-12-272020-05-22航天信息股份有限公司 Log aggregation method and device based on container platform
CN113127526A (en)*2019-12-302021-07-16中科星图股份有限公司Distributed data storage and retrieval system based on Kubernetes
CN113760638A (en)*2020-10-152021-12-07北京沃东天骏信息技术有限公司 A log service method and device based on kubernetes cluster
CN114116629A (en)*2021-11-252022-03-01税友信息技术有限公司 A Kubernetes platform log processing method and related device
CN114238017A (en)*2021-12-152022-03-25广联达科技股份有限公司Azkaban-based log management method and system
CN114238256A (en)*2021-11-192022-03-25广西中科曙光云计算有限公司Log collection method and device and storage medium
CN114625594A (en)*2020-12-112022-06-14北京金山云网络技术有限公司 Configuration file generation method, log collection method, device, device and medium
CN114661416A (en)*2022-03-082022-06-24华控清交信息科技(北京)有限公司Specific task log collection method and device for k8s container cluster and electronic equipment
CN115361386A (en)*2022-08-172022-11-18度小满科技(北京)有限公司 A method of cold and hot separation of kafka data storage and cluster server system

Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107180051A (en)*2016-03-112017-09-19华为技术有限公司A kind of blog management method, server
CN108363802A (en)*2018-02-282018-08-03深圳市华云中盛科技有限公司Text collection method based on container and its system
CN109347814A (en)*2018-10-052019-02-15李斌A kind of container cloud security means of defence and system based on Kubernetes building
CN109491859A (en)*2018-10-162019-03-19华南理工大学For the collection method of container log in Kubernetes cluster
US20190095253A1 (en)*2017-09-222019-03-28Vmware, Inc.Cluster updating using temporary update-monitor pod
CN109739825A (en)*2018-12-292019-05-10优刻得科技股份有限公司Manage the method, apparatus and storage medium of log
KR20190066516A (en)*2017-12-052019-06-13숭실대학교산학협력단System and method for supervising doker container, computer readable medium for performing the method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107180051A (en)*2016-03-112017-09-19华为技术有限公司A kind of blog management method, server
US20190095253A1 (en)*2017-09-222019-03-28Vmware, Inc.Cluster updating using temporary update-monitor pod
KR20190066516A (en)*2017-12-052019-06-13숭실대학교산학협력단System and method for supervising doker container, computer readable medium for performing the method
CN108363802A (en)*2018-02-282018-08-03深圳市华云中盛科技有限公司Text collection method based on container and its system
CN109347814A (en)*2018-10-052019-02-15李斌A kind of container cloud security means of defence and system based on Kubernetes building
CN109491859A (en)*2018-10-162019-03-19华南理工大学For the collection method of container log in Kubernetes cluster
CN109739825A (en)*2018-12-292019-05-10优刻得科技股份有限公司Manage the method, apparatus and storage medium of log

Cited By (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111190875A (en)*2019-12-272020-05-22航天信息股份有限公司 Log aggregation method and device based on container platform
CN113127526A (en)*2019-12-302021-07-16中科星图股份有限公司Distributed data storage and retrieval system based on Kubernetes
CN113760638A (en)*2020-10-152021-12-07北京沃东天骏信息技术有限公司 A log service method and device based on kubernetes cluster
CN114625594A (en)*2020-12-112022-06-14北京金山云网络技术有限公司 Configuration file generation method, log collection method, device, device and medium
CN114238256A (en)*2021-11-192022-03-25广西中科曙光云计算有限公司Log collection method and device and storage medium
CN114116629A (en)*2021-11-252022-03-01税友信息技术有限公司 A Kubernetes platform log processing method and related device
CN114238017A (en)*2021-12-152022-03-25广联达科技股份有限公司Azkaban-based log management method and system
CN114661416A (en)*2022-03-082022-06-24华控清交信息科技(北京)有限公司Specific task log collection method and device for k8s container cluster and electronic equipment
CN115361386A (en)*2022-08-172022-11-18度小满科技(北京)有限公司 A method of cold and hot separation of kafka data storage and cluster server system

Also Published As

Publication numberPublication date
CN110311817B (en)2021-09-28

Similar Documents

PublicationPublication DateTitle
CN110311817A (en)Container log processing system for Kubernetes cluster
CN109542733B (en)High-reliability real-time log collection and visual retrieval method
CN111881011B (en) Log management method, platform, server and storage medium
CN109308329A (en)Log collection method and device based on cloud platform
CN102375837B (en)Data acquiring system and method
CN103235820B (en)Date storage method and device in a kind of group system
CN109871392B (en)Slow sql real-time data acquisition method under distributed application system
CN103064731A (en)Device and method for improving message queue system performance
CN112685370B (en)Log collection method, device, equipment and medium
CN111127250B (en)Power data monitoring event analysis system and method
CN101533416A (en)Method and system for managing video and audio file
CN114020893A (en) A log retrieval method, device and storage medium based on distributed storage
CN111897867A (en)Database log statistical method, system and related device
CN116126621A (en)Task monitoring method of big data cluster and related equipment
CN115952142A (en)System, method, device, processor and storage medium for realizing transaction log storage and message information extraction and summarization in trusted environment
CN110389939A (en) An IoT storage system based on NoSQL and distributed file system
CN114020819B (en) A method and device for synchronizing multi-system parameters
CN100486177C (en)Method of synchronously operating network element by network management and its system
CN109614380A (en)Log processing method, system, computer equipment and readable medium
CN116610531B (en)Method for collecting data embedded points and requesting image uploading data based on code probe
CN113115069A (en)Video storage method and system of automobile data recorder
CN115022402B (en)Agent acquisition method and system based on stack-type integration technology
CN114090644B (en)Data processing method and device
Wang et al.SF-SNF: A Small-file Sniffer System for Hadoop Clusters
CN115509693A (en)Data optimization method based on cluster Pod scheduling combined with data lake

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp