[rabbitmq-discuss] Plz give me help about EPMD: Non-local peer connected

何斌 hebin7611 at hotmail.com
Fri Jul 6 06:53:20 BST 2012


Hi all,

I installed RabbotMQ & tried to start it.

But I always got error as following:

{error_logger,{{2012,7,6},{13,32,21}},"Protocol: ~p: register error: ~p~n",["inet_tcp",{{badmatch,{error,epmd_close}},[{inet_tcp_dist,listen,1,[{file,"inet_tcp_dist.erl"},{line,70}]},{net_kernel,start_protos,4,[{file,"net_kernel.erl"},{line,1314}]},{net_kernel,start_protos,3,[{file,"net_kernel.erl"},{line,1307}]},{net_kernel,init_node,2,[{file,"net_kernel.erl"},{line,1197}]},{net_kernel,init,1,[{file,"net_kernel.erl"},{line,357}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}]}
{error_logger,{{2012,7,6},{13,32,21}},crash_report,[[{initial_call,{net_kernel,init,['Argument__1']}},{pid,<0.20.0>},{registered_name,[]},{error_info,{exit,{error,badarg},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,320}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}},{ancestors,[net_sup,kernel_sup,<0.9.0>]},{messages,[]},{links,[#Port<0.90>,<0.17.0>]},{dictionary,[{longnames,false}]},{trap_exit,true},{status,running},{heap_size,987},{stack_size,24},{reductions,551}],[]]}
{error_logger,{{2012,7,6},{13,32,21}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{'EXIT',nodistribution}},{offender,[{pid,undefined},{name,net_kernel},{mfargs,{net_kernel,start_link,[[rabbitmqprelaunch1077,shortnames]]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}
{error_logger,{{2012,7,6},{13,32,21}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,shutdown},{offender,[{pid,undefined},{name,net_sup},{mfargs,{erl_distribution,start_link,[]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]}
{error_logger,{{2012,7,6},{13,32,21}},std_info,[{application,kernel},{exited,{shutdown,{kernel,start,[normal,[]]}}},{type,permanent}]}
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}}"}

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}})


I ran it on a server with public IP 183.*.*.* .

In Erlang src, I found that epmd checks connection src. 

      /* Determine if connection is from localhost */
      if (getpeername(s->fd,(struct sockaddr*) &si,&st) ||
          st < sizeof(si)) {
          /* Failure to get peername is regarded as non local host */
          s->local_peer = EPMD_FALSE;
      } else {
          /* Only 127.x.x.x and connections from the host's IP address
             allowed, no false positives */
          s->local_peer =
              (((((unsigned) ntohl(si.sin_addr.s_addr)) & 0xFF000000U) ==
               0x7F000000U) ||
               (getsockname(s->fd,(struct sockaddr*) &di,&st) ?
               EPMD_FALSE : si.sin_addr.s_addr == di.sin_addr.s_addr));
      }
      dbg_tty_printf(g,2,(s->local_peer) ? "Local peer connected" :
                     "Non-local peer connected");


But unfortunately, si.sin_addr.s_addr was 183.*.*.*, while di.sin_addr.s_addr was 127.0.0.1

My log:Checking peer address, getsockname ret: 0, si_addr=0xb7??????, di_addr=0x7f000001

Is there any way to force RabbitMQ server connect epmd via a specified address?

Thanks a lot.

He Bin

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120706/ba3431fe/attachment.htm>


More information about the rabbitmq-discuss mailing list