Skip to content

Commit

Permalink
The wrong distribution listener IP address is recorded when it is con…
Browse files Browse the repository at this point in the history
…figured.

Add an item to the configuration file(/etc/rabbitmq/rabbitmq.config):
{kernel, [{inet_dist_use_interface, {8193,291,0,0,0,0,0,1}}]}

Use the netstat command to check the IP address of the distribution port(25672):
netstat -anp | grep 25672
tcp6       0      0 2001:123::1:25672       :::*                    LISTEN      2075/beam.smp

However, 'rabbitmqctl status' shows:
...
Interface: [::], port: 25672, protocol: clustering, purpose: inter-node and CLI tool communication
...

(cherry picked from commit fac249b)
(cherry picked from commit 74d39db)
  • Loading branch information
tomyouyou authored and mergify-bot committed Jan 5, 2022
1 parent b3a8ff2 commit a7df63f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion deps/rabbit/src/rabbit_networking.erl
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,12 @@ record_distribution_listener() ->
{Name, Host} = rabbit_nodes:parts(node()),
case erl_epmd:port_please(list_to_atom(Name), Host, infinity) of
{port, Port, _Version} ->
tcp_listener_started(clustering, [], {0,0,0,0,0,0,0,0}, Port);
IPAddress =
case application:get_env(kernel, inet_dist_use_interface) of
{ok, IP} -> IP;
_ -> {0,0,0,0,0,0,0,0}
end,
tcp_listener_started(clustering, [], IPAddress, Port);
noport ->
throw({error, no_epmd_port})
end.
Expand Down

0 comments on commit a7df63f

Please sign in to comment.