Skip to content

Commit

Permalink
update clickhouse, carbon-clickhouse, graphite-clickhouse. use new in…
Browse files Browse the repository at this point in the history
…dex table and auto rollup
  • Loading branch information
lomik committed May 25, 2019
1 parent 223f892 commit 6e4dab8
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 40 deletions.
16 changes: 4 additions & 12 deletions carbon-clickhouse.conf
Expand Up @@ -32,22 +32,14 @@ threads = 1
url = "http://clickhouse:8123/"
timeout = "1m0s"

[upload.graphite_tree]
type = "tree"
table = "graphite_tree"
date = "2016-11-01"
[upload.graphite_index]
type = "index"
table = "graphite_index"
threads = 1
url = "http://clickhouse:8123/"
timeout = "1m0s"
cache-ttl = "12h0m0s"

[upload.graphite_series_reverse]
type = "series-reverse"
table = "graphite_series_reverse"
threads = 1
url = "http://clickhouse:8123/"
timeout = "1m0s"

[upload.graphite_tagged]
type = "tagged"
table = "graphite_tagged"
Expand Down Expand Up @@ -79,4 +71,4 @@ enabled = false

[pprof]
listen = "localhost:7007"
enabled = false
enabled = false
7 changes: 3 additions & 4 deletions docker-compose.yaml
@@ -1,12 +1,12 @@
clickhouse:
image: yandex/clickhouse-server:19.1
image: yandex/clickhouse-server:19.6.2.11
volumes:
- "./rollup.xml:/etc/clickhouse-server/config.d/rollup.xml"
- "./init.sql:/docker-entrypoint-initdb.d/init.sql"
- "./data/clickhouse/data:/var/lib/clickhouse/data"
- "./data/clickhouse/metadata:/var/lib/clickhouse/metadata"
carbon-clickhouse:
image: lomik/carbon-clickhouse:v0.9.1
image: lomik/carbon-clickhouse:v0.10.0
volumes:
- "./data/carbon-clickhouse:/data/carbon-clickhouse"
- "./carbon-clickhouse.conf:/etc/carbon-clickhouse/carbon-clickhouse.conf"
Expand All @@ -18,9 +18,8 @@ carbon-clickhouse:
links:
- clickhouse
graphite-clickhouse:
image: lomik/graphite-clickhouse:v0.8.5
image: lomik/graphite-clickhouse:v0.9.0
volumes:
- "./rollup.xml:/etc/graphite-clickhouse/rollup.xml"
- "./graphite-clickhouse.conf:/etc/graphite-clickhouse/graphite-clickhouse.conf"
links:
- clickhouse
Expand Down
12 changes: 5 additions & 7 deletions graphite-clickhouse.conf
Expand Up @@ -5,19 +5,17 @@ max-cpu = 8
[clickhouse]
url = "http://clickhouse:8123/?max_query_size=2097152&readonly=2"
data-table = ""
tree-table = "graphite_tree"
rollup-conf = "/etc/graphite-clickhouse/rollup.xml"
index-table = "graphite_index"
rollup-conf = "auto"
data-timeout = "1m0s"
tree-timeout = "1m0s"
date-tree-table = "graphite_series_reverse"
date-tree-table-version = 3
index-timeout = "1m0s"
tagged-table = "graphite_tagged"

[[data-table]]
table = "graphite_reverse"
reverse = true
rollup-conf = "/etc/graphite-clickhouse/rollup.xml"
rollup-conf = "auto"

[logging]
file = "stdout"
level = "warn"
level = "info"
28 changes: 12 additions & 16 deletions init.sql
@@ -1,32 +1,28 @@
CREATE TABLE IF NOT EXISTS default.graphite_reverse (
CREATE TABLE IF NOT EXISTS default.graphite_reverse (
Path String,
Value Float64,
Time UInt32,
Date Date,
Timestamp UInt32
) ENGINE = GraphiteMergeTree(Date, (Path, Time), 8192, 'graphite_rollup');
) ENGINE = GraphiteMergeTree('graphite_rollup')
PARTITION BY toYYYYMM(Date)
ORDER BY (Path, Time);

CREATE TABLE IF NOT EXISTS default.graphite_tree (
CREATE TABLE IF NOT EXISTS default.graphite_index (
Date Date,
Level UInt32,
Path String,
Deleted UInt8,
Version UInt32
) ENGINE = ReplacingMergeTree(Date, (Level, Path), 1024, Version);

CREATE TABLE IF NOT EXISTS default.graphite_series_reverse (
Date Date,
Level UInt32,
Path String,
Deleted UInt8,
Version UInt32
) ENGINE = ReplacingMergeTree(Date, (Level, Path, Date), 1024, Version);
) ENGINE = ReplacingMergeTree(Version)
PARTITION BY toYYYYMM(Date)
ORDER BY (Level, Path, Date);

CREATE TABLE IF NOT EXISTS default.graphite_tagged (
Date Date,
Tag1 String,
Path String,
Tags Array(String),
Version UInt32,
Deleted UInt8
) ENGINE = ReplacingMergeTree(Date, (Tag1, Path, Date), 1024, Version);
Version UInt32
) ENGINE = ReplacingMergeTree(Version)
PARTITION BY toYYYYMM(Date)
ORDER BY (Tag1, Path, Date);
2 changes: 1 addition & 1 deletion rollup.xml
Expand Up @@ -12,4 +12,4 @@
</retention>
</default>
</graphite_rollup>
</yandex>
</yandex>

0 comments on commit 6e4dab8

Please sign in to comment.