Monitoring Deployment
1. ClickHouse Installation
1.1 ClickHouse Setup
sudo dnf install -y curl ca-certificates
sudo curl https://builds.altinity.cloud/yum-repo/altinity.repo \
-o /etc/yum.repos.d/altinity.repo
sudo dnf install -y clickhouse-server clickhouse-client
sudo systemctl enable clickhouse-server
sudo systemctl start clickhouse-server
sudo systemctl status clickhouse-server
1.2 Installation Verification and Table Creation
Connect to ClickHouse:
clickhouse-client
Check version:
SELECT version();
Create tables:
USE monitoring;
DROP TABLE IF EXISTS event_sampling;
CREATE TABLE event_sampling (
event_id UUID,
insert_time DateTime,
component_id String,
component_type String,
component_kind String,
string String,
timestamp String,
message String,
name String,
namespace String,
kind String,
value_type String,
value String
)
ENGINE = MergeTree
ORDER BY insert_time
TTL insert_time + INTERVAL 1 DAY;
CREATE TABLE monitoring_metric (
name String,
timestamp DateTime64(3),
tags Tuple(
component_id LowCardinality(String),
component_kind LowCardinality(String),
host LowCardinality(String)
),
value Float64
)
ENGINE = MergeTree
ORDER BY (timestamp, name)
SETTINGS index_granularity = 8192;
Verify tables:
SHOW TABLES;
DESCRIBE TABLE event_sampling;
DESCRIBE TABLE monitoring_metric;
1.3 CMS – ClickHouse Integration
Same server setup:
MONITOR_CH_HOST: http://127.0.0.1:8123
MONITOR_CH_PORT: 8123
MONITOR_CH_DB: vectorlogs
MONITOR_CH_USER: default
MONITOR_CH_PASS: kron
MONITOR_CH_TABLE: monitoring_metric
Different server setup: Edit ClickHouse config:
sudo nano /etc/clickhouse-server/config.xml
<listen_host>0.0.0.0</listen_host>
Restart ClickHouse:
sudo systemctl restart clickhouse-server
Ensure port 8123 is accessible (firewall / cloud security rules).
Port Conflict Note: If CMS and ClickHouse run on the same server, change ClickHouse ports 9004–9006 to 9104–9106.