feat: Configrued the `chat-backend` with a working static sharding
authorKai Moritz <kai@juplo.de>
Sun, 15 Jan 2023 19:06:09 +0000 (20:06 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 15 Jan 2023 19:06:09 +0000 (20:06 +0100)
docker-compose.yml
sharding.map

index 7034fe5..3773f15 100644 (file)
@@ -105,15 +105,36 @@ services:
       - 8404:8404
 
   backend-1:
-    image: jmalloc/echo-server:latest
+    image: juplo/chat-backend:0.0.1-SNAPSHOT
+    environment:
+      chat.backend.inmemory.sharding-strategy: kafkalike
+      chat.backend.inmemory.num-shards: 10
+      chat.backend.inmemory.owned-shards: 1, 3, 4, 9
+      chat.backend.inmemory.storage-strategy: mongodb
+      spring.data.mongodb.host: mongo
+      spring.data.mongodb.database: test
     ports:
       - 8081:8080
   backend-2:
-    image: jmalloc/echo-server:latest
+    image: juplo/chat-backend:0.0.1-SNAPSHOT
+    environment:
+      chat.backend.inmemory.sharding-strategy: kafkalike
+      chat.backend.inmemory.num-shards: 10
+      chat.backend.inmemory.owned-shards: 0, 2, 7
+      chat.backend.inmemory.storage-strategy: mongodb
+      spring.data.mongodb.host: mongo
+      spring.data.mongodb.database: test
     ports:
       - 8082:8080
   backend-3:
-    image: jmalloc/echo-server:latest
+    image: juplo/chat-backend:0.0.1-SNAPSHOT
+    environment:
+      chat.backend.inmemory.sharding-strategy: kafkalike
+      chat.backend.inmemory.num-shards: 10
+      chat.backend.inmemory.owned-shards: 5, 6, 8
+      chat.backend.inmemory.storage-strategy: mongodb
+      spring.data.mongodb.host: mongo
+      spring.data.mongodb.database: test
     ports:
       - 8083:8080
 
index ffdbb6c..2a278b0 100644 (file)
@@ -1,10 +1,10 @@
-0 backend_3
+0 backend_2
 1 backend_1
 2 backend_2
-3 backend_3
+3 backend_1
 4 backend_1
-5 backend_2
+5 backend_3
 6 backend_3
-7 backend_1
-8 backend_2
-9 backend_3
+7 backend_2
+8 backend_3
+9 backend_1