Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Installing RabbitMQ With Erlang on AWS EC2 Amazon Linux Instance

DZone's Guide to

Installing RabbitMQ With Erlang on AWS EC2 Amazon Linux Instance

In this article, we're going to see how to combine this suite of popular technologies to create a development environment. Read on for more!

· Integration Zone ·
Free Resource

How to Transform Your Business in the Digital Age: Learn how organizations are re-architecting their integration strategy with data-driven app integration for true digital transformation.

Today, we are going to install Erlang version 20.1 and RabbitMQ 3.7 on an Amazon EC2 instance which has an Amazon Linux version installed in it. In a nutshell, we can say that Amazon Linux can be considered equivalent to CentOS 6.

I am not going to eat up your times, so I'll just jump directly into the commands that you have to execute on your new instance. Before we start, please ensure:

  1. You have the administrative privileges. 
  2. Java 8 is installed.

Briefly, to install RabbitMQ, we would need Erlang and Socat to be installed first.

Installing Erlang Version 20.1

Erlang is also a language which needs to be installed. Use the following commands to install Erlang.

# cd /opt
# wget https://github.com/rabbitmq/erlang-rpm/releases/download/v20.1.7/erlang-20.1.7-1.el6.x86_64.rpm
# rpm -ivh erlang-20.1.7-1.el6.x86_64.rpm

Installing Socat

This is the package which is needed to install RabbitMQ V 3.7, so install it beforehand with the following command:

# yum install socat

Installing RabbitMQ v3.7.0

So now the ground is ready to install the RabbitMQ server. Use the following commands to proceed:

# wget https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.0/rabbitmq-server-3.7.0-1.el6.noarch.rpm
# rpm -ivhrabbitmq-server-3.7.0-1.el6.noarch.rpm
# service rabbitmq-server start

Now we have to make sure that RabbitMQ is up as a service as soon as the server starts up. To do this, execute the following command: 

# chkconfigrabbitmq-server on

To access the RabbitMQ Management Console on the web, we need to enable the plugin. To do so execute the following command:

#  cd /usr/lib/rabbitmq/bin/
# rabbitmq-plugins enable rabbitmq_management
# cd /etc/rabbitmq/
# vim rabbitmq.config
[{rabbit, [{tcp_listeners, [{"", 5672}]},{loopback_users, []}]}].
Esc+:wq! (To save file and exit editor)

Now you can access RabbitMQ on the browser using:

http://<IP_Of_Your_AWS_Machine>:15672/

To log in, use guest/guest as the default password, which you can change later.

Congratulations, you did it!

Do share your thoughts if you have any queries or suggestions. 

Thanks!

Ajay Sodhi

Make your mark on the industry’s leading annual report. Fill out the State of API Integration 2019 Survey and receive $25 to the Cloud Elements store.

Topics:
rabbitmq ,erlang ,integration ,aws ec2

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}