Hi, unable to establish the connection between two virtual machines in the scale set

siri 0 Reputation points
2023-05-05T19:19:11.9966667+00:00

Hi,

We have Provisioned a virtual machine scale seer and installed RabbitMQ on the virtual machines. Before adding them in to the cluster, we are trying to perform the connectivity test on multiple ports specific to RabbitMQ but both of these machines are not communicating with each other

Enabled the ports in network group

Validated the windows firewall defender, subnets looks okay

Tried to connect with the public IP's of the machines also

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,043 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Konstantinos Passadis 19,591 Reputation points MVP
    2023-05-05T19:23:47.3466667+00:00

    Hello @siri !

    If the virtual machines are not able to communicate with each other despite enabling the necessary ports and validating the firewall and subnet settings, you can try the following troubleshooting steps:

    Check if the virtual machines are in the same virtual network or virtual network peering: Ensure that both the virtual machines are in the same virtual network or virtual network peering. If not, establish virtual network peering between the virtual networks to allow communication.
    
    Check if the RabbitMQ service is running: Ensure that the RabbitMQ service is running on both virtual machines. You can check the service status using the following command in a PowerShell session:
    
    mathematica
    

    Get-Service -Name rabbitmq

    If the service is not running, start it using the following command:

    sql

    Start-Service -Name rabbitmq

    Check the RabbitMQ logs: Check the RabbitMQ logs on both virtual machines to see if there are any errors or issues that could be preventing communication between the nodes. You can find the logs in the RabbitMQ installation directory.

    Verify the node names: Ensure that the node names specified in the RabbitMQ configuration file are correct and match the actual node names of the virtual machines. You can find the RabbitMQ configuration file in the RabbitMQ installation directory.

    Check if the ports are open: Verify that the ports used by RabbitMQ are open on both virtual machines. You can use the Test-NetConnection cmdlet in PowerShell to check if a port is open:

    php

    Test-NetConnection -ComputerName <IP address> -Port <Port number>

    If the port is not open, you may need to add an inbound rule to the Windows Firewall to allow traffic on that port.

    Check if the virtual machines can communicate with other machines: Test if the virtual machines can communicate with other machines on the network. If they can't, there may be an issue with the virtual network configuration or a firewall blocking the traffic.

    I hope this helped

    If it helped kindly mark the Answer as Accepted!

    Reagrds


  2. Konstantinos Passadis 19,591 Reputation points MVP
    2023-05-09T09:09:17.7166667+00:00

    Hello @siri!

    Please try this :

    What ports is RabbitMQ using?

    Default: 5672, the manual has the answer. It's defined in the RABBITMQ_NODE_PORT variable.

    https://www.rabbitmq.com/configure.html#define-environment-variables

    The number might be differently if changed by someone in the rabbitmq configuration file:

    vi /etc/rabbitmq/rabbitmq-env.conf

    Ask the nmap if it can see it:

    sudo nmap -p 1-65535 localhost

    Starting Nmap 5.51 ( http://nmap.org ) at 2014-09-19 13:50 EDT

    Nmap scan report for localhost (127.0.0.1)

    Host is up (0.00041s latency).

    PORT STATE SERVICE

    443/tcp open https

    5672/tcp open amqp

    15672/tcp open unknown

    35102/tcp open unknown

    59440/tcp open unknown

    Oh look, 5672, and 15672

    Ask netstat if it can see it:

    netstat -lntu

    Active Internet connections (only servers)

    Proto Recv-Q Send-Q Local Address Foreign Address State

    tcp 0 0 0.0.0.0:15672 0.0.0.0:* LISTEN

    tcp 0 0 0.0.0.0:55672 0.0.0.0:* LISTEN

    tcp 0 0 :::5672 :::* LISTEN

    Oh look 5672.

    lsof to see ports:

    eric@dev ~$ sudo lsof -i | grep beam

    beam.smp 21216 rabbitmq 17u IPv4 33148214 0t0 TCP *:55672 (LISTEN)

    beam.smp 21216 rabbitmq 18u IPv4 33148219 0t0 TCP *:15672 (LISTEN)

    use nmap from a different machine, find out if 5672 is open:

    sudo nmap -p 5672 10.0.1.71

    Starting Nmap 5.51 ( http://nmap.org ) at 2014-09-19 13:19 EDT

    Nmap scan report for 10.0.1.71

    Host is up (0.00011s latency).

    PORT STATE SERVICE

    5672/tcp open amqp

    MAC Address: 0A:40:0E:8C:75:6C (Unknown)

    Nmap done: 1 IP address (1 host up) scanned in 0.13 seconds

    Try to connect to a port manually with telnet, 5671 is CLOSED:

    telnet localhost 5671

    Trying 127.0.0.1...

    telnet: connect to address 127.0.0.1: Connection refused

    Try to connect to a port manually with telnet, 5672 is OPEN:

    telnet localhost 5672

    Trying 127.0.0.1...

    Connected to localhost.

    Escape character is '^]'.

    Check your firewall:

    sudo cat /etc/sysconfig/iptables

    It should tell you what ports are made open:

    -A INPUT -p tcp -m tcp --dport 5672 -j ACCEPT

    Reapply your firewall:

    sudo service iptables restart

    iptables: Setting chains to policy ACCEPT: filter [ OK ]

    iptables: Flushing firewall rules: [ OK ]

    iptables: Unloading modules: [ OK ]

    iptables: Applying firewall rules: [ OK ]

    Taken from https://stackoverflow.com/questions/12792856/what-ports-does-rabbitmq-use

    Kindly mark the answer as Accepted and Upvote in case it helped or post your feedback to help !

    Regards


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.