2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Dockerを使ってClickhosueを導入しよう!

Posted at

はじめに

Clickhouseというdbをご存知ですか?あまり知られていないと思いますが、dockerを使って簡単に導入できるので手順を紹介します。

手順

フォルダ構成

フォルダ構成は以下です。

tree
.
├── Dockerfile
└── docker-compose.yml

treeコマンドがない場合は、macの場合以下コマンドで取得可能です。

brew install tree

.Dockerfile

FROM clickhouse/clickhouse-server:latest

以下コマンドでDockerfileをビルドしてください。

docker build . -t clickhouse

.docker-compose.yml

services:
  db:
    image: clickhouse
    container_name: clickhouse_container
    ports:
      - 8123:8123


以下コマンドでコンテナを起動してください。

docker-compose up -d

以上。

コンテナ確認

以下コマンドでコンテナにアクセスしてください。

docker exec -it clickhouse_container /bin/bash

clickhouse client

show databases;

以下出力になればOK

   ┌─name───────────────┐
1. │ INFORMATION_SCHEMA │
2. │ default            │
3. │ information_schema │
4. │ system             │
   └────────────────────┘

参考

ClickHouse Server Docker Image

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?