[rabbitmq-discuss] RabbitMQ on OSX - Having Problems...

Dmitriy Samovskiy dmitriy.samovskiy at cohesiveft.com
Sun May 17 02:47:59 BST 2009


Hi Tim,

Since net_adm:names() does not hang and returns a list which includes rabbit, looks to me 
like the problem is with cookies or something related which causes nodes not to be able to 
talk to each other.

So, assuming your broker is in fact running as user rabbitmq, I'd try this:

Check that home directory of user rabbitmq exists and is writeable by user rabbitmq.
If broker is running as rabbitmq, there should probably be a file in that dir called 
.erlang.cookie, owned by user rabbitmq.

You should be able to do su - rabbitmq and then erl -sname foo -remsh rabbit at HOSTNAME 
(HOSTNAME is probably going to be whatever is returned by net_adm:localhost() up to a 
first dot).

Alternatively, if you cat ~rabbitmq/.erlang.cookie and get cookie itself (e.g, COOKIE), as 
any user on your system, you should be able to do this:

erl -sname foo -remsg rabbit at HOSTNAME -cookie COOKIE


This error message is weird however:
 > timperrett$ sudo -u rabbitmq rabbitmq-server
 > {error_logger,{{2009,5,16},{11,34,45}},"Failed to create cookie file",[]}

To me it looks like there's something wrong with how user rabbitmq is set up on your 
system. Either it has no home dir, home dir is not defined or maybe it's not writeable.

I don't have any hands-on experience with running rabbitmq on Mac though, I run it only on 
Linux.

HTH,
Dmitriy



Tim Perrett wrote:
> Just reading this (for the n'th time!)
> 
> http://somic.org/2009/02/19/on-rabbitmqctl-and-badrpcnodedown/
> 
> When i run the the erl shell with: “erl -sname foo -cookie coo” and
> run this command: “net_adm:names().” I keep seeing the rabbit in the
> list (its my understanding that it should not feature there?)
> 
> Thoughts?
> 
> Cheers, Tim
> 
> On Sat, May 16, 2009 at 8:26 PM, Tim Perrett <tperrett at googlemail.com> wrote:
>> Hey Chris,
>>
>> I agree - thats why i started with the unix install. I just seem to be
>> having consistent problems right now. Anywho...
>>
>> Rabbit is up and running, i've actually not really had a problem with
>> getting the server booted, just dont appear to be able to get the
>> connection from rabbitmqctl - not overly helpfull as i need to
>> configure the server. I can telnet to it etc.
>>
>> I've been doing some digging, and looking at what processes are
>> running, i see both the rabbit server and the ctl coming up under the
>> "rabbitmq" user i've created on my system.
>>
>> Otherwise, the only thing that is not ringing true is that the
>> .erlang.cookie does not appear to be written to the place detailed on
>> the install guide:
>>
>> $MACPORTS_PREFIX/var/lib/rabbitmq/.erlang.cookie.
>>
>> Could it be that the rabbitmqctl cant find the cookie? perhaps?
>>
>> Cheers, Tim
>>
>> On Sat, May 16, 2009 at 7:30 PM, Chris Duncan <celldee at gmail.com> wrote:
>>> Hi Tim,
>>>
>>> The easiest way that I found to run RabbitMQ on OSX was to use the generic
>>> unix download -
>>> http://www.rabbitmq.com/releases/rabbitmq-server/v1.5.4/rabbitmq-server-generic-unix-1.5.4.tar.gz
>>>
>>> I installed Erlang via Macports so I unpacked the RabbitMQ .tar.gz into
>>> /opt/local/lib/erlang/lib
>>>
>>> Then I run the server with the command -
>>>
>>> sudo /opt/local/lib/erlang/lib/rabbitmq_server-1.5.4/sbin/rabbitmq-server
>>> -detached
>>>
>>> The '-detached' option runs it in the background. I run it as root because
>>> by default it wants to write to /var/log and I haven't gotten around to
>>> changing things.
>>>
>>> The rabbitmqctl command -
>>>
>>> /opt/local/lib/erlang/lib/rabbitmq_server-1.5.4/sbin/rabbitmqctl
>>>
>>> Obviously you can create aliases etc. to make life easier.
>>>
>>> HTH :)
>>>
>>> Regards,
>>>
>>> Chris
>>>
>>>
>>>
>>> On 16 May 2009, at 18:47, Tim Perrett wrote:
>>>
>>>> Ok, so I completely scrapped this and started again, this time with
>>>> macports to ensure it was nothing stupid i was doing causing the
>>>> problem. So, I installed via macports, and following the instructions:
>>>>
>>>> sudo -H -u rabbitmq rabbitmq-server
>>>>
>>>> Great I thought! It works out of the box... however, if i open another
>>>> terminal, the rabbitmqctl doesnt find the running server still.
>>>>
>>>> Any ideas? This is really starting to do my head in!
>>>>
>>>> Cheers, Tim
>>>>
>>>> On Sat, May 16, 2009 at 11:37 AM, Tim Perrett <tperrett at googlemail.com>
>>>> wrote:
>>>>> Sorry, just to add some more information - when I run:
>>>>>
>>>>> macbookpro:~ timperrett$ sudo rabbitmq-server
>>>>> RabbitMQ 1.5.4 (AMQP 8-0)
>>>>> Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial Technologies
>>>>> LLC., and Rabbit Technologies Ltd.
>>>>> Licensed under the MPL.  See http://www.rabbitmq.com/
>>>>>
>>>>> Logging to "/var/log/rabbitmq/rabbit.log"
>>>>> SASL logging to "/var/log/rabbitmq/rabbit-sasl.log"
>>>>>
>>>>> starting database             ...done
>>>>> starting core processes       ...done
>>>>> starting recovery             ...done
>>>>> starting persister            ...done
>>>>> starting guid generator       ...done
>>>>> starting builtin applications ...done
>>>>> starting TCP listeners        ...done
>>>>>
>>>>> broker running
>>>>>
>>>>> Then in another terminal I run:
>>>>>
>>>>> macbookpro:~ timperrett$ sudo rabbitmqctl status
>>>>> Status of node rabbit at macbookpro ...
>>>>> {badrpc,nodedown}
>>>>> ...done.
>>>>>
>>>>> I then tried:
>>>>>
>>>>> timperrett$ sudo -u rabbitmq rabbitmq-server
>>>>> {error_logger,{{2009,5,16},{11,34,45}},"Failed to create cookie file",[]}
>>>>>
>>>>> {error_logger,{{2009,5,16},{11,34,45}},crash_report,[[{initial_call,{auth,init,['Argument__1']}},{pid,<0.20.0>},{registered_name,[]},{error_info,{exit,{"Failed
>>>>> to create cookie
>>>>>
>>>>> file",[{auth,init_cookie,0},{auth,init,1},{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]},[{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}},{ancestors,[net_sup,kernel_sup,<0.9.0>]},{messages,[]},{links,[<0.18.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,610},{stack_size,24},{reductions,580}],[]]}
>>>>>
>>>>> {error_logger,{{2009,5,16},{11,34,45}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{"Failed
>>>>> to create cookie
>>>>>
>>>>> file",[{auth,init_cookie,0},{auth,init,1},{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}},{offender,[{pid,undefined},{name,auth},{mfa,{auth,start_link,[]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}
>>>>>
>>>>> {error_logger,{{2009,5,16},{11,34,45}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,shutdown},{offender,[{pid,undefined},{name,net_sup},{mfa,{erl_distribution,start_link,[]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]}
>>>>>
>>>>> {error_logger,{{2009,5,16},{11,34,45}},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,[]]}}})
>>>>>
>>>>> Thanks
>>>>>
>>>>> Tim
>>>>>
>>>>>
>>>>> On Sat, May 16, 2009 at 11:22 AM, Tim Perrett <tperrett at googlemail.com>
>>>>> wrote:
>>>>>> Guys,
>>>>>>
>>>>>> This is probably a very noobie question, but everything was previously
>>>>>> working perfectly, and now its just broken. For some reason
>>>>>> rabbitmqctl appears to not be able to see the running broker? I worked
>>>>>> through this post:
>>>>>>
>>>>>> http://somic.org/2009/02/19/on-rabbitmqctl-and-badrpcnodedown/
>>>>>>
>>>>>> And based on whats detailed there, he suggests its an issue with
>>>>>> rabbitmq not running as the rabbitmq user? Im running on OSX and did a
>>>>>> manual install.
>>>>>>
>>>>>> Any advice / help is greatly appreciated.
>>>>>>
>>>>>> Thanks, Tim
>>>>>>
>>>> _______________________________________________
>>>> rabbitmq-discuss mailing list
>>>> rabbitmq-discuss at lists.rabbitmq.com
>>>> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>>>
> 
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> 




More information about the rabbitmq-discuss mailing list