Bird
Raised Fist0
RabbitMQdevops~20 mins

RabbitMQ cluster formation - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
RabbitMQ Cluster Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding RabbitMQ Cluster Nodes

In a RabbitMQ cluster, what is the role of a disc node compared to a ram node?

ARam nodes replicate data to disc nodes for persistence.
BDisc nodes only handle message routing, ram nodes store messages on disk.
CDisc nodes store messages and queue state on disk, while ram nodes keep state only in memory.
DDisc nodes are used only for backups, ram nodes handle all cluster operations.
Attempts:
2 left
💡 Hint

Think about data persistence and memory usage in cluster nodes.

💻 Command Output
intermediate
1:30remaining
Joining a Node to a RabbitMQ Cluster

You run the command rabbitmqctl join_cluster rabbit@node1 on node2. What is the expected output if the join is successful?

RabbitMQ
rabbitmqctl join_cluster rabbit@node1
ASyntax error: missing parameters
BError: node rabbit@node1 not reachable
CNode rabbit@node2 already clustered
DClustering node rabbit@node1 ... done
Attempts:
2 left
💡 Hint

Successful commands usually end with '... done'.

❓ Configuration
advanced
2:30remaining
Configuring RabbitMQ Nodes for Cluster Formation

Which configuration snippet correctly sets the node name and enables clustering in rabbitmq.conf for a node named rabbit@node2?

A
node.name = rabbit@node2
cluster_formation.peer_discovery_backend = classic_config
B
node.name = rabbit@node2
cluster_formation.peer_discovery_backend = rabbitmq_peer_discovery_classic_config
C
node.name = node2
cluster_formation.peer_discovery_backend = rabbitmq_cluster
D
node.name = rabbit@node2
cluster_formation.peer_discovery_backend = classic
Attempts:
2 left
💡 Hint

Check the exact backend name for classic config peer discovery.

❓ Troubleshoot
advanced
2:00remaining
Troubleshooting Cluster Node Communication Failure

After adding a node to the cluster, you see the error nodedown when running rabbitmqctl cluster_status. What is the most likely cause?

AThe nodes cannot communicate due to firewall blocking port 25672.
BThe RabbitMQ service is not installed on the new node.
CThe cluster name is mismatched between nodes.
DThe disk space on the new node is full.
Attempts:
2 left
💡 Hint

RabbitMQ nodes need open ports to communicate.

🔀 Workflow
expert
3:00remaining
Correct Sequence to Form a RabbitMQ Cluster

Arrange the steps in the correct order to form a RabbitMQ cluster with two nodes: rabbit@node1 and rabbit@node2.

A1,2,3,4
B2,1,3,4
C1,3,2,4
D3,1,2,4
Attempts:
2 left
💡 Hint

You must stop the application before joining, then start it again.

Practice

(1/5)
1. What is the main purpose of forming a RabbitMQ cluster?
easy
A. To create multiple independent RabbitMQ servers
B. To backup messages to a single server
C. To connect multiple RabbitMQ servers to work as one system
D. To run RabbitMQ only on one server

Solution

  1. Step 1: Understand RabbitMQ clustering

    RabbitMQ clustering connects multiple servers to act as a single messaging system.
  2. Step 2: Identify the purpose

    This improves reliability and scalability by sharing workload across servers.
  3. Final Answer:

    To connect multiple RabbitMQ servers to work as one system -> Option C
  4. Quick Check:

    Cluster = Multiple servers working as one [OK]
Hint: Clusters combine servers for reliability and scale [OK]
Common Mistakes:
  • Thinking clusters create independent servers
  • Confusing clustering with backup
  • Assuming clustering limits to one server
2. Which command sequence correctly joins a RabbitMQ node to an existing cluster?
easy
A. rabbitmqctl start_app; rabbitmqctl stop_app; rabbitmqctl join_cluster rabbit@node1
B. rabbitmqctl start_app; rabbitmqctl join_cluster rabbit@node1; rabbitmqctl stop_app
C. rabbitmqctl join_cluster rabbit@node1; rabbitmqctl stop_app; rabbitmqctl start_app
D. rabbitmqctl stop_app; rabbitmqctl join_cluster rabbit@node1; rabbitmqctl start_app

Solution

  1. Step 1: Stop the RabbitMQ application on the joining node

    Use rabbitmqctl stop_app to safely stop the node before joining.
  2. Step 2: Join the cluster and restart the application

    Run rabbitmqctl join_cluster rabbit@node1 then rabbitmqctl start_app to join and restart.
  3. Final Answer:

    rabbitmqctl stop_app; rabbitmqctl join_cluster rabbit@node1; rabbitmqctl start_app -> Option D
  4. Quick Check:

    Stop, join, then start = correct sequence [OK]
Hint: Stop app before join, then start after [OK]
Common Mistakes:
  • Starting app before joining cluster
  • Joining cluster before stopping app
  • Not restarting app after join
3. Given the commands run on a new node:
rabbitmqctl stop_app
rabbitmqctl join_cluster rabbit@node1
rabbitmqctl start_app
rabbitmqctl cluster_status
What output should you expect from cluster_status?
medium
A. Shows the new node and rabbit@node1 as cluster members
B. Shows only rabbit@node1 as cluster member
C. Shows no cluster members
D. Returns an error about cluster status

Solution

  1. Step 1: Understand cluster join effect

    After joining and starting, the new node becomes part of the cluster with existing nodes.
  2. Step 2: Check cluster_status output

    The command lists all nodes in the cluster, including the new node and rabbit@node1.
  3. Final Answer:

    Shows the new node and rabbit@node1 as cluster members -> Option A
  4. Quick Check:

    Joined nodes appear in cluster_status [OK]
Hint: cluster_status lists all joined nodes [OK]
Common Mistakes:
  • Expecting only original node listed
  • Thinking cluster_status shows no nodes
  • Assuming cluster_status errors after join
4. You ran these commands on a new node but it failed to join the cluster:
rabbitmqctl join_cluster rabbit@node1
rabbitmqctl stop_app
rabbitmqctl start_app
What is the main error?
medium
A. You must stop the app before joining the cluster
B. You must start the app before joining the cluster
C. The join_cluster command is misspelled
D. You cannot join a cluster without restarting the server

Solution

  1. Step 1: Check command order for joining cluster

    The app must be stopped before running join_cluster to avoid errors.
  2. Step 2: Identify the mistake in the sequence

    Here, join_cluster was run before stopping the app, causing failure.
  3. Final Answer:

    You must stop the app before joining the cluster -> Option A
  4. Quick Check:

    Stop app first, then join cluster [OK]
Hint: Always stop app before join_cluster command [OK]
Common Mistakes:
  • Running join_cluster before stop_app
  • Assuming join_cluster auto-stops app
  • Ignoring command order importance
5. You want to form a RabbitMQ cluster with three nodes: rabbit@node1, rabbit@node2, and rabbit@node3. Which sequence of commands on rabbit@node3 correctly forms the cluster assuming rabbit@node1 is the main node?
hard
A. rabbitmqctl stop_app; rabbitmqctl join_cluster rabbit@node2; rabbitmqctl start_app
B. rabbitmqctl stop_app; rabbitmqctl join_cluster rabbit@node1; rabbitmqctl start_app
C. rabbitmqctl start_app; rabbitmqctl join_cluster rabbit@node1; rabbitmqctl stop_app
D. rabbitmqctl join_cluster rabbit@node1; rabbitmqctl stop_app; rabbitmqctl start_app

Solution

  1. Step 1: Identify the main node for cluster join

    rabbit@node1 is the main node, so other nodes join it directly.
  2. Step 2: Use correct command order on rabbit@node3

    Stop app, join cluster with rabbit@node1, then start app to form cluster properly.
  3. Final Answer:

    rabbitmqctl stop_app; rabbitmqctl join_cluster rabbit@node1; rabbitmqctl start_app -> Option B
  4. Quick Check:

    Join main node with stop, join, start sequence [OK]
Hint: Join new nodes to main node with stop, join, start [OK]
Common Mistakes:
  • Joining to wrong node in cluster
  • Starting app before joining
  • Incorrect command order causing failure
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard