In one console,
docker-compose up
When the nodes are ready, in another console,
docker exec antidote1 ./connect.erl 3
P.S. above setup is adapted directly from AntidoteDB documentation.
In one console,
docker-compose up
When the nodes are ready, in another console,
docker exec antidote1 ./connect.erl 3
P.S. above setup is adapted directly from AntidoteDB documentation.
#!/usr/bin/env escript | |
%%! -smp enable -sname erlshell -setcookie antidote | |
main([St]) -> | |
NumDC = list_to_integer(St), | |
io:format("AntidoteDB: setting up cluster for ~p datacenters!~n", [NumDC]), | |
DCs = lists:map(fun(Num) -> list_to_atom(lists:flatten(io_lib:format("antidote@antidote~w", [Num]))) end, lists:seq(1, NumDC)), | |
lists:foreach(fun(DC) -> rpc:call(DC, inter_dc_manager, start_bg_processes, [stable]) end, DCs), | |
Descriptors = lists:map(fun(DC) -> {ok, Desc} = rpc:call(DC, inter_dc_manager, get_descriptor, []), Desc end, DCs), | |
lists:foreach(fun(DC) -> rpc:call(DC, inter_dc_manager, observe_dcs_sync, [Descriptors]) end, DCs), | |
io:format("Done.~n"). |
version: "3.7" | |
services: | |
antidote1: | |
build: . | |
hostname: antidote1 | |
container_name: antidote1 | |
environment: | |
SHORT_NAME: "true" | |
NODE_NAME: antidote@antidote1 | |
antidote2: | |
build: . | |
hostname: antidote2 | |
container_name: antidote2 | |
environment: | |
SHORT_NAME: "true" | |
NODE_NAME: antidote@antidote2 | |
antidote3: | |
build: . | |
hostname: antidote3 | |
container_name: antidote3 | |
environment: | |
SHORT_NAME: "true" | |
NODE_NAME: antidote@antidote3 |
FROM antidotedb/antidote | |
ADD connect.erl connect.erl | |
RUN chmod u+x connect.erl |