Skip to main content
Skip to main content
🚧 Work in Progress

Create a RabbitMQ service in Zerops

...

Create RabbitMQ using Zerops GUI​

First, set up a project in Zerops GUI. Then go to the project dashboard page and choose Add new service in the left menu in the Services block. Then add a new RabbitMQ service:

// TODO screenshot (add a new service page)

ParameterDescriptionLimitations
hostnameA unique service identifier like rabbitmq, db etc.- duplicate services with the same name in the same project are forbidden
- maximum 25 characters
- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
Caution

The hostname is fixed after the service is created. It can't be changed later.

Choose RabbitMQ service mode​

Zerops provides RabbitMQ service in two modes: Highly available and Single container.

// TODO image (add a new RabbitMQ page - Automatic scaling section)

Highly available​

//TODO review

Creates a RabbitMQ cluster with 3 message queue containers and 2 free proxy containers. This mode is suited for production.

Zerops always keeps the 3 message queue containers on different physical machines. All your data is stored redundantly in 3 identical copies. In case of a failure of a container or the underlying physical machine, Zerops automatically disconnects the failed container from the cluster, creates a new container and syncs all data from the remaining 2 copies. Finally the broken container is automatically deleted.

[Learn more] about specific behaviour and technical limitations of the RabbitMQ cluster.

Single container​

A RabbitMQ message broker installed in a single container is created. Useful for non-essential data or dev environments.

Your data is stored only in a single container. If the container or the underlying physical machine fails, your data since the last backup are lost. Zerops doesn't provide any automatic repairs of single node RabbitMQ services.

Caution

The RabbitMQ service mode is fixed after the service is created. It can't be changed later.

Choose RabbitMQ version​

Currently only RabbitMQ v3 (3.9.13) version is available.

Set auto scaling configuration​

//TODO review

Zerops scales the RabbitMQ services automatically by raising or lowering the hardware resources of each message queue container.

Vertical auto scaling has following default configuration:

 Minimum resourceMaximum resource
CPU cores15
RAM0.5 GB32 GB
Disk1 GB100 GB

For most cases, the default parameters will work without issues. If you need to limit the cost of the RabbitMQ service, lower the maximal resources. Zerops will never scale above the selected maximums.

When you are experiencing problems with insufficient RabbitMQ performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.

Info

You can change the auto scaling parameters later.

// TODO screenshot (add a new RabbitMQ page - Automatic scaling section)

//TODO review

RabbitMQ needs at least 20 vCPUs to start. Zerops automatically starts RabbitMQ service with at least 20 vCPUs. If the service is idle after the start, Zerops will scale the RabbitMQ down to selected minimum vCPU settings. If you set the minimum vCPU settings higher than 20 vCPUs, Zerops will start with the required minimum vCPU settings.

Learn more about RabbitMQ auto scaling.

Create RabbitMQ using zCLI​

zCLI is the Zerops command-line tool. To create a new RabbitMQ service via the command-line, follow these steps:

  1. Install & setup zCLI
  2. Create a project description file
  3. Create a project and a RabbitMQ service

Create a project description file​

Zerops uses a yaml format file to describe the project infrastructure.

Basic example​

Create a directory my-project. Create a description.yml file inside the directory with the following content:

# basic project data
project:
# project name
name: my-project
# array of project services
services:
- # service name
hostname: rabbitmq1
# service type and version number in rabbitmq@3 format
type: rabbitmq@3
# mode of operation "HA"/"NON_HA"
mode: NON_HA

The yaml file describes your future project infrastructure. The project will contain one RabbitMQ service in the single container mode with default auto scaling configuration. Hostname will be set to rabbitmq1.

Full example​

Create a directory my-project. Create a description.yml file inside the directory with the following content:

# basic project data
project:
# project name
name: my-project
# optional: project description
description: A project with a RabbitMQ message broker
# optional: project tags
tags:
- DEMO
- ZEROPS
# array of project services
services:
- # first service hostname
hostname: rabbitmq1
# service type and version number in rabbitmq@3 format
type: rabbitmq@3
# mode of operation "HA"/"NON_HA"
mode: HA
# optional: vertical auto scaling customization
verticalAutoscaling:
minVCpu: 10
maxVCpu: 20
minRam: 4
maxRam: 8
minDisk: 2
maxDisk: 10
- # second service hostname
hostname: rabbitmq2
# service type and version number in rabbitmq@3 format
type: rabbitmq@3
# mode of operation "HA"/"non_HA"
mode: NON_HA

The yaml file describes your future project infrastructure. The project will contain two RabbitMQ services.

The hostname of the first service will be set to rabbitmq1. The high availability mode will be chosen and the custom auto scaling configuration will be set.

The hostname of the second service will be set to rabbitmq2. The single container mode will be chosen and the default auto scaling configuration will be set.

Description of description.yml parameters​

The project: section is required. Only one project can be defined.

ParameterDescriptionLimitations
nameThe name of the new project. Duplicates are allowed.
descriptionOptional. Description of the new project.Maximum 255 characters.
tagsOptional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.

At least one service in services: section is required. You can create a project with multiple services. The example above contains only RabbitMQ services but you can create a description.yml with [different types] of services.

ParameterDescription
hostname

The unique service identifier.



The hostname of the new service will be set to the hostname value.


Limitations:
- duplicate services with the same name in the same project are forbidden


  • maximum 25 characters
    - must contain only lowercase ASCII letters (a-z) or numbers (0-9)
type

Specifies the service type rabbitmq and version.


Set type: rabbitmq<span>@</span>XXX

Currently only RabbitMQ XXX is available.

mode

Defines the operation mode of RabbitMQ service.



HA

Creates a RabbitMQ cluster with 3 message queue containers and 2 free database proxies. This mode is suited for production.



Zerops always keeps the 3 message queue containers on different physical machines. All your data is stored redundantly in 3 identical copies. In case of a failure of a container or the underlying physical machine, Zerops automatically disconnects the failed container from the cluster, creates a new container and syncs all data from the remaining 2 copies. Finally the broken container is automatically deleted.



NON_HA

Zerops will create a RabbitMQ message broker installed in a single container. Useful for non-essential data or dev environments.



Your data is stored only in a single container. If the container or the underlying physical machine fails, your data since the last backup are lost. Zerops doesn't provide any automatic repairs of single node RabbitMQ services.

verticalAutoscaling

Optional. Defines

custom auto scaling parameters

.

Caution

The RabbitMQ service hostname and mode are fixed after the service is created. They can't be changed later.

Create a project based on the description.yml​

When you have your description.yml ready, use the zcli project project-import command to create a new project and the service infrastructure.

Usage:
zcli project project-import importYamlPath [flags]

Flags:
-h, --help the project import command.
--orgId string If you have access to more than one organization, you must specify the org ID for which the
project is to be created.
--workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")

Zerops will create a project and one or more services based on the description.yml content.

Maximum size of the description.yml file is 100 kB.

You don't specify the project name in the zcli project project-import command, because the project name is defined in the description.yml.

If you have access to more than one client, you must specify the client ID for which the project is to be created. The clientID is located in the Zerops GUI under the client name on the project dashboard page.

image

Add RabbitMQ service to an existing project​

Example​

Create a directory my-project if it doesn't exist. Create an import.yml file inside the my-project directory with following content:

# array of project services
services:
-
# service name
hostname: rabbitmq1
# service type and version number in rabbitmq@3 format
type: rabbitmq@3
# mode of operation "HA"/"NON_HA"
mode: NON_HA

The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one RabbitMQ service in the single container mode with default auto scaling configuration will be added to your project. Hostname of the new service will be set to rabbitmq1.

The content of the services: section of import.yml is identical to the project description file. The import.yml never contains the project: section because the project already exists.

When you have your import.yml ready, use the zcli project service-import command to add one or more services to your existing Zerops project.

Usage:
zcli project service-import importYamlPath [flags]

Flags:
-h, --help the project service import command.
--projectId string If you have access to more than one project, you must specify the project ID for which the
command is to be executed.

zCLI commands are interactive, when you press enter after zcli project service-import importYamlPath, you will be given a list of your projects to choose from.

Maximum size of the import.yml file is 100 kB.