Brew Rabbitmq

Posted on  by admin

If you are using a Mac, RabbitMQ can be installed using Homebrew by typing brew install rabbitmq. This installs the management plug-in automatically. Once installed, type brew services start rabbitmq and accept the prompts to enable network ports. If you are using a Mac, RabbitMQ can be installed using Homebrew (opens new window) by typing brew install rabbitmq. This installs the management plug-in automatically. Once installed, type brew services start rabbitmq and accept the prompts to enable network ports. # To install RabbitMQ manually: Install Erlang using the installer (opens new.


In this tutorial we will learn to install PostgreSQL database on Mac using Homebrew.

Prerequisite

It is assumed that you have Homebrew installed on your Mac.

If you don't have Homebrew installed on your Mac then open Terminal and run the following command.

You can visit Homebrew official website https://brew.sh to learn more about it.

Once you have Homebrew (a.k.a. brew) installed on your machine you can run the following command in the Terminal to check the version.

To update run the following command.

Alright, time to install PostgreSQL on Mac.

Install PostgreSQL using Homebrew

In Terminal run the following command to install PostgreSQL on Mac using Homebrew.

We can check the version of PostgreSQL using the psql command.

Start PostgreSQL

To start PostgreSQL run the following command in the Terminal.

We will get a similar output shown below.

Stop PostgreSQL

To stop PostgreSQL run the following command in the Terminal.

We will get a similar output.

Restart PostgreSQL

To restart PostgreSQL run the following command in the Terminal.

We will get a similar output as shown below.

Login to PostgreSQL database

By default we will get a database by the name postgres. So, to connect to it we will run the following command.

We will see the following output.

Rabbitmq

List all the users

To list all the users we use the du command.

List all the databases

To list all the databases run the l command.

Create a database

To create a database run the following command. In the given example mydb is the name of the database.

Connect to a database

To connect to a database use the c command.

List all the tables inside a database

To list all the tables inside a database we run the d command.

Note! If there is no table then we will get a prompt stating no relations found.

Let us go ahead and create a simple users table inside the mydb database and try the above command again.

Create table

In the following example we are creating a simple users table.

Now if we list the tables using the d command we will get the table.

How to exit from psql?

To exit or quit from psql type the q command.

Alright, this brings us to the end of this tutorial. Hope you found it useful. Please share this tutorial if it was helpful. See you in the next tutorial. Have fun developing :-)


In this tutorial, we will learn to install RabbitMQ on Mac using Homebrew.

RabbitMQ is an open source message broker software. It is lightweight and easy to deploy. It supports AMQP (Advanced Message Queuing Protocol), STOMP (Streaming Text Oriented Messaging Protocol), MQTT (Message Queuing Telemetry Transport) and other protocols.

Alright, let's install RabbitMQ on Mac using Homebrew.

Step 1: Install Homebrew

Homebrew is 'The missing package manager for macOS'.

Installing applications and packages using Homebrew on Mac is super easy. I will recommend you to use Homebrew if you are a developer and use Mac for dev work.

Okay, open Terminal and type the following command.

Once you have Homebrew installed on your Mac, type the following command to check the version.

At the time of writing this tutorial I was using v2.0.1.

Already have Homebrew?

If you already have Homebrew installed on your Mac then run the following command to update it.

This will update the packages. If you have the latest updates then you will get the following output.

Step 2: Install RabbitMQ using Homebrew

Now, run the following command in Terminal to install RabbitMQ.

Step 3: Add to PATH

RabbitMQ server and CLI script are installed under /usr/local/sbin. Add this to PATH.

I have added the following to .bash_profile file.

Brew Rabbitmq Location

Inside the .bash_profile file.

Where are the RabbitMQ server and CLI tools present?

RabbitMQ server and CLI tools are generally inside /usr/local/Cellar/rabbitmq/{version}/sbin/ directory.

On my Mac the RabbitMQ server and CLI tools are present inside the /usr/local/Cellar/rabbitmq/3.7.11/sbin/ directory.

Step 4: Start RabbitMQ server

To start the RabbitMQ run the following command.

Step 5: Access dashboard

We can access RabbitMQ web dashboard by going to http://localhost:15672 so, open the link in your favourite browser.

The default username and password is guest and guest respectively.


RabbitMQ dashboard.


Step 6: Stop RabbitMQ server

To stop RabbitMQ press Ctrl + C.

Brew Rabbitmq-server Command Not Found

Possible errors

We may get an error like The `brew link` step did not complete successfully when trying to install RabbitMQ.

To fix this we have to run the following command.

We get the error /usr/local/sbin is not writable message.

This is because /usr/local/sbin directory is not present. So, go to /etc/paths.d directory and created a file named usr_local_sbin and write the path /usr/local/sbin inside the file and save it.

Inside usr_local_sbin file:

Now, create /usr/local/sbin directory.

Brew Rabbitmq Logs

Now change the ownership. Type whoami to get your username. Mine is yusufshakeel so, I will use the following.

Now run the brew link rabbitmq command.

Linking is done!

Brew Rabbitmq-plugins

Please share this tutorial on social media if you find it useful and interesting. See you again in the next tutorial. Have fun :-)