Tải bản đầy đủ (.docx) (3 trang)

Cách SPLUNK lưu dữ liệu

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (80.35 KB, 3 trang )

Cách SPLUNK lưu dữ liệu
/> />
Khi Splunk đánh dấu chỉ mục dữ liệu của bạn, nó sẽ tạo ra một "bó" các tập tin. Các tệp này chứa
hai loại dữ liệu:
• Dữ liệu thô ở dạng nén (rawdata)
• Chỉ mục trỏ đến dữ liệu thô, cộng với một số tệp tin siêu dữ liệu (tệp chỉ mục)

Các tệp nằm trong các bộ thư mục được sắp xếp theo độ tuổi.

How Splunk ages data
Mỗi thư mục chỉ mục được gọi là một bucket. Tóm tắt như sau:
• Một chỉ mục Splunk (Splunk index) chứa dữ liệu nén thô và các tệp chỉ mục có liên quan.
• Một chỉ mục Splunk nằm trên nhiều thư mục chỉ mục được chỉ định theo độ tuổi (many agedesignated index directories).
• Một thư mục chỉ mục (index directory) là một bucket.

Một bucket trải qua 4 giai đoạn khác nhau dựa vào độ tuổi:
• hot
• warm
• cold
• frozen

Độ tuổi của bucket được "lăn" từ giai đoạn này sang giai đoạn khác. Dữ liệu được lập chỉ mục mới
đưa vào nhóm "hot bucket", đây là nhóm tìm kiếm và có thể chủ được được ghi. Tiếp đó, "hot
bucket" đạt đến 1 kích thước nhất định, nó sẽ trở thành 1 "warm bucket", và một "hot bucket"
mới được tạo ra. "Warm bucket" có thể tìm kiếm được, nhưng không thể chủ động ghi được. Có
rất nhiều "warm bucket".
Một khi Splunk đã tạo ra số lượng "warm bucket" tối đa, nó sẽ bắt đầu "lăn" những "warm
bucket" đến giai đoạn "cold". "Warm bucket" có tuổi lâu đời nhất bị "lăn" tới giai đoạn cold. Sau
một thời gian nhất định, "cold bucket" chuyển sang giai đoạn "frozen" (đông lạnh). Tại thời điểm



đó chúng được lưu trữ hoặc bị xóa. Bằng cách chỉnh sửa các thuộc tính trong file indexes.conf
bạn có thể chỉ định chính sách tuổi già, xác định thời điểm một bucket di chuyển từ giai đoạn này
sang giai đoạn tiếp theo.
Tóm tắt 4 trạng thái như sau:
Bucket
stage

Description

Searchable?

Hot

Contains newly indexed data. Open for
writing. One or more hot buckets for each
index.

Yes

Warm

Data rolled from hot. There are many warm
buckets.

Yes

Cold

Data rolled from warm. There are many cold
buckets.


Yes

Frozen

Data rolled from cold. Splunk deletes frozen
data by default, but you can also archive it.
Archived data can later be thawed.

No

Bộ sưu tập bucket trong một giai đoạn cụ thể được gọi là database hoặc "db": "hot db", "warm
db", "cold db", v.v ...
Lưu ý: Hot bucket luôn luôn bị chuyển giai đoạn khi Splunk khởi động lại

What the index directories look like
Mỗi bucket chiếm một thư mục con riêng trong thư mục database lớn hơn. Splunk tổ chức các
thư mục để phân biệt giữa hot/ warm/ cold buckets. Ngoài ra, tên thư mục bucket còn dựa trên
độ tuổi của dữ liệu.
Đây là cấu trúc thư mục cho chỉ mục mặc định (defaultdb):
Bucket
type

Default location

Notes

Hot

$SPLUNK_HOME/var/lib/splunk/defaultdb/db/*


There can be multiple hot
subdirectories. Each hot bucket
occupies its own subdirectory, which
uses this naming convention:


hot_v1_<localid>

Warm

$SPLUNK_HOME/var/lib/splunk/defaultdb/db/*

There are separate subdirectories for
each warm bucket. These are named as
described below in "Warm/cold bucket
naming convention".

Cold

$SPLUNK_HOME/var/lib/splunk/defaultdb/colddb/*

There are multiple cold subdirectories.
When warm buckets roll to cold, they
get moved into this directory, but are
not renamed.
Note: In a cluster, all replicated copies
of buckets reside in the colddb directory.
It doesn't matter whether they're hot,
warm, or cold. The original copies of

cluster buckets, however, reside in their
normal locations, as described in this
table. For example, if clusterpeer1
creates a new hot bucket and then
replicates it to clusterpeer2, the original
copy of the hot bucket on clusterpeer1
will reside in the db directory, while the
replicated copy of the hot bucket on
clusterpeer2 will reside in
the colddb directory. For detailed
information on clusters and buckets,
read "Buckets and clusters"in the
cluster section of this manual.

Frozen

N/A: Frozen data gets deleted or archived into a
directory location you specify.

Deletion is the default; see "Archive
indexed data" for information on how to
archive the data instead.

Thawe
d

$SPLUNK_HOME/var/lib/splunk/defaultdb/thaweddb/*

Location for data that has been archived
and later thawed. See "Restore archived

data" for information on restoring
archived data to a thawed state.



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×