Giter VIP home page Giter VIP logo

graphite-clickhouse's Introduction

graphite-clickhouse

Graphite cluster backend with ClickHouse support

Work scheme

stack.png

Gray components are optional or alternative

Compatibility

Build

Required golang 1.7+

# build binary
git clone https://github.com/lomik/graphite-clickhouse.git
cd graphite-clickhouse
make submodules
make

Installation

  1. Setup Yandex ClickHouse and carbon-clickhouse
  2. Setup and configure graphite-clickhouse
  3. Add graphite-clickhouse host:port to graphite-web CLUSTER_SERVERS

Configuration

Create /etc/graphite-clickhouse/rollup.xml with same content as for ClickHouse. Short sample:

<graphite_rollup>
        <default>
                <function>avg</function>
                <retention>
                        <age>0</age>
                        <precision>60</precision>
                </retention>
                <retention>
                        <age>2592000</age>
                        <precision>3600</precision>
                </retention>
        </default>
</graphite_rollup>

For complex clickhouse queries you might need to increase default query_max_size. To do that add following line to /etc/clickhouse-server/users.xml for the user you are using:

<!-- Default is 262144 -->
<max_query_size>10485760</max_query_size>

Create /etc/graphite-clickhouse/graphite-clickhouse.conf

[common]
listen = ":9090"
max-cpu = 1

[clickhouse]
# You can add user/password (http://user:password@localhost:8123) and any clickhouse options (GET-parameters) to url
# It is recommended to create read-only user 
url = "http://localhost:8123"
data-table = "graphite"
tree-table = "graphite_tree"
rollup-conf = "/etc/graphite-clickhouse/rollup.xml"
# Add extra prefix (directory in graphite) for all metrics
extra-prefix = ""
data-timeout = "1m0s"
tree-timeout = "1m0s"

[logging]
file = "/var/log/graphite-clickhouse/graphite-clickhouse.log"
level = "info"

Run on same host with graphite-web

By default graphite-web won't connect to CLUSTER_SERVER on localhost. Cheat:

class ForceLocal(str):
    def split(self, *args, **kwargs):
        return ["8.8.8.8", "8080"]

CLUSTER_SERVERS = [ForceLocal("127.0.0.1:9090")]

graphite-clickhouse's People

Contributors

lomik avatar

Watchers

James Cloos avatar 胡鹏飞 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.