Open vkurup opened 8 years ago
After thinking about this off and on, I think the hard problem is to come up with unique hostnames for all servers, given the way we currently deploy. If we have more than one server, then pillar['project_name'] + "-" + pillar['environment']
won't be unique, but nothing in our fabfile would know it.
If we appended something else to project_name-environment
that made it unique, say the IP address or mac address, would papertrail still be able to identify the "system"? Or we could use "{ip_address}.{environment}.{project}" if that would work better for papertrail.
rsyslog uses
hostname --fqdn
to determine its hostname. Papertrail uses that hostname to help determine which 'system' to send the logs to. Ifhostname --fqdn
of a newly launched system is set to 'localhost' (as is the default), and if an existing system already has that same hostname (which is likely since our current deploy process doesn't change the hostname), then Papertrail will send the new system's logs to the existing system.Example: https://s3.amazonaws.com/uploads.hipchat.com/62946/455126/kS5Bl9FQrxnCX4o/upload_thumb.png
How do you set
hostname --fqdn
?It is not enough to use the
hostname
command or/etc/hostname
. That only setshostname --short
. You need to update/etc/hosts
so that the FIRST entry after the IP address is your desired hostname.This is not good:
This is good:
This also works:
So I was able to fix it in my project by doing that, but I'm not sure how to generalize this for margarita. Would this work for a multiserver setup?
My "fix":