Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Getting started with RabbitMQ and Google Compute Engine

RabbitMQ is a popular open-source messaging system that serves a variety of use cases. If you are unfamiliar with RabbitMQ, you can learn more about its use cases and features as well as read their tutorials .

Many applications have the need for a messaging system, and different use cases have different requirements for such a system. Google now makes it easy for you to deploy a messaging system that targets the following scenario:

Real-world examples of such scenarios include any application that needs to perform asynchronous backend processing in response to a single request. For instance, a social application might use queues to initiate various processes in response to a user post, such as push notifications to friends and sending email to tagged users. These processes can happen asynchronously, which allows the app to free the user from having to wait for the processing to finish.

Objectives

Quickly deploy RabbitMQ on Compute Engine

The Google Developers Console provides a simple interface that you can use to quickly deploy and configure a RabbitMQ cluster.

  1. Deploy RabbitMQ for a new or existing project.

  2. Enter a username and password for your cluster deployment.

  3. Specify the zone and number of RAM nodes.

    The first node in the cluster will be configured as a Disc/Stats node. See the RabbitMQ clustering guide for more information on the nodes.

    When the cluster is created, load balancing is configured for you. Learn more

  4. [Optional] Configure advanced settings. You can configure the following settings:

    • Number of additional disc nodes
    • Machine type for the disc/stats nodes
    • Machine type for the add RAM nodes
    • Machine type for the additional disc nodes
    • Compute Engine network that the cluster nodes belong

The deployment can take a few minutes, when it finishes, you are provided with a command that you can run to tunnel the RabbitMQ web-based management console over SSH to your localhost. See managing your deployed cluster .

Load balancing the cluster

When you deploy a RabbitMQ cluster, load balancing is automatically configured for your nodes. Two load balancing target pools are created for your nodes along with correspondingly named forwarding rules.

The forwarding rules for these target pools provide an IP address that you can use to configure your clients. If you want your disc/stats node to process messaging requests, use the IP address of the rabbitmq-all-nodes-XXXX forwarding rule. Otherwise, use the IP address for the rabbitmq-queue-nodes-XXXX forwarding rule. The latter might be preferable for larger and busier clusters.

You can look up the forwarding rule IP addresses in your project in the Google Developers Console under Compute Engine -> Load balancing and choosing the forwarding rules tab.

Managing your deployed cluster

To manage your RabbitMQ cluster, you can access the web-based management interface that is provided by RabbitMQ. After deploying your RabbitMQ cluster in the Developers Console, you are provided with a command to tunnel the management interface over ssh to your localhost so that you are not accessing the interface over an insecure HTTP connection.

After you run the displayed command, browse to http://localhost:15672 .

Next steps

Troubleshooting

If a deployment fails to complete successfully, check the error message in the Developers Console. If the problem is a CPU quota issue or other problem that you can correct, delete the deployment, correct the problem, and try again.

If the error message on the Developers Console does not provide sufficient detail about the failure, check the Deployment Manager output on the virtual machine instances that were launched. On each instance, there will be a directory /gagent/metaOutput with a set of numbered files: stdoutN.txt , stderrN.txt , exitcodeN.txt . Each set of such files corresponds to the sequenced command that was executed by Deployment Manager for your deployment on that instance.

To get a list of your compute engine instances, check the Compute Engine list of virtual machine instances in the Developers Console or run the following command:

 $ gcloud compute instances list -l

To ssh to an instance:

 $ gcloud compute ssh <instance> --zone=<zone>

If you have problems that you cannot resolve or have questions head to Stack Overflow .

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.