9

I am trying to start a node app and I think rabbitmq is getting in the way.

Similar to this thread: "node with name "rabbit" already running", but also "unable to connect to node 'rabbit'"

$ ps aux | grep erl
rabbitmq  1327  0.0  0.0   2376   300 ?        S    Dec13   0:00 /usr/lib/erlang/erts-5.8.5/bin/epmd -daemon
rabbitmq  1344  0.0  0.3  59560 14888 ?        Sl   Dec13   0:10 /usr/lib/erlang/erts-5.8.5/bin/beam.smp -W w -K true -A30 -P 1048576 -- -root /usr/lib/erlang -progname erl -- -home /var/lib/rabbitmq -- -noshell -noinput -sname rabbit@jasonshark -boot /var/lib/rabbitmq/mnesia/rabbit@jasonshark-plugins-expand/rabbit -kernel inet_default_connect_options [{nodelay,true}] -sasl errlog_type error -sasl sasl_error_logger false -rabbit error_logger {file,"/var/log/rabbitmq/rabbit@jasonshark.log"} -rabbit sasl_error_logger {file,"/var/log/rabbitmq/rabbit@jasonshark-sasl.log"} -os_mon start_cpu_sup true -os_mon start_disksup false -os_mon start_memsup false -mnesia dir "/var/lib/rabbitmq/mnesia/rabbit@jasonshark"
rabbitmq  1700  0.0  0.0   2136   284 ?        Ss   Dec13   0:00 /usr/lib/erlang/lib/os_mon-2.2.7/priv/bin/cpu_sup
1000     15564  0.0  0.0   4392   820 pts/1    S+   19:23   0:00 grep --color=auto erl

I know I need to run kill -9 {pid of rabbitmq process} now, but which number is the pid?

How do I stop everything to do with rabbitmq, I don't want it interfering with my node js

Community
  • 1
  • 1
Connor Leech
  • 18,052
  • 30
  • 105
  • 150

6 Answers6

16

You have a couple of options:

  1. First, try shutting RabbitMQ down gracefully with the init.d script sudo /etc/init.d/rabbitmq-server stop
  2. If that doesn't work, use ps -eaf | grep erl to find the process and parent ids. The third column in the output is the parent process ID. Find the first ancestor of all the processes that is still the erlang process (not the shell script that started it) and kill that. This should terminate the other sub processes. If not, kill those manually.
lreeder
  • 12,047
  • 2
  • 56
  • 65
9

I just started using RabbitMQ today and learned that you can cleanly shutdown a rabbitmq-server process by using the command rabbitmqctl stop.

This may not apply to your situation since you don't seem to be the person who launched rabbitmq on your server in the first place but if you have rabbitmqctl in your path, you can try using it to attempt a clean shutdown.

Ken Anderson
  • 2,403
  • 2
  • 13
  • 7
3

This worked for me (on Linux), when stopping gracefully didn't:

sudo pkill beam.smp

where beam.smp is name of parent RabbitMQ process in most recent version.

user11153
  • 8,536
  • 5
  • 47
  • 50
  • 1
    this works for a few seconds and it comes right back. rabbitmq is like a freaken virus. it won't go away. – thang Jun 20 '18 at 17:10
2

On Ubuntu 18.04, the thing that worked for me was:

service rabbitmq-server stop

You may also run:

service rabbitmq-server start

to start it again.

tjurkan
  • 477
  • 5
  • 11
1

If you have pgrep in your system, then you could just

pgrep <proc_name>

It will output a list of pids you can use to kill them

bevacqua
  • 47,502
  • 56
  • 171
  • 285
1

If you used brew when installing, you can use brew services restart rabbitmq, brew services start rabbitmq, brew services stop rabbitmq

obzenner
  • 355
  • 3
  • 12