MMS gets hostname from uname and can't connect to it
Posted
by
Adam Monsen
on Server Fault
See other posts from Server Fault
or by Adam Monsen
Published on 2012-06-18T04:56:11Z
Indexed on
2012/06/18
9:18 UTC
Read the original article
Hit count: 233
amazon-ec2
|mongodb
I'm trying to get 10gen's MongoDB Monitoring Service monitoring my 3-node replica set. The replica set running in an AWS VPC. Each node runs on a different [virtual] machine. Assume their IPs are 192.168.1.1
(primary or secondary), 192.168.1.2
(primary or secondary), 192.168.1.3
(arbiter).
From a quick look at the source, MMS appears to get the hostname of the machine it is running on like so:
platform.uname()[1]
For my VPC EC2 instance, this returns something like
ip-192-168-1-1
MMS then tries to connect to this hostname, which does not resolve. I'd rather just use IP addresses (since they're always static), but it seems like the hardcoded use of platform.uname()[1]
in mmsAgent.py
precludes that.
So, what's an elegant way out of this? Hack /etc/hosts
? I'm not setting up a DNS server just for this. Maybe I'm just misunderstanding how to configure MMS.
© Server Fault or respective owner