The invention provides a log collection method and
system based on
parallel sorting optimization, and the method specifically comprises the steps: (1) data sampling: collecting
log data from different log sources, transmitting the
log data to a
data processing node, and obtaining a representative sample from the
log data through a
big data-oriented extensible regular sampling method; (2)
parallel sorting: distributing the representative samples to a plurality of nodes in a
system according to a certain rule, and sorting the log data on each node by using a
parallel sorting algorithm; (3) parallel writing: collecting the sorted representative samples of the log data into a
file system in parallel; and (4) monitoring and optimizing: monitoring the space
utilization rate of a
file system in real time through a
verification file and an inspection tool, and regularly inspecting the integrity of log data. According to the method, a
big data-oriented extensible regular sampling method is adopted to pre-process and sample logs, and a parallel sorting technology is utilized to efficiently collect log data. And then, the sampled log sample data is distributed to a plurality of
processing nodes, so that parallel sorting operation is realized. According to the method, sample storage and
processing tasks are scattered to each process for sorting, and pivot elements are iteratively updated, so that the parallel efficiency is improved, the
processing bottleneck caused by non-uniform data distribution is reduced, and the overall performance and reliability of a
log management system are improved.