Execute RabbitMQ using the erlang parameter “-run observer”.

383 views
Skip to first unread message

GaS

unread,
May 31, 2015, 2:50:48 AM5/31/15
to rabbitm...@googlegroups.com

Hello,

I’m trying to execute RabbitMQ using the erlang parameter “-run observer”.

In windows it works correctly just added:

"!ERLANG_HOME!\bin\erl.exe" ^ -run observer ^

(see the attach)


I tried to do the same on my mac in different ways:

  • Modified the “rabbitmq-server” and I get this this error:

     {"init terminating in do_boot",{undef,[{observer,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}}

  • Tried to add it using RABBITMQ_SERVER_ERL_ARGS, and Rabbit starts without execute the observer.   



I tried to execute “erl -run observer” and works correctly.


Is there a way to enable the parameter ?

Environment :

Yosemite

Last erlang version.

Last rabbitmq version.


( Mine it is just a test)

Thank you.

Gabriele
monitor.png

Michael Klishin

unread,
May 31, 2015, 3:49:10 AM5/31/15
to GaS, rabbitm...@googlegroups.com
On 31 May 2015 at 09:50:50, GaS (g.sant...@gmail.com) wrote:
> I tried to execute “erl -run observer” and works correctly.
>
> Is there a way to enable the parameter ?

-run defines what app will be started when the runtime initialises. RabbitMQ already
sets that parameter and it cannot have 2 values (just like a program in every language I've ever tried cannot
have two entry functions/scopes).

If you want to run the observer app on a RabbitMQ node, you can start RabbitMQ
with RABBITMQ_ALLOW_INPUT set to true, hit enter a few times to drop in the shell,
and run observer:start(). This is what I personally do when I need observer
during development or when debugging an issue report.

Alternatively you can create a plugin that's a single exported function that runs
RabbitMQ after observer, then patch rabbitmq-server to use that function as a starting
point. One of our plugins (that's soon to be open sourced) is enabled that way. 
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


Michael Klishin

unread,
May 31, 2015, 4:09:53 AM5/31/15
to GaS, rabbitm...@googlegroups.com
 On 31 May 2015 at 10:49:06, Michael Klishin (mkli...@pivotal.io) wrote:
> If you want to run the observer app on a RabbitMQ node, you can
> start RabbitMQ
> with RABBITMQ_ALLOW_INPUT set to true, hit enter a few times
> to drop in the shell,
> and run observer:start(). This is what I personally do when I
> need observer
> during development or when debugging an issue report.

Also, you can connect to a remote node and control it:
http://erlang.org/pipermail/erlang-questions/2013-January/071785.html

be VERY CAREFUL about exiting the shell because everything you run
(e.g. init:stop/0) will be executed on the remote node, and you can shut it down.

GaS

unread,
Jun 1, 2015, 10:05:13 AM6/1/15
to rabbitm...@googlegroups.com, g.sant...@gmail.com
Thank you Michael, I solved and now it works.

I comment the line 
#ERL_DIR=${RABBITMQ_HOME}/erts-6.4/bin/
on the file rabbitmq-defaults and now I use system Erlang installation.

Then I executed:
sudo ./rabbitmq-server

.....
(rabbit@gabrieleMacBook)1>
(rabbit@gabrieleMacBook)1> observer:start().
ok

Alvaro Videla

unread,
Jun 1, 2015, 10:12:54 AM6/1/15
to GaS, rabbitm...@googlegroups.com
RabbitMQ for Mac (installed via homebrew or our "standalone" package) uses an Erlang distribution that doesn't ship the Observer Application.

Doing "ls lib" inside the standalone rabbitmq folder will show you which libs we ship:

 ls lib/
asn1-3.0.4/      crypto-3.5/      eldap-1.1.1/     inets-5.10.6/    kernel-3.2/      mnesia-4.12.5/   os_mon-2.3.1/    public_key-0.23/ sasl-2.4.1/      ssl-6.0/         stdlib-2.4/      xmerl-1.3.7/

If you want to use Observer on a Mac, then install the "generic-unix" RabbitMQ distribution + Erlang.


--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

GaS

unread,
Jun 1, 2015, 12:55:16 PM6/1/15
to rabbitm...@googlegroups.com
Thank you Alvaro,
I knew that, what I didn't know is that I can't set ERL_DIR variable, since it is override by rabbitmq-defaults file. 
Anyway, now it works fine. 
Reply all
Reply to author
Forward
0 new messages