0

With puppet installed, the command /opt/puppet/sbin/refresh-mcollective-metadata is run every 15 minutes. It loggs hostname: Host name lookup failure when it runs.

hostname, hostname -i, and hostname -f all return hostname: Host name lookup failure

Dan Bowling
  • 309
  • 1
  • 3
  • 12

1 Answers1

0

This can occur because the hostname is not set in CentOS.

Run the command hostname machine.example.com to set the hostname on the machine then MCollective and all the above-mentioned hostname commands will return the correct values.

Note: it's probably worth looking at the comments on this solution.

Dan Bowling
  • 309
  • 1
  • 3
  • 12
  • 3
    Setting the hostname to an FQDN is quite a crude workaround. Generally it should be an unqualified name like `machine` in your case. Set the FQDN using `/etc/hosts` - it should be the first entry on the first line that contains the unqualified name as an alias, e.g. `127.0.0.1 machine.example.com machine localhost` – Felix Frank Jun 28 '14 at 22:34
  • 1
    @FelixFrank thanks for the comment. I did some research based on what you said and found these two relevant resources: http://jblevins.org/log/hostname http://serverfault.com/questions/331936/setting-the-hostname-fqdn-or-short-name – Dan Bowling Jul 11 '14 at 19:10
  • // , Is the `hostname` command the "canonical" or usual way to set a machine's host name in Linux? – Nathan Basanese Jan 15 '16 at 23:20
  • // , Like Jasmine Longes commented on http://serverfault.com/a/331942/282446, shouldn't /etc/sysconfig/network contain lines like: NETWORKING=yes, NETWORKING_IPV6=no, HOSTNAME=example.com, NISDOMAIN=example ? – Nathan Basanese Jan 15 '16 at 23:22