From 8e6538bf581bb0d7b7c0fae635158e24cc5541b9 Mon Sep 17 00:00:00 2001 From: YenchangChan Date: Sat, 8 Jun 2024 06:57:37 +0800 Subject: [PATCH] chore: docker-compose --- Dockerfile.test | 6 +-- docker-compose.yml | 101 +++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 96 insertions(+), 11 deletions(-) diff --git a/Dockerfile.test b/Dockerfile.test index de3cf38b..e6bea5c6 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -2,8 +2,8 @@ # You can run command like: "docker build -f Dockerfile.test -t ckman-clickhouse:centos-7 ." # the offical image is eoitek/ckman-clickhouse:centos-7, You can pull it from dockerhub. -FROM centos:7 - +#FROM centos:7 +FROM ccr.ccs.tencentyun.com/library/centos:7 WORKDIR /var/ RUN yum -y update && yum install -y openssh* \ && yum install -y epel-release && yum install -y jq \ @@ -11,4 +11,4 @@ RUN yum -y update && yum install -y openssh* \ && echo '123456' |passwd --stdin root ENTRYPOINT /usr/sbin/init -CMD ["systemctl", "start", "sshd"] \ No newline at end of file +CMD ["systemctl", "start", "sshd"] diff --git a/docker-compose.yml b/docker-compose.yml index 218d85e5..72a9b85f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,13 +1,98 @@ version: "3" services: - zookeeper: - image: zookeeper:3.7.0 - ports: - - "12181:2181" + node1: + image: eoitek/ckman-clickhouse:centos-7 + hostname: node1 + privileged: true + extra_hosts: + - "node1:192.168.122.101" + - "node2:192.168.122.102" + - "node3:192.168.122.103" + - "node4:192.168.122.104" + - "node5:192.168.122.105" + - "node6:192.168.122.106" + networks: + extnetwork: + ipv4_address: 192.168.122.101 + + node2: + image: eoitek/ckman-clickhouse:centos-7 + hostname: node2 + privileged: true + extra_hosts: + - "node1:192.168.122.101" + - "node2:192.168.122.102" + - "node3:192.168.122.103" + - "node4:192.168.122.104" + - "node5:192.168.122.105" + - "node6:192.168.122.106" + networks: + extnetwork: + ipv4_address: 192.168.122.102 + + node3: + image: eoitek/ckman-clickhouse:centos-7 + hostname: node3 + privileged: true + extra_hosts: + - "node1:192.168.122.101" + - "node2:192.168.122.102" + - "node3:192.168.122.103" + - "node4:192.168.122.104" + - "node5:192.168.122.105" + - "node6:192.168.122.106" + networks: + extnetwork: + ipv4_address: 192.168.122.103 - cknode: + node4: image: eoitek/ckman-clickhouse:centos-7 + hostname: node4 privileged: true - deploy: - mode: replicated - replicas: 4 + extra_hosts: + - "node1:192.168.122.101" + - "node2:192.168.122.102" + - "node3:192.168.122.103" + - "node4:192.168.122.104" + - "node5:192.168.122.105" + - "node6:192.168.122.106" + networks: + extnetwork: + ipv4_address: 192.168.122.104 + + node5: + image: eoitek/ckman-clickhouse:centos-7 + hostname: node5 + privileged: true + extra_hosts: + - "node1:192.168.122.101" + - "node2:192.168.122.102" + - "node3:192.168.122.103" + - "node4:192.168.122.104" + - "node5:192.168.122.105" + - "node6:192.168.122.106" + networks: + extnetwork: + ipv4_address: 192.168.122.105 + + node6: + image: eoitek/ckman-clickhouse:centos-7 + hostname: node6 + privileged: true + extra_hosts: + - "node1:192.168.122.101" + - "node2:192.168.122.102" + - "node3:192.168.122.103" + - "node4:192.168.122.104" + - "node5:192.168.122.105" + - "node6:192.168.122.106" + networks: + extnetwork: + ipv4_address: 192.168.122.106 + +networks: + extnetwork: + ipam: + config: + - subnet: 192.168.122.0/24 + gateway: 192.168.122.1