管理端全部功能跑通
This commit is contained in:
@@ -33,6 +33,6 @@ clickhouse-client "${args[@]}" --database "${CH_DATABASE}" < "${SQL_FILE}"
|
||||
|
||||
echo "[INFO] checking table status ..."
|
||||
clickhouse-client "${args[@]}" --database "${CH_DATABASE}" --query \
|
||||
"SELECT name, engine FROM system.tables WHERE database='${CH_DATABASE}' AND name IN ('logs_ingest','dns_logs_ingest') ORDER BY name"
|
||||
"SELECT name, engine FROM system.tables WHERE database='${CH_DATABASE}' AND name IN ('logs_ingest','dns_logs_ingest','httpdns_access_logs_ingest') ORDER BY name"
|
||||
|
||||
echo "[OK] ClickHouse ingest tables are ready in database '${CH_DATABASE}'"
|
||||
|
||||
@@ -67,3 +67,36 @@ ENGINE = MergeTree
|
||||
PARTITION BY toYYYYMMDD(timestamp)
|
||||
ORDER BY (timestamp, request_id, node_id)
|
||||
SETTINGS index_granularity = 8192;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS httpdns_access_logs_ingest
|
||||
(
|
||||
request_id String,
|
||||
cluster_id UInt64,
|
||||
node_id UInt64,
|
||||
app_id String,
|
||||
app_name String,
|
||||
domain String,
|
||||
qtype LowCardinality(String),
|
||||
client_ip String,
|
||||
client_region String,
|
||||
carrier String,
|
||||
sdk_version String,
|
||||
os LowCardinality(String),
|
||||
result_ips String,
|
||||
status LowCardinality(String),
|
||||
error_code String,
|
||||
cost_ms UInt32,
|
||||
created_at UInt64,
|
||||
day String,
|
||||
summary String CODEC(ZSTD(1)),
|
||||
INDEX idx_request_id request_id TYPE bloom_filter(0.01) GRANULARITY 4,
|
||||
INDEX idx_cluster_id cluster_id TYPE minmax GRANULARITY 4,
|
||||
INDEX idx_node_id node_id TYPE minmax GRANULARITY 4,
|
||||
INDEX idx_app_id app_id TYPE tokenbf_v1(10240, 3, 0) GRANULARITY 4,
|
||||
INDEX idx_domain domain TYPE tokenbf_v1(10240, 3, 0) GRANULARITY 4,
|
||||
INDEX idx_status status TYPE minmax GRANULARITY 4
|
||||
)
|
||||
ENGINE = MergeTree
|
||||
PARTITION BY day
|
||||
ORDER BY (day, created_at, request_id, node_id)
|
||||
SETTINGS index_granularity = 8192;
|
||||
|
||||
Reference in New Issue
Block a user