Code Monkey home page Code Monkey logo

clickhouse-cluster-docker's Introduction

ClickHouse Cluster Docker Compose

4cc49380-82ee-11ea-9baf-d971dbaafe63

English中文


Docker-compose script for quickly building a ClickHouse cluster environment, based on the official clickhouse/clickhouse-server image, supports custom clickhosue-server versions.

The default component version is as follows :

  • zookeeper:3.6;
  • clickHouse-server:20.11 ;

Quick Start

git clone https://github.com/Al-assad/clickhouse-cluster-docker.git
docker-compose up

The default created cluster nodes includes 1 zookeeper node, 3 clickhosue-server nodes (3 shards, 1 replica each node).

image-20201127163735143

Connect ClickHouse Cluster from Host Machine

  1. Access via host machine ip:

    clickhouse-server-ch01    127.0.0.1:8124
    clickhouse-server-ch02    127.0.0.1:8125
    clickhouse-server-ch03    127.0.0.1:8126
  2. Access via docker subnetwork ip:

    If your docker host machine is MacOS, you can access the docker subnetwork directly through the project wenjunxiao/mac-docker-connector.

    clickhouse-server-ch01    172.18.1.5:8123
    clickhouse-server-ch02    172.18.1.6:8123
    clickhouse-server-ch03    172.18.1.7:8123

Then you can connect the clickhouse-server cluster through DBeaver GUI Tool or clickhosue-client command-line tool. Enjoy it : )

Other Cluster Mode

# single zookeeper node,clickhosue 3 shards and 1 replica
docker-compose -f clickhosue_1zk-3shard-1replica up

# single zookeeper node,clickhosue 3 shards and 3 replicas
docker-compose -f clickhosue_1zk-3shard-3replica up

# 3 zookeeper 3 nodes,clickhosue 3 shards and 1 replica
docker-compose -f clickhosue_3zk-3shard-1replica up

# 3 zookeeper 3 nodes,clickhosue 3 shards and 3 replicas
docker-compose -f clickhosue_3zk-3shard-3replica up

In addition, you can also modify the metrika configuration for the three CH nodes by directly modifying ch-conf/metrika_ch01.xml, ch-conf/metrika_ch02.xml, and ch-conf/metrika_ch03.xml.

Other ClickHouse Image Version

You can customize the CH image version by modifying the environment variable CLICKHOUSE_VERSION.

# use clickhouse-server v20.10
export CLICKHOUSE_VERSION=20.10 && docker-compose config


clickhouse-cluster-docker's People

Contributors

al-assad avatar alexey-milovidov 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.