File tree Expand file tree Collapse file tree 4 files changed +24
-20
lines changed
src/examples/Cluster/ClusterSharding/ClusterSharding.Node Expand file tree Collapse file tree 4 files changed +24
-20
lines changed Original file line number Diff line number Diff line change 1
- FROM mcr.microsoft.com/dotnet/core/ runtime:3.1
2
- COPY ["./bin/Release/netcoreapp3.1 /publish" , "." ]
1
+ FROM mcr.microsoft.com/dotnet/runtime:8.0
2
+ COPY ["./bin/Release/net8.0 /publish" , "." ]
3
3
ENTRYPOINT ["dotnet" , "ClusterSharding.Node.dll" ]
Original file line number Diff line number Diff line change @@ -12,22 +12,22 @@ akka {
12
12
auto-down-unreachable-after = 5s
13
13
sharding {
14
14
remember-entities = on
15
- least-shard-allocation-strategy.rebalance-threshold = 3
15
+ least-shard-allocation-strategy.rebalance-absolute-limit = 3
16
16
state-store-mode = ddata
17
17
}
18
18
}
19
19
persistence {
20
20
journal {
21
21
plugin = "akka.persistence.journal.sqlite"
22
22
sqlite {
23
- connection-string = "Datasource=store.db"
23
+ connection-string = "Datasource=/data/ store.db"
24
24
auto-initialize = true
25
25
}
26
26
}
27
27
snapshot-store {
28
28
plugin = "akka.persistence.snapshot-store.sqlite"
29
29
sqlite {
30
- connection-string = "Datasource=store.db"
30
+ connection-string = "Datasource=/data/ store.db"
31
31
auto-initialize = true
32
32
}
33
33
}
Original file line number Diff line number Diff line change 1
- version : ' 3.7'
2
-
3
1
services :
4
2
node-1 :
5
3
image : cluster-sharding:latest
6
- network_mode : host
7
4
ports :
8
- - ' 6055:6055 '
5
+ - ' 6055'
9
6
environment :
10
- CLUSTER_IP : " localhost "
7
+ CLUSTER_IP : " node-1 "
11
8
CLUSTER_PORT : 6055
12
- CLUSTER_SEEDS : " akka.tcp://sharded-cluster-system@localhost:6055"
9
+ CLUSTER_SEEDS : " akka.tcp://sharded-cluster-system@node-1:6055"
10
+ volumes :
11
+ - data:/data:rw
13
12
14
13
node-2 :
15
14
image : cluster-sharding:latest
16
- network_mode : host
17
15
ports :
18
- - ' 6056:6056 '
16
+ - ' 6056'
19
17
environment :
20
- CLUSTER_IP : " localhost "
18
+ CLUSTER_IP : " node-2 "
21
19
CLUSTER_PORT : 6056
22
- CLUSTER_SEEDS : " akka.tcp://sharded-cluster-system@localhost:6055"
20
+ CLUSTER_SEEDS : " akka.tcp://sharded-cluster-system@node-1:6055"
21
+ volumes :
22
+ - data:/data:rw
23
23
24
24
node-3 :
25
25
image : cluster-sharding:latest
26
- network_mode : host
27
26
ports :
28
- - ' 6057:6057 '
27
+ - ' 6057'
29
28
environment :
30
- CLUSTER_IP : " localhost "
29
+ CLUSTER_IP : " node-3 "
31
30
CLUSTER_PORT : 6057
32
- CLUSTER_SEEDS : " akka.tcp://sharded-cluster-system@localhost:6055"
31
+ CLUSTER_SEEDS : " akka.tcp://sharded-cluster-system@node-1:6055"
32
+ volumes :
33
+ - data:/data:rw
34
+
35
+ volumes :
36
+ data : ~
Original file line number Diff line number Diff line change 1
1
dotnet publish -c Release
2
2
docker build -t cluster-sharding:latest .
3
- docker- compose up
3
+ docker compose up
You can’t perform that action at this time.
0 commit comments