Creating RabbitMQ servers
    • PDF

    Creating RabbitMQ servers

    • PDF

    Article Summary

    Available in Classic and VPC

    Before use

    Q. What is RabbitMQ?

    • It is a service providing a server installed with RabbitMQ, which is an open source message broker based on AMQP 0-9-1 that can configure a message system.
    • RabbitMQ manages message queues as a message broker and provides various features to efficiently exchange messages between different systems or components.
    • RabbitMQ acts as a broker for the message delivery between components, which can provide high reliability to your system. It also enables loose connections between components, allowing your system to be easily expanded.
    • It provides Bash Script for initial setup so that you can easily use RabbitMQ server activation and Management UI Plugin.
    • "RabbitMQ" uses an open source message broker software called RabbitMQ developed by Pivotal.

    Q. What are the benefits of using RabbitMQ?

    • As a message broker, it can be used to efficiently send and receive messages between different components, enabling a loosely coupled system accordingly. This provides independence between components and makes it easy to expand your system.
    • With RabbitMQ, you can easily implement the message delivery between components, publication and subscription models, asynchronous processing, and work queues, etc. This provides the system with benefits such as high availability, load spike handling, continuous execution of the entire system, and concurrency using workers.
    • There are many communities in RabbitMQ, and the clients, adapters, and tools provided by them enable more convenient development. Clients written in various languages can bring interoperability to your system.

    Q. How do I create RabbitMQ server?

    • You can select RabbitMQ server image to be created from Console > Server > Server menu.
    • Create a server as specified and add storage as needed.
    • You will be charged based on monthly and hourly plans, and you can set up your access environment after creating a server.
    • To use RabbitMQ, you should request a public IP address and add the port 5672 and 15672 (when using Management UI Plugin) in ACG Setting.
    • If you do not use Management UI of RabbitMQ and utilize RabbitMQ only between VMs, you can use it via :5672 address without assigning a public IP address.
    • After connecting to the Console, you can easily create a server by following the steps.

    rabbitmq-1-1-01_en.png

    Q. I cannot access RabbitMQ.

    • In order to use RabbitMQ in connection with an external network, you need to request a public IP address and assign it to the server, and the port 5672 must be added to ACG. (please refer to 'Access Environment Setting'.)
    • If you use Private IP address to connect with RabbitMQ between VMs, you can access via :5672 address.
    • RabbitMQ's Management UI Plugin provides a tool to manage via Web Dashboard. For this, the port 15672 must be added to ACG, and a public IP address must be assigned and granted to the server.
    • The address of RabbitMQ's Management UI Plugin is http://:15672/. If you cannot access, check whether ACG is added or Management UI is running in the terminal.
    • If you still cannot connect after confirming the public IP address and ACG, RabbitMQ process may have been stopped. Restart the process by executing the restart command on the terminal. (Please refer to 'RabbitMQ Process Management'.)

    Q. Where can I find an administrator user and a password required on RabbitMQ Management UI screen?

    • The default settings for RabbitMQ are ID (user): admin, Password: . We recommend that you use the terminal or Management UI to remove the initial user settings and then create a new user and password to be used.
    • The terminal provides Bash script for deleting and adding users. We recommend you to delete the user "admin" and create a new user.

    Q. In which directory is RabbitMQ installed?

    • In /usr/lib/rabbitmq directory.

    Q. Where can I find logs created by RabbitMQ?

    • Logs generated by RabbitMQ can be found in /var/log/rabbitmq.

    Q. How do I start RabbitMQ process?

    • Common execution method
      • To start RabbitMQ server, enter the following in the terminal:
        $ systemctl start rabbitmq-server
        

    Q. How do I register a new user after installing RabbitMQ?

    • How to register new users for RabbitMQ is as follows:
      1. Connect to the server.
      2. (If necessary) Delete a user.
        $ /bin/bash /opt/rabbitmq/rabbitmq-delete-user.sh
        type your username to delete: admin  
        # output message
        Deleting user "admin"
        
      3. Add a new user and set a password.
        $ /bin/bash /opt/rabbitmq/rabbitmq-add-user.sh
        type your username: myuser
        type your password: mypass
        # output messages
        Creating user "myuser"
        Setting tags for user "myuser" to [administrator]
        Setting permissions for user "myuser" in vhost "/"
        

    Q. How do I change my password after installing RabbitMQ?

    • How to change a password of RabbitMQ is as follows:
      1. Connect to the server.
      2. Execute the following commands.
      $ rabbitmqctl change_password <username> <newpassword>
      

    About RabbitMQ

    RabbitMQ is an open source message broker based on AMQP 0-9-1, which receives messages from Message Queue Manager and Producer and routes them to consumers. These features can be utilized to send and receive messages between different components or can be used for purposes such as asynchronous processing of tasks, load balancing, and data loss prevention.

    This service allows you to easily construct a system by providing guides for installer image and setup and Bash Script on RabbitMQ.

    Create RabbitMQ server

    The process of creating RabbitMQ server is as follows.

    Step 1. Connect to Console

    Connect to the Console and click Server > Server.

    rabbitmq-1-1-02_en.png

    ① To create a server, click [Create server].

    Step 2. Select server image

    Select RabbitMQ server image to create a server.

    rabbitmq-1-1-03_en.png

    ① Select Application > RabbitMQ.

    ② Click [Next].

    ③ Check the instructions on the popup window (to request a public IP address and ACG to use RabbitMQ, and to view an initial password).

    ④ Click [OK] to close the popup window.

    Step 3. Set server

    Select a storage type, server type, pricing plan, and zone, and enter a server name.

    rabbitmq-1-1-04_en.png

    ① Select a zone.

    • The currently provided zones are ‘KR-1’ and ‘KR-2’.

    ② Select a storage type to use as boot storage.

    ③ Select the desired server type.

    • Some server specifications may not be supported depending on boot disk types.
    • Select one server type: either Compact or Standard depending on your intended purpose.

    ④ You can select either a monthly or hourly pricing plan.

    ⑤ Enter a server name.

    • The name is for users to distinguish the server, and it cannot be used in duplicate.

    ⑥ Check to set a hostname as the server name you have entered. This hostname is used as RabbitMQ initial default password.

    ⑦ Click [Next].

    Step 4. Set authentication key

    If you have an existing authentication key, select ‘Use an Existing Authentication Key’. Otherwise, create a new authentication key according to the following procedure.

    rabbitmq-1-1-05_en.png

    ① Select Create a new authentication key.

    ② Enter an authentication key name.

    ③ Click [Create & save auth key] to save the authentication key file to your local PC.

    • Issue a new authentication key.
    • After saving it, please keep the authentication key in a safe place on your PC.
    • The authentication key is used to obtain an initial administrator password.

    ④ Click [Next].

    Step 5. Set firewall

    You can use your ACG or create a new ACG to set a firewall.

    First, this describes how to set a firewall using an existing ACG.

    rabbitmq-1-1-06_en.png

    ① You must select ACG. Select one of the existing ACGs including the default ‘ncloud-default-acg’.

    • You can select up to 5 ACGs of your own.
    • You must select ACG to activate [Next] button so that you can proceed with the settings.

    ② If you want to create and configure a new ACG besides your existing ones, select Create a new ACG.

    ③ Click [Next].

    The following shows how to set a firewall by creating a new ACG.

    rabbitmq-1-1-07_en.png

    ① In Create a new ACG, click [Create ACG].

    ② Enter ACG name.

    ③ In ACG setting, enter a protocol, an access source, and an allowed port to create.

    • Protocol: Select from TCP, UDP, and ICMP.

    • Access source: Enter an IP address or ACG name.

    • Allowed port: Specify a single port or range.

    • For a terminal connection, the rule for SSH ‘TCP/22’ must be set in ACG of a server to be connected. To use RabbitMQ, 'TCP/5672’ and 'TCP/15672' rules must be additionally set.

    • To add the rules, list a protocol, an access source, and an allowed port, and click [Add].

    ④ If port 22, 5672, and 15672 are all added, click [Create].

    Caution

    RabbitMQ Management Plugin runs on port 15672 and provides monitoring on HTTP-base API and RabbitMQ server and Web UI based on them.
    When an ID and a password are exposed, it is possible to take over messages and control permissions on Web UI. Therefore, please use the source IP used by an administrator as an access source in ACG.

    Step 6. Confirm

    Confirm the configured details.

    rabbitmq-1-1-08_en.png

    ① Make sure that the server image, server, authentication key, and ACG are set properly.

    ② After the final confirmation, click [Create server].

    • This may take several minutes or longer for the server to be created.

    Check in the server list

    Check the created server in the list.
    rabbitmq-1-1-09_en.png

    ① The server you have created will appear in the list.

    ② Wait until the package is installed after the server creation and the server status becomes Running.

    Access environment setting

    When using on private IP address

    You can use a private IP address to access RabbitMQ instance created by another VM instance.

    ① Connect to the Console and click Server > Server.

    ② Click RabbitMQ instance you have created.

    ③ Get a private IP address in Details. Use the private IP address as Host for RabbitMQ Client settings.

    Request public IP address

    You can assign a public IP address to RabbitMQ and use it. If you only need to forward messages between VM instances, you can use RabbitMQ via private IP address without assigning a public IP address.

    However, if you need the feature to manage with Web Dashboard via RabbitMQ Management UI Plugin, you must access using a public IP address, and you will be charged additionally for using a public IP address.
    rabbitmq-1-1-11_en.png

    ① Click Public IP from the left menu.

    ② Click [Create Public IP] to get a public IP assigned.

    ③ From Select Server, select RabbitMQ server to assign the public IP address.

    ④ Click [Next].

    ⑤ Confirm the server name and click [Create] again.

    Set port forwarding

    To connect to a server via terminal program (such as Putty), you must set a port forwarding.

    rabbitmq-1-1-12_en.png

    ① Click Server from the left menu.

    ② To connect to a server, click [Set port forwarding].

    ③ On Set Port Forwarding screen, set an external port number. The input range of an external port number is between 1024~65,534. It cannot be used for other service purposes than the feature to connect to a server.
    (The internal port number is set to 22.)

    ④ Click [Add] to add the setting at the bottom and click [Edit] or [Delete] to edit or delete the setting.

    ⑤ Click [Apply] for SSH connection to the configured external port using a terminal program.

    ACG setting

    Add the terminal connection SSH('TCP/22') and RabbitMQ ('TCP/5672', 'TCP/15672') rules to ACG.

    If you have already added the rules when creating the server, you do not need to perform ACG setting in this step.

    rabbitmq-1-1-13-1_en.png

    ① Click ACG from the left menu.

    ② Select ACG chosen when creating the server and click [Create ACG] at the top.

    ③ Enter ACG name.

    ④ When you’re finished setting, click [Create].

    rabbitmq-1-1-13-2_en.png

    ① Select the ACG you created.

    ② Click [Set ACG] at the top.

    ③ In ACG Rule Setting, enter a protocol, an access source, and an allowed port to create.

    • Protocol: Select from TCP, UDP, and ICMP.

    • Access source: Enter an IP address or ACG name.

    • Allowed port: Specify a single port or range.

    • For a terminal connection, the rule for SSH ‘TCP/22’ must be set in ACG of a server to be connected. To use RabbitMQ, ‘TCP/5672’ and ‘TCP/15672’ rules must be additionally set.

    • To add the rules, list a protocol, an access source, and an allowed port and click [Add].

    ④ When you’re finished setting, click [Apply].

    Get server admin password

    To connect to a server via terminal program (such as Putty), you need to know an administrator password.

    rabbitmq-1-1-14_en.png

    ① Click Server from the left menu.

    ② Select a server and click Manage servers > Get admin password.

    ③ Click [Drop files here or click to upload] to attach the authentication key file(.pem) saved on your PC when creating the server.

    ④ After attaching it, click [Get admin password] to get a password to use when first logging in to the server via terminal program.

    • It is recommended that you change the password to one that the administrator can remember after connecting to the server.

    Terminal connection

    You need to connect to a server via terminal program (such as Putty) and manage RabbitMQ process.

    Connect to server via terminal program

    rabbitmq-1-1-21_en.png

    ① Run a terminal program(such as Putty).

    ② Enter the values of ‘Public IP’ and ‘External Port’ confirmed in your server list or from Show, and click [Open] to connect to the server.

    • Get a public IP: ‘Public IP’ of Port Forwarding Information in [Show] after selecting a server from Console > Server > Server List
    • Get an external port number: ‘External Port’ of Port Forwarding Information in [Show] after selecting a server from Console > Server > Server List

    ③ Enter the user information and password to log in.

    • login as: root
    • password: Administrator password identified above

    ④ Please change the root account’s password to one that you can easily remember after first logging in.
    Enter the ‘passwd root’ command to input a new password.

    Manage RabbitMQ process

    You can manage RabbitMQ process with the following command.

    • Activate RabbitMQ process.

      • When activating a process using systemctl
      shell> systemctl start rabbitmq-server
      
    • Stop RabbitMQ process.

      • To stop the process activated with Supervisord
      shell> systemctl stop rabbitmq-server
      
      • To stop the process using the command provided by RabbitMQ
      shell> rabbitmqctl stop
      
    • View RabbitMQ process.

    shell> rabbitmqctl status
    
    • Start RabbitMQ Management UI Plugin.
    shell> /bin/bash /opt/rabbitmq/rabbitmq-start-management.sh
    

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.