From eae0db3861b0e6618ad82057b6126d677c80f128 Mon Sep 17 00:00:00 2001 From: Kelvin Clement Mwinuka Date: Sat, 6 Jul 2024 14:04:19 +0800 Subject: [PATCH] Uncommented cluster nodes in docker-compose.yml --- Dockerfile.dev | 6 +- docker-compose.yaml | 438 ++++++++++++++++++++++---------------------- 2 files changed, 224 insertions(+), 220 deletions(-) diff --git a/Dockerfile.dev b/Dockerfile.dev index 2827e8a2..1181cce9 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -18,7 +18,11 @@ RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -o $DEST/ FROM --platform=linux/amd64 alpine:latest AS server -COPY --from=build /build/volumes/modules /opt/echovault/bin/modules +RUN mkdir -p /usr/echovault/bin/modules +RUN mkdir -p /etc/ssl/certs/echovault/server +RUN mkdir -p /etc/ssl/certs/echovault/client + +COPY --from=build /build/volumes/modules /usr/echovault/bin/modules COPY --from=build /build/bin/server /usr/echovault/bin COPY ./openssl/server /etc/ssl/certs/echovault/server COPY ./openssl/client /etc/ssl/certs/echovault/client diff --git a/docker-compose.yaml b/docker-compose.yaml index 33ab5c94..6bf6432e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -48,222 +48,222 @@ services: networks: - testnet -# cluster_node_1: -# container_name: cluster_node_1 -# build: -# context: . -# dockerfile: Dockerfile.dev -# environment: -# - BIND_ADDR=0.0.0.0 -# - PORT=7480 -# - DISCOVERY_PORT=7946 -# - SERVER_ID=1 -# - JOIN_ADDR=2/cluster_node_2:7946 -# - DATA_DIR=/var/lib/echovault -# - TLS=false -# - MTLS=false -# - BOOTSTRAP_CLUSTER=true -# - ACL_CONFIG=/etc/echovault/config/acl.yml -# - REQUIRE_PASS=false -# - FORWARD_COMMAND=true -# - SNAPSHOT_THRESHOLD=1000 -# - SNAPSHOT_INTERVAL=5m30s -# - RESTORE_SNAPSHOT=false -# - RESTORE_AOF=false -# - AOF_SYNC_STRATEGY=everysec -# - MAX_MEMORY=100mb -# - EVICTION_POLICY=noeviction -# - EVICTION_SAMPLE=20 -# - EVICTION_INTERVAL=100ms -# # List of echovault cert/key pairs -# - CERT_KEY_PAIR_1=/etc/ssl/certs/echovault/server/server1.crt,/etc/ssl/certs/echovault/server/server1.key -# - CERT_KEY_PAIR_2=/etc/ssl/certs/echovault/server/server2.crt,/etc/ssl/certs/echovault/server/server2.key -# # List of client certificate authorities -# - CLIENT_CA_1=/etc/ssl/certs/echovault/client/rootCA.crt -# # List of shared object plugins to load on startup -# - MODULE_1=./modules/module_set/module_set.so -# - MODULE_2=./modules/module_get/module_get.so -# ports: -# - "7481:7480" -# - "7945:7946" -# volumes: -# - ./internal/volumes/config:/etc/echovault/config -# - ./internal/volumes/nodes/cluster_node_1:/var/lib/echovault -# networks: -# - testnet -# -# cluster_node_2: -# container_name: cluster_node_2 -# build: -# context: . -# dockerfile: Dockerfile.dev -# environment: -# - BIND_ADDR=0.0.0.0 -# - PORT=7480 -# - DISCOVERY_PORT=7946 -# - SERVER_ID=2 -# - JOIN_ADDR=3/cluster_node_3:7946 -# - DATA_DIR=/var/lib/echovault -# - TLS=false -# - MTLS=false -# - BOOTSTRAP_CLUSTER=false -# - ACL_CONFIG=/etc/echovault/config/acl.yml -# - REQUIRE_PASS=false -# - FORWARD_COMMAND=true -# - SNAPSHOT_THRESHOLD=1000 -# - SNAPSHOT_INTERVAL=5m30s -# - RESTORE_SNAPSHOT=false -# - RESTORE_AOF=false -# - AOF_SYNC_STRATEGY=everysec -# - MAX_MEMORY=100mb -# - EVICTION_POLICY=noeviction -# - EVICTION_SAMPLE=20 -# - EVICTION_INTERVAL=100ms -# # List of echovault cert/key pairs -# - CERT_KEY_PAIR_1=/etc/ssl/certs/echovault/server/server1.crt,/etc/ssl/certs/echovault/server/server1.key -# - CERT_KEY_PAIR_2=/etc/ssl/certs/echovault/server/server2.crt,/etc/ssl/certs/echovault/server/server2.key -# # List of client certificate authorities -# - CLIENT_CA_1=/etc/ssl/certs/echovault/client/rootCA.crt -# # List of shared object plugins to load on startup -# - MODULE_1=./modules/module_set/module_set.so -# - MODULE_2=./modules/module_get/module_get.so -# ports: -# - "7482:7480" -# - "7947:7946" -# volumes: -# - ./internal/volumes/config:/etc/echovault/config -# - ./internal/volumes/nodes/cluster_node_2:/var/lib/echovault -# networks: -# - testnet -# -# cluster_node_3: -# container_name: cluster_node_3 -# build: -# context: . -# dockerfile: Dockerfile.dev -# environment: -# - BIND_ADDR=0.0.0.0 -# - PORT=7480 -# - DISCOVERY_PORT=7946 -# - SERVER_ID=3 -# - JOIN_ADDR=4/cluster_node_4:7946 -# - DATA_DIR=/var/lib/echovault -# - TLS=false -# - MTLS=false -# - BOOTSTRAP_CLUSTER=false -# - ACL_CONFIG=/etc/echovault/config/acl.yml -# - REQUIRE_PASS=false -# - FORWARD_COMMAND=true -# - SNAPSHOT_THRESHOLD=1000 -# - SNAPSHOT_INTERVAL=5m30s -# - RESTORE_SNAPSHOT=false -# - RESTORE_AOF=false -# - AOF_SYNC_STRATEGY=everysec -# - MAX_MEMORY=100mb -# - EVICTION_POLICY=noeviction -# - EVICTION_SAMPLE=20 -# - EVICTION_INTERVAL=100ms -# # List of echovault cert/key pairs -# - CERT_KEY_PAIR_1=/etc/ssl/certs/echovault/server/server1.crt,/etc/ssl/certs/echovault/server/server1.key -# - CERT_KEY_PAIR_2=/etc/ssl/certs/echovault/server/server2.crt,/etc/ssl/certs/echovault/server/server2.key -# # List of client certificate authorities -# - CLIENT_CA_1=/etc/ssl/certs/echovault/client/rootCA.crt -# # List of shared object plugins to load on startup -# - MODULE_1=./modules/module_set/module_set.so -# - MODULE_2=./modules/module_get/module_get.so -# ports: -# - "7483:7480" -# - "7948:7946" -# volumes: -# - ./internal/volumes/config:/etc/echovault/config -# - ./internal/volumes/nodes/cluster_node_3:/var/lib/echovault -# networks: -# - testnet -# -# cluster_node_4: -# container_name: cluster_node_4 -# build: -# context: . -# dockerfile: Dockerfile.dev -# environment: -# - BIND_ADDR=0.0.0.0 -# - PORT=7480 -# - DISCOVERY_PORT=7946 -# - SERVER_ID=4 -# - JOIN_ADDR=5/cluster_node_5:7946 -# - DATA_DIR=/var/lib/echovault -# - TLS=false -# - MTLS=false -# - BOOTSTRAP_CLUSTER=false -# - ACL_CONFIG=/etc/echovault/config/acl.yml -# - REQUIRE_PASS=false -# - FORWARD_COMMAND=true -# - SNAPSHOT_THRESHOLD=1000 -# - SNAPSHOT_INTERVAL=5m30s -# - RESTORE_SNAPSHOT=false -# - RESTORE_AOF=false -# - AOF_SYNC_STRATEGY=everysec -# - MAX_MEMORY=100mb -# - EVICTION_POLICY=noeviction -# - EVICTION_SAMPLE=20 -# - EVICTION_INTERVAL=100ms -# # List of echovault cert/key pairs -# - CERT_KEY_PAIR_1=/etc/ssl/certs/echovault/server/server1.crt,/etc/ssl/certs/echovault/server/server1.key -# - CERT_KEY_PAIR_2=/etc/ssl/certs/echovault/server/server2.crt,/etc/ssl/certs/echovault/server/server2.key -# # List of client certificate authorities -# - CLIENT_CA_1=/etc/ssl/certs/echovault/client/rootCA.crt -# # List of shared object plugins to load on startup -# - MODULE_1=./modules/module_set/module_set.so -# - MODULE_2=./modules/module_get/module_get.so -# ports: -# - "7484:7480" -# - "7949:7946" -# volumes: -# - ./internal/volumes/config:/etc/echovault/config -# - ./internal/volumes/nodes/cluster_node_4:/var/lib/echovault -# networks: -# - testnet -# -# cluster_node_5: -# container_name: cluster_node_5 -# build: -# context: . -# dockerfile: Dockerfile.dev -# environment: -# - BIND_ADDR=0.0.0.0 -# - PORT=7480 -# - DISCOVERY_PORT=7946 -# - SERVER_ID=5 -# - JOIN_ADDR=1/cluster_node_1:7946 -# - DATA_DIR=/var/lib/echovault -# - TLS=false -# - MTLS=false -# - BOOTSTRAP_CLUSTER=false -# - ACL_CONFIG=/etc/echovault/config/acl.yml -# - REQUIRE_PASS=false -# - FORWARD_COMMAND=true -# - SNAPSHOT_THRESHOLD=1000 -# - SNAPSHOT_INTERVAL=5m30s -# - RESTORE_SNAPSHOT=false -# - RESTORE_AOF=false -# - AOF_SYNC_STRATEGY=everysec -# - MAX_MEMORY=100mb -# - EVICTION_POLICY=noeviction -# - EVICTION_SAMPLE=20 -# - EVICTION_INTERVAL=100ms -# # List of echovault cert/key pairs -# - CERT_KEY_PAIR_1=/etc/ssl/certs/echovault/server/server1.crt,/etc/ssl/certs/echovault/server/server1.key -# - CERT_KEY_PAIR_2=/etc/ssl/certs/echovault/server/server2.crt,/etc/ssl/certs/echovault/server/server2.key -# # List of client certificate authorities -# - CLIENT_CA_1=/etc/ssl/certs/echovault/client/rootCA.crt -# # List of shared object plugins to load on startup -# - MODULE_1=./modules/module_set/module_set.so -# - MODULE_2=./modules/module_get/module_get.so -# ports: -# - "7485:7480" -# - "7950:7946" -# volumes: -# - ./internal/volumes/config:/etc/echovault/config -# - ./internal/volumes/nodes/cluster_node_5:/var/lib/echovault -# networks: -# - testnet \ No newline at end of file + cluster_node_1: + container_name: cluster_node_1 + build: + context: . + dockerfile: Dockerfile.dev + environment: + - BIND_ADDR=0.0.0.0 + - PORT=7480 + - DISCOVERY_PORT=7946 + - SERVER_ID=1 + - JOIN_ADDR=2/cluster_node_2:7946 + - DATA_DIR=/var/lib/echovault + - TLS=false + - MTLS=false + - BOOTSTRAP_CLUSTER=true + - ACL_CONFIG=/etc/echovault/config/acl.yml + - REQUIRE_PASS=false + - FORWARD_COMMAND=true + - SNAPSHOT_THRESHOLD=1000 + - SNAPSHOT_INTERVAL=5m30s + - RESTORE_SNAPSHOT=false + - RESTORE_AOF=false + - AOF_SYNC_STRATEGY=everysec + - MAX_MEMORY=100mb + - EVICTION_POLICY=noeviction + - EVICTION_SAMPLE=20 + - EVICTION_INTERVAL=100ms + # List of echovault cert/key pairs + - CERT_KEY_PAIR_1=/etc/ssl/certs/echovault/server/server1.crt,/etc/ssl/certs/echovault/server/server1.key + - CERT_KEY_PAIR_2=/etc/ssl/certs/echovault/server/server2.crt,/etc/ssl/certs/echovault/server/server2.key + # List of client certificate authorities + - CLIENT_CA_1=/etc/ssl/certs/echovault/client/rootCA.crt + # List of shared object plugins to load on startup + - MODULE_1=./modules/module_set/module_set.so + - MODULE_2=./modules/module_get/module_get.so + ports: + - "7481:7480" + - "7945:7946" + volumes: + - ./internal/volumes/config:/etc/echovault/config + - ./internal/volumes/nodes/cluster_node_1:/var/lib/echovault + networks: + - testnet + + cluster_node_2: + container_name: cluster_node_2 + build: + context: . + dockerfile: Dockerfile.dev + environment: + - BIND_ADDR=0.0.0.0 + - PORT=7480 + - DISCOVERY_PORT=7946 + - SERVER_ID=2 + - JOIN_ADDR=3/cluster_node_3:7946 + - DATA_DIR=/var/lib/echovault + - TLS=false + - MTLS=false + - BOOTSTRAP_CLUSTER=false + - ACL_CONFIG=/etc/echovault/config/acl.yml + - REQUIRE_PASS=false + - FORWARD_COMMAND=true + - SNAPSHOT_THRESHOLD=1000 + - SNAPSHOT_INTERVAL=5m30s + - RESTORE_SNAPSHOT=false + - RESTORE_AOF=false + - AOF_SYNC_STRATEGY=everysec + - MAX_MEMORY=100mb + - EVICTION_POLICY=noeviction + - EVICTION_SAMPLE=20 + - EVICTION_INTERVAL=100ms + # List of echovault cert/key pairs + - CERT_KEY_PAIR_1=/etc/ssl/certs/echovault/server/server1.crt,/etc/ssl/certs/echovault/server/server1.key + - CERT_KEY_PAIR_2=/etc/ssl/certs/echovault/server/server2.crt,/etc/ssl/certs/echovault/server/server2.key + # List of client certificate authorities + - CLIENT_CA_1=/etc/ssl/certs/echovault/client/rootCA.crt + # List of shared object plugins to load on startup + - MODULE_1=./modules/module_set/module_set.so + - MODULE_2=./modules/module_get/module_get.so + ports: + - "7482:7480" + - "7947:7946" + volumes: + - ./internal/volumes/config:/etc/echovault/config + - ./internal/volumes/nodes/cluster_node_2:/var/lib/echovault + networks: + - testnet + + cluster_node_3: + container_name: cluster_node_3 + build: + context: . + dockerfile: Dockerfile.dev + environment: + - BIND_ADDR=0.0.0.0 + - PORT=7480 + - DISCOVERY_PORT=7946 + - SERVER_ID=3 + - JOIN_ADDR=4/cluster_node_4:7946 + - DATA_DIR=/var/lib/echovault + - TLS=false + - MTLS=false + - BOOTSTRAP_CLUSTER=false + - ACL_CONFIG=/etc/echovault/config/acl.yml + - REQUIRE_PASS=false + - FORWARD_COMMAND=true + - SNAPSHOT_THRESHOLD=1000 + - SNAPSHOT_INTERVAL=5m30s + - RESTORE_SNAPSHOT=false + - RESTORE_AOF=false + - AOF_SYNC_STRATEGY=everysec + - MAX_MEMORY=100mb + - EVICTION_POLICY=noeviction + - EVICTION_SAMPLE=20 + - EVICTION_INTERVAL=100ms + # List of echovault cert/key pairs + - CERT_KEY_PAIR_1=/etc/ssl/certs/echovault/server/server1.crt,/etc/ssl/certs/echovault/server/server1.key + - CERT_KEY_PAIR_2=/etc/ssl/certs/echovault/server/server2.crt,/etc/ssl/certs/echovault/server/server2.key + # List of client certificate authorities + - CLIENT_CA_1=/etc/ssl/certs/echovault/client/rootCA.crt + # List of shared object plugins to load on startup + - MODULE_1=./modules/module_set/module_set.so + - MODULE_2=./modules/module_get/module_get.so + ports: + - "7483:7480" + - "7948:7946" + volumes: + - ./internal/volumes/config:/etc/echovault/config + - ./internal/volumes/nodes/cluster_node_3:/var/lib/echovault + networks: + - testnet + + cluster_node_4: + container_name: cluster_node_4 + build: + context: . + dockerfile: Dockerfile.dev + environment: + - BIND_ADDR=0.0.0.0 + - PORT=7480 + - DISCOVERY_PORT=7946 + - SERVER_ID=4 + - JOIN_ADDR=5/cluster_node_5:7946 + - DATA_DIR=/var/lib/echovault + - TLS=false + - MTLS=false + - BOOTSTRAP_CLUSTER=false + - ACL_CONFIG=/etc/echovault/config/acl.yml + - REQUIRE_PASS=false + - FORWARD_COMMAND=true + - SNAPSHOT_THRESHOLD=1000 + - SNAPSHOT_INTERVAL=5m30s + - RESTORE_SNAPSHOT=false + - RESTORE_AOF=false + - AOF_SYNC_STRATEGY=everysec + - MAX_MEMORY=100mb + - EVICTION_POLICY=noeviction + - EVICTION_SAMPLE=20 + - EVICTION_INTERVAL=100ms + # List of echovault cert/key pairs + - CERT_KEY_PAIR_1=/etc/ssl/certs/echovault/server/server1.crt,/etc/ssl/certs/echovault/server/server1.key + - CERT_KEY_PAIR_2=/etc/ssl/certs/echovault/server/server2.crt,/etc/ssl/certs/echovault/server/server2.key + # List of client certificate authorities + - CLIENT_CA_1=/etc/ssl/certs/echovault/client/rootCA.crt + # List of shared object plugins to load on startup + - MODULE_1=./modules/module_set/module_set.so + - MODULE_2=./modules/module_get/module_get.so + ports: + - "7484:7480" + - "7949:7946" + volumes: + - ./internal/volumes/config:/etc/echovault/config + - ./internal/volumes/nodes/cluster_node_4:/var/lib/echovault + networks: + - testnet + + cluster_node_5: + container_name: cluster_node_5 + build: + context: . + dockerfile: Dockerfile.dev + environment: + - BIND_ADDR=0.0.0.0 + - PORT=7480 + - DISCOVERY_PORT=7946 + - SERVER_ID=5 + - JOIN_ADDR=1/cluster_node_1:7946 + - DATA_DIR=/var/lib/echovault + - TLS=false + - MTLS=false + - BOOTSTRAP_CLUSTER=false + - ACL_CONFIG=/etc/echovault/config/acl.yml + - REQUIRE_PASS=false + - FORWARD_COMMAND=true + - SNAPSHOT_THRESHOLD=1000 + - SNAPSHOT_INTERVAL=5m30s + - RESTORE_SNAPSHOT=false + - RESTORE_AOF=false + - AOF_SYNC_STRATEGY=everysec + - MAX_MEMORY=100mb + - EVICTION_POLICY=noeviction + - EVICTION_SAMPLE=20 + - EVICTION_INTERVAL=100ms + # List of echovault cert/key pairs + - CERT_KEY_PAIR_1=/etc/ssl/certs/echovault/server/server1.crt,/etc/ssl/certs/echovault/server/server1.key + - CERT_KEY_PAIR_2=/etc/ssl/certs/echovault/server/server2.crt,/etc/ssl/certs/echovault/server/server2.key + # List of client certificate authorities + - CLIENT_CA_1=/etc/ssl/certs/echovault/client/rootCA.crt + # List of shared object plugins to load on startup + - MODULE_1=./modules/module_set/module_set.so + - MODULE_2=./modules/module_get/module_get.so + ports: + - "7485:7480" + - "7950:7946" + volumes: + - ./internal/volumes/config:/etc/echovault/config + - ./internal/volumes/nodes/cluster_node_5:/var/lib/echovault + networks: + - testnet \ No newline at end of file