Member-only story

Making a network of docker pods

Nikhil Verma
2 min readJun 4, 2021

Its fairly easy

Problem Statement — Say I wish to map a scenario where a database has two nodes and are working as a distributed system. How could I try it on my own Laptop/PC?

Solution — Lets go through it one by one

I am assuming for post, a Clickhouse database server instance, for which i wish to create a distributed system.

I create two server nodes:-

docker run -d --name clickhouse-server-1 -p 8112:8123 --ulimit nofile=262144:262144 --volume=$HOME/clickhouse_database1:/var/lib/clickhouse1 yandex/clickhouse-server

and then second

docker run -d --name clickhouse-server-2 -p 8113:8123 --ulimit nofile=262144:262144 --volume=$HOME/clickhouse_database2:/var/lib/clickhouse2 yandex/clickhouse-server

Now I check on my system, via calling each server instance using

$ curl 0.0.0.0:8112
Ok.
$ curl 0.0.0.0:8113
Ok.

Now I go to a pod and check via calling another pod’s clickhouse-server

$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
63ca61cfe55a yandex/clickhouse-server "/entrypoint.sh" 41…

--

--

Nikhil Verma
Nikhil Verma

Written by Nikhil Verma

Knowledge shared is knowledge squared | My Portfolio https://lihkinverma.github.io/portfolio/ | My blogs are living document, updated as I receive comments

No responses yet