# Hostname mismatch: node X believes its host is different

**URL:** <https://forum.ansible.com/t/hostname-mismatch-node-x-believes-its-host-is-different/29711>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [February 19, 2019, 7:33pm UTC](https://forum.ansible.com/t/hostname-mismatch-node-x-believes-its-host-is-different/29711 "2019-02-19T19:33:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrplainswalker](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mrplainswalker](https://forum.ansible.com/u/mrplainswalker)\
**Post date:** [February 19, 2019, 7:33pm UTC](https://forum.ansible.com/t/hostname-mismatch-node-x-believes-its-host-is-different/29711/1 "2019-02-19T19:33:55Z")

</div>

Hi All,

I realize that this topic is incredibly popular and I’ve gone through about 10 others talking about the same thing, but nothing they suggest seems to work, so here’s another one…

I have Erlang OTP 20.2 and RabbitMQ 3.7.3 installed on 2 fresh virtual machines running Windows Server 2016 with all latest updates. I copy the cookie file from {machine1} at C:\Windows\System32\config\systemprofile to machine 1 at C:Users{User}. I also copy the cookie file to those same directories on {machine2}. I restart the machines (I probably only need to restart the process, but just to be sure). I triple check to make sure all the cookie files are identical. They are.

I run rabbitmqctl stop\_app on {machine1}. I run rabbitmqctl join\_cluster rabbit@{machine2}. I get the following output:

> Clustering node rabbit@{machine1} with rabbit@{machine2}  
> Error: unable to perform an operation on node ‘rabbit@{machine2}’. Please see diagnostics information and suggestions below.
> 
> Most common reasons for this are:
> 
> - Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
> - CLI tool fails to authenticate with the server (e.g. due to CLI tool’s Erlang cookie not matching that of the server)
> - Target node is not running
> 
> In addition to the diagnostics info below:
> 
> - See the CLI, clustering and networking guides on [http://rabbitmq.com/documentation.html](http://rabbitmq.com/documentation.html) to learn more
> - Consult server logs on node rabbit@{machine2}
> 
> # DIAGNOSTICS
> 
> attempted to contact: [‘rabbit@{machine2}’]
> 
> rabbit@{machine2}:
> 
> - connected to epmd (port 4369) on {machine2}
> 
> - epmd reports node ‘rabbit’ uses port 25672 for inter-node and CLI tool traffic
> 
> - TCP connection succeeded but Erlang distribution failed
> 
> - Hostname mismatch: node “rabbit@{machine2}” believes its host is different. Please ensure that hostnames resolve the same way locally and on “rabbit@{machine2}”
> 
> Current node details:
> 
> - node name: ‘rabbitmqcli40@{machine1}’
> - effective user’s home directory: C:\Users{username}
> - Erlang cookie hash: {cookiehash}

I’ve also triple checked that the machine names are correct by running the “hostname” command and also by running "echo %computername%. I’ve also tried connecting in the other direction, and I’ve verified that the cookies have the same hash in the output. Nothing works. I cannot understand what the problem is. Does anybody have any idea what’s going on, or could at least suggest a checklist of things to look for? I’ve read the entire page about clustering. It didn’t help.

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [February 19, 2019, 8:51pm UTC](https://forum.ansible.com/t/hostname-mismatch-node-x-believes-its-host-is-different/29711/2 "2019-02-19T20:51:57Z")

</div>

This doesn’t sound like an issue with Ansible but something specific to RabbitMQ. You are better off asking those communities for help with this.

Thanks

Jordan

---

<div class="post-metadata">

**Author:** ![mrplainswalker](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mrplainswalker](https://forum.ansible.com/u/mrplainswalker)\
**Post date:** [February 19, 2019, 9:12pm UTC](https://forum.ansible.com/t/hostname-mismatch-node-x-believes-its-host-is-different/29711/3 "2019-02-19T21:12:47Z")

</div>

Oops, sorry. I sent this to the wrong place.
