fix: run observer_web as hidden node to stop OTP global splitting IFT Mnesia cluster.
Without --hidden, observer joins the visible mesh and prevent_overlapping_partitions disconnects eventhub-node1/2 (running_partitioned_network → admin verification-token 404 in e2e).
This commit is contained in:
Regular → Executable
+4
-1
@@ -39,4 +39,7 @@ COPY docker/observer_web/dev.exs ./dev.exs
|
||||
EXPOSE 4000
|
||||
|
||||
ENV RELEASE_COOKIE=eventhub_cookie
|
||||
CMD elixir --sname observer_web@observer_web --cookie "${RELEASE_COOKIE}" -S mix run --no-halt dev.exs
|
||||
# --hidden: observer must not join the visible global mesh. Without it, OTP
|
||||
# prevent_overlapping_partitions disconnects eventhub-node1 <-> eventhub-node2
|
||||
# when observer connects to both (Mnesia running_partitioned_network → e2e 404).
|
||||
CMD elixir --hidden --sname observer_web@observer_web --cookie "${RELEASE_COOKIE}" -S mix run --no-halt dev.exs
|
||||
|
||||
Regular → Executable
+8
-1
@@ -16,14 +16,21 @@ discover_loop() ->
|
||||
io:format("Checking epmd on ~s...~n", [IPStr]),
|
||||
case erl_epmd:names(IP) of
|
||||
{ok, List} ->
|
||||
%% Only eventhub-node* — connecting to observer_web (same cookie)
|
||||
%% triggers OTP prevent_overlapping_partitions and splits the mesh.
|
||||
lists:foreach(fun({Name, _Port}) ->
|
||||
case lists:prefix("eventhub-node", Name) of
|
||||
false ->
|
||||
ok;
|
||||
true ->
|
||||
Node = list_to_atom(Name ++ "@" ++ Name),
|
||||
io:format(" Trying net_kernel:connect_node(~s)...~n", [Node]),
|
||||
case net_kernel:connect_node(Node) of
|
||||
true -> io:format(" *** Connected to ~s ***~n", [Node]), join_and_replicate(Node); %io:format(" *** Connected to ~s ***~n", [Node]);
|
||||
true -> io:format(" *** Connected to ~s ***~n", [Node]), join_and_replicate(Node);
|
||||
false -> io:format(" *** Failed to connect to ~s ***~n", [Node]);
|
||||
ignored -> ok
|
||||
end
|
||||
end
|
||||
end, List);
|
||||
{error, Reason} ->
|
||||
io:format(" epmd error on ~s: ~p~n", [IPStr, Reason])
|
||||
|
||||
Reference in New Issue
Block a user