Install Rabbit MQ
There are many ways to install rabbit-mq as given below.
Using Homebrew
Homebrew has made the life easy to install the Rabbit-MQ in mac. Please refer below link to install the rabbit MQ.https://www.rabbitmq.com/install-homebrew.html
Once it is installed, below command can be executed to start & stop rabbit MQ.
Start Rabbit MQ:
/usr/local/opt/rabbitmq/sbin/rabbitmq-serverStop Rabbit MQ:
/usr/local/opt/rabbitmq/sbin/rabbitmqctl stop
Using Docker
With docker it's very easy to install, we just need to pull the image and run it by executing simple command. Assuming you already have dcoker installed in your machine, you can install and run rabbit-mq using below steps.
Pull rabbit-mq image without management console.
docker pull rabbitmq:latest
Pull rabbit-mq image with management console. It is required to enable the UI for management console.
docker pull rabbitmq:3-management
Execute below command to run the image in container named "local_rabbitmq". It will create the container and start rabbit-mq. Latter you can run rabbit-mq by starting the container only (docker start local_rabbitmq).
docker run --hostname rabbitmq.local --name local_rabbitmq -p 15672:15672 rabbitmq:3-management
Execute below command to stop rabbit-mq container.
docker stop local_rabbitmq
Note: There could be other options also to get rabbit-mq like having it in cloud. For development also you can create some free developer account in cloud and get rabbit-mq running there.
Check management console
Enter below URL in browser to access the rabbitmq management console.http://localhost:15672/
Enter guest/guest as username/password on login screen and you will se below screen upon successful login.
Verify the Virtual Host
Login to Rabbit-MQ management console (http://localhost:15672/) and go to "Admin" tab, then click on the "Virtual Hosts" link to see the virtual host details. See the below screenshot.If you see the state as "Stopped" in above screen then you need to check the logs at below location. Location may defer as per your installation.
/usr/local/var/log/rabbitmq/rabbit@localhost.logIf you find something in logs complaining about access inside "/usr/local/var/lib/rabbitmq/mnesia/" any of the subdirectory or file, then you need to stop the rabbitmq and then clean that directory using below commands in sequence. After that start the rabbitmq and check the vhost status if it running successfully. See the below steps.
- Stop rabbit-mq.
/usr/local/opt/rabbitmq/sbin/rabbitmqctl stop
cd /usr/local/var/lib/rabbitmq/mnesia sudo rm -rf *
/usr/local/opt/rabbitmq/sbin/rabbitmq-serverNow verify the localhost log in the mentioned log location and check the vhost status in Rabbit-MQ.
Comments
Post a Comment