From a7df63fbccf2f7c3631f4f54b29bd1f339d26da5 Mon Sep 17 00:00:00 2001 From: tomyouyou Date: Wed, 5 Jan 2022 16:03:24 +0800 Subject: [PATCH] The wrong distribution listener IP address is recorded when it is configured. 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 fac249b755ea09ffb9ded707277c27bb6611a92d) (cherry picked from commit 74d39db445b9c3265ac4b39dfacfdaec002c82b0) --- deps/rabbit/src/rabbit_networking.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deps/rabbit/src/rabbit_networking.erl b/deps/rabbit/src/rabbit_networking.erl index b40751816cee..e1630e582ca7 100644 --- a/deps/rabbit/src/rabbit_networking.erl +++ b/deps/rabbit/src/rabbit_networking.erl @@ -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.