64

I installed RabbitMQ server on OS X, and started it on command line. Now, it is not obvious that how I should stop it from running? After I did:

sudo rabbitmq-server -detached

I get:

Activating RabbitMQ plugins ...
0 plugins activated:

That was it. How should I properly shut it down? In the document, it mentions using rabbitmqctl(1), but it's not clear to me what that means. Thanks.

Edit: As per comment below, this is what I get for running sudo rabbitmqctl stop:

(project_env)mlstr-1:Package mlstr$ sudo rabbitmqctl stop
Password:
Stopping and halting node rabbit@h002 ...
Error: unable to connect to node rabbit@h002: nodedown

DIAGNOSTICS
===========

nodes in question: [rabbit@h002]

hosts, their running nodes and ports:
- h002: [{rabbit,62428},{rabbitmqctl7069,64735}]

current node details:
- node name: rabbitmqctl7069@h002
- home dir: /opt/local/var/lib/rabbitmq
- cookie hash: q7VU0JjCd0VG7jOEF9Hf/g==

Why is there still a 'current node'? I have not run any client program but only the RabbitMQ server, does that mean a server is still running?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
MLister
  • 10,022
  • 18
  • 64
  • 92

7 Answers7

90

It turns out that it is related to permissions. Somehow my rabbitmq server was started with user 'rabbitmq' (which is strange), so that I had to do

sudo -u rabbitmq rabbitmqctl stop
MLister
  • 10,022
  • 18
  • 64
  • 92
34

In my dev environment where I keep it running all the time, I use:

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.rabbitmq.plist

and to start it

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.rabbitmq.plist

Even easier....

brew services stop rabbitmq
brew services start rabbitmq
Mike Holdsworth
  • 1,088
  • 11
  • 12
29

Use rabbitmqctl stop to stop any node. If you need to specify the node giving you trouble, add the -n rabbit@[hostname] option.

Bonifacio2
  • 3,405
  • 6
  • 34
  • 54
Shaun
  • 3,928
  • 22
  • 21
2

You can also use the shortcut RabbitMQ Service - stop if you don't like the commands

snowr
  • 55
  • 1
  • 6
1

stop
sudo systemctl stop rabbitmq-server

start
sudo systemctl start rabbitmq-server

StasVo
  • 554
  • 6
  • 6
0

For Windows, use PowerShell as Admin, then run

.\rabbitmq-service.bat stop

stop Stop the service. The service must be running for this command to have any effect.

https://www.rabbitmq.com/man/rabbitmq-service.8.html


For OP's answer above,

It turns out that it is related to permissions.

I have no knowledge on this.

Nor.Z
  • 555
  • 1
  • 5
  • 13
0

For mac users

To Stop

brew services stop rabbitmq

To Start

brew services start rabbitmq

To Restart

brew services restart rabbitmq

To Know the status of the server

brew services info rabbitmq
Anjan Talatam
  • 2,212
  • 1
  • 12
  • 26