Tutorial on how to quickly deploy clickhouse using docker-compose

Tutorial on how to quickly deploy clickhouse using docker-compose

ClickHouse is an open source column-oriented DBMS (developed by Yandex). ClickHouse works 100-1000 times faster than traditional methods. It is suitable for big data, business analytics, and time series data. ClickHouse is the first open source SQL data warehouse to match the performance, maturity, and scalability of proprietary databases such as Sybase IQ, Vertica, and Snowflake.

In this small tutorial, I will show you how to install ClickHouse with minimal setup.

For this tutorial, we need to install Docker and docker-compose.

First, you need to create a directory in which to create the necessary files and directories.

cd /home/edy
mkdir my-clickhouse
cd my-clickhouse

Then you need to create a directory where ClickHouse data will be stored.

mkdir db

The last step is to create the docker-compose.yml file.

version: '3'
 
services:
  ch_server:
    image: yandex/clickhouse-server
    ports:
      - "8123:8123"
    volumes:
      - ./db:/var/lib/clickhouse
    networks:
        -ch_ntw
 
  ch_client:
    image: yandex/clickhouse-client
    entrypoint:
      - /bin/sleep
    command:
      -infinity
    networks:
        -ch_ntw
 
networks:
  ch_ntw:
    driver: bridge
    ipam:
      config:
        - subnet: 10.222.1.0/24

Let's check what we did. One file (docker-compose.yml) and one directory (db).

 ls -la
 
drwxr-xr-x 3 user user 4096 Mar 4 07:44 .
drwxr-xr-x 4 user user 4096 Mar 4 07:43 ..
drwxr-xr-x 3 user user 4096 Mar 4 07:45 db
-rw-r--r-- 1 user user 435 Mar 4 07:46 docker-compose.yml
 

That's it!

Now let's start our Clickhouse server. The ClickHouse image will download itself and start the process.

sudo docker-compose up -d

Now let's open the command line.

sudo docker-compose exec ch_server clickhouse-client

We should see the results of running ClickHouse.

ClickHouse client version 21.2.5.5 (official build).
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 21.2.5 revision 54447.
 
5175e561dffd :)

Congratulations, ClickHouse is installed successfully.

my-clickhouse: docker-compose builds clickhouse yam file (gitee.com)

https://gitee.com/meadhu/my-clickhouse

This is the end of this article about how to quickly deploy clickhouse using docker-compose. For more information about deploying clickhouse using docker-compose, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Implementation of Docker Compose multi-container deployment
  • Implementation steps for docker-compose to deploy etcd cluster
  • Detailed example of Docker Compose's rapid deployment of multi-container services

<<:  Floating menu, can achieve up and down scrolling effect

>>:  JavaScript implements bidirectional linked list process analysis

Recommend

Nginx uses ctx to realize data sharing and context modification functions

Environment: init_worker_by_lua, set_by_lua, rewr...

The whole process of installing and configuring Harbor1.7 on CentOS7.5

1. Download the required packages wget -P /usr/lo...

js to realize web music player

This article shares simple HTML and music player ...

Detailed explanation of MySQL custom functions and stored procedures

Preface This article mainly introduces the releva...

Various problems encountered in sending emails on Alibaba Cloud Centos6.X

Preface: I have newly installed an Alibaba cloud ...

A brief discussion on the application of Html web page table structured markup

Before talking about the structural markup of web...

Example of making XML online editor using js

Table of contents Preface The need for online XML...

mysql 5.7.18 winx64 password change

After MySQL 5.7.18 is successfully installed, sin...

Vue storage contains a solution for Boolean values

Vue stores storage with Boolean values I encounte...

Summary of problems that may occur when using JDBC to connect to Mysql database

First, clarify a few concepts: JDBC: Java databas...

vue dynamic component

Table of contents 1. Component 2. keep-alive 2.1 ...

Detailed explanation of Vue monitoring attribute graphic example

Table of contents What is the listener property? ...

How to implement Nginx reverse proxy for multiple servers

Nginx reverse proxy multiple servers, which means...