Launching an Amazon EC2 instance with Solace PubSub+ Event Broker
Tags: solace, aws
Published: 2020-02-04 02:35:15


 ![Further thoughts on FPGA co-processing and performance](https://solace.com/wp-content/uploads/2019/08/solace-default-blog-thumbnail-600x285.jpg)

In this post, I would like to show you how you can quickly spin up an Amazon EC2 instance with the [Solace PubSub+ Event Broker](https://solace.com/products/event-broker/) deployed on it. Of course, you can always just use [Solace Cloud](https://solace.com/products/event-broker/cloud/) and deploy on AWS through it in seconds but where is the fun in that?

I love AMIs and I cannot lie. Gone are the days when you had to read lengthy documentation and figure out how to manually install binaries. Gone are the days when you had to worry about installing different package managers to manually install all the required libraries via `pip` or `conda`.

We live in a brave new world where with just few clicks, we can spin up an Amazon EC2 instance with all the necessary binaries and libraries installed with proper configurations to quickly get started. Personally, as a developer who loves to try new technologies and who does a lot of demos, this is so convenient.

Solace PubSub+ Event Broker is “unified event broker technology available as run-anywhere software, purpose-built hardware, and a managed service that you can use together to stream events across your distributed enterprise”. PubSub+ [Standard Edition](https://solace.com/downloads/) is free to use, even in production.

## **Amazon Machine Image (AMI)**

Amazon has AMI Marketplace where you can pick from numerous paid and free AMIs. In case you are not familiar with AMIs, they provide the information required to launch an EC2 instance; Solace also has an [AMI](https://aws.amazon.com/marketplace/pp/Solace-Corporation-Solace-PubSub-Software-Message-/B077GRGL8Q) available for PubSub+Event Broker: Software.

You will find necessary information on the AMI page about the instance and what it contains. In my opinion, the most important section is the **Pricing Information** section which tells you the estimated cost of launching an instance from this AMI.

[![Pricing Information](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-1.png)](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-1.png)

As you can see, there is no cost to using the PubSub+ Event Broker: Software itself but there is cost involved for the underlying AWS infrastructure since you can’t use the free tier Amazon EC2 instance to run Solace PubSub+ Event Broker. Keep this in mind as you launch your own EC2 instance.

The **Usage Information** section is also very helpful. You can find links to several necessary resources there which help you get started.

[![Usage Information](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-2.png)](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-2.png)

Alright, let’s go ahead and launch an EC2 instance from the AMI. You can do it straight from the current page or you can go to the EC2 page and launch an instance from there. We will do it from the EC2 page.

## **Launching an Amazon EC2 instance from Solace PubSub+ Event Broker: Software AMI**

Log in to your AWS account and go to the EC2 services page.

[![Log in to your AWS account](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-3.png)](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-3.png)

Once you are there, click the **Launch instance** button and select **Launch instance**.

[![Launch instance](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-4.png)](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-4.png)

Great, you will now be taken to a page where you can pick an AMI from which you will launch your EC2 instance.

Click the **AWS Marketplace** tab and search for **Solace**. You will see Solace’s PubSub+ AMI as the result of your query. Click **Select** to proceed.

[![Click the AWS Marketplace tab and search for Solace](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-5.png)](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-5.png)

On the next page, you will see the pricing and usage information which we saw earlier. Click **Continue**.

Then, you will be asked to pick the underlying EC2 instance. There are minimum requirements to use PubSub+ Event Broker software so you cannot use **t2.micro** (free tier). The recommended instance is General Purpose t2.large (2 vCPUs, 8 GiB Memory) so we will stick to that for this demo. Note that different instances cost differently, so pick wisely.

[![use PubSub+ Event Broker software](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-6.png)](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-6.png)

Click **Configure Instance Details**. On this page, you can select which VPC you would like to deploy your instance into and pick IAM role to attach to the instance among other details. For our purpose, we will stick with the defaults. The only thing I changed is that I assigned my existing admin IAM role to my EC2 instance.

[![Configure Instance Details](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-7.png)](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-7.png)

Click **Add Storage** and leave it as it is and click **Add Tags**.

This is not mandatory but I like to add tags to my EC2 instances so I can easily recognize them later. I added the ‘Name’ tag to my EC2 instance.

[![I added the Name tag to my EC2 instance](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-8.png)](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-8.png)

Click **Configure Security Group** to configure your security settings. The default option is to create a new Security Group with the recommended rules, or you can pick an existing Security Group. For our use case, we will create a new group with the recommended settings. Click **Review and Launch**. Review the details and click Launch. You will be asked to select an existing Key Pair or create a new one. I have selected an existing Key Pair which I will be using to log in to this EC2 instance.

[![Configure Security Group](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-9.png)](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-9.png)

And, that’s it! We now have an EC2 instance spinning up from Solace’s PubSub+ Event Broker software AMI.

Next, we will take PubSub+ Event Broker for a spin.

## **Configuring PubSub+ Event Broker**

There is not much to configure, which is the beauty of this whole setup, except for an admin user which we will use to later log in to PubSub+ Manager.

First, let’s log in to our EC2 instance using the Key Pair which we selected when we launched our EC2 instance.

Go to your EC2 page and you should see your new EC2 instance there:

[![ EC2](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-10.png)](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-10.png)

Select your EC2 instance and click **Connect** to get the ssh command. Note that you need to use the **sysadmin** user instead of **root**.

```
MacBook-Pro:Downloads hgupta$ ssh -i "himanshu-tokyo.pem" sysadmin@ec2-13-115-6-241.ap-northeast-1.compute.amazonaws.comSolace PubSub+ Standard
```

You can now see the Solace PubSub+ Event Broker instance running:

```
[sysadmin@ip-172-31-28-133 ~]$ solacectl cliSolace PubSub+ Standard Version 9.3.1.5Operating Mode: Message Routing Node
```

This proves that we were able to successfully launch an Amazon EC2 instance with Solace PubSub+ Event Broker on it. We now need to create an admin user which we will use to log in to Solace PubSub+ Manager. We can do so through Solace CLI.

First, let’s activate the CLI:

```
[sysadmin@ip-172-31-28-133 ~]$ solacectl cliSolace PubSub+ Standard Version 9.3.1.5Operating Mode: Message Routing Node
```

Now, we can run the following commands to create a new user called **admin** with the password **admin** (obviously, don’t do it in production).

```
ip-172-31-28-133&amp;amp;gt; enableip-172-31-28-133# configureip-172-31-28-133(configure)# create username admin password admin
```

That should do it.

## **Accessing PubSub+ Manager**

Now that we have our **admin** user created, we can use its credentials to log in to PubSub+ Manager.

Go to the following URL on your browser: **http://<ec2\_public\_ip>:8080**

You will see the Solace PubSub+Event Broker Software Standard login page:

[![Solace PubSub+Event Broker Software Standard login page](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-11.png)](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-11.png)

Log in with your **admin** credentials and you will be taken to the following page with your **default** Message VPN:

[![default Message VPN:](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-12.png)](https://solace.com/wp-content/uploads/2020/01/ec2-blog_pic-12.png)

And that’s it! This whole process took me 5-10 minutes.

Once you are done playing around with PubSub+Event Broker, you can easily terminate your EC2 instance from your EC2 instance page. Make sure to do so to avoid any infrastructure charges.

I hope you found this post useful. For more information, visit [PubSub+ for Developers](https://www.solace.dev/). If you have any questions, post them to the [Solace Developer Community](https://solace.community/).

 

The post [Launching an Amazon EC2 instance with Solace PubSub+ Event Broker](https://solace.com/blog/amazon-ec2-pubsub-plus/) appeared first on [Solace](https://solace.com).