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

Docker installation and configuration steps for MySQL

Table of contents Preface environment Install Cre...

An example of how JavaScript can prevent duplicate network requests

Preface During development, we often encounter va...

Tips for importing csv, excel or sql files into MySQL

1. Import csv file Use the following command: 1.m...

Differences between ES6 inheritance and ES5 inheritance in js

Table of contents Inheritance ES5 prototype inher...

Do you know why vue data is a function?

Official website explanation: When a component is...

Detailed explanation of Linux file operation knowledge points

Related system calls for file operations create i...

How to implement a simple HTML video player

This article introduces the method of implementin...

MySQL primary key naming strategy related

Recently, when I was sorting out the details of d...

A quick guide to MySQL indexes

The establishment of MySQL index is very importan...

The complete implementation process of Sudoku using JavaScript

Table of contents Preface How to solve Sudoku Fil...

JS Easy to understand Function and Constructor

Table of contents 1. Overview 1.1 Creating a func...

VMware virtual machine installation CentOS 8 (1905) system tutorial diagram

The world-famous virtual machine software VMware-...