"Unable to fetch my node definition" after using DHCP

asked 2018-12-25 20:29:52 -0600

Dear All,

Here's my problem -- I'm new to puppet -- and I just tested in my lab with puppet master -- static IP/hostname, and puppet nodes -- static IP/hostname and it works fine. -- at that time -- my /etc/hosts ---

[root@pos1 etc]# cat hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

0.0.0.0 pos1.localdomain.com pos1

192.168.160.134 pos1.localdomain.com pos1 192.168.160.132 pxe.localdomain.com pxe

But while I moved puppet nodes to DHCP -- and I rewrite my /etc/hosts -- [root@pos1 etc]# cat hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 0.0.0.0 pos1.localdomain.com pos1

192.168.160.134 pos1.localdomain.com pos1

192.168.160.132 pxe.localdomain.com pxe

It failed to connect to puppet master -- still static IP (pxe.localdomain.com)  and the error messages --

[root@pos1 ~]# puppet agent --test Warning: Unable to fetch my node definition, but the agent run will continue: Warning: Failed to open TCP connection to pxe.localdomain.com:8140 (Connection refused - connect(2) for "pxe.localdomain.com" port 8140) Info: Retrieving pluginfacts Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Failed to generate additional resources using 'eval_generate': Failed to open TCP connection to pxe.localdomain.com:8140 (Connection refused - connect(2) for "pxe.localdomain.com" port 8140) Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet:///pluginfacts: Failed to open TCP connection to pxe.localdomain.com:8140 (Connection refused - connect(2) for "pxe.localdomain.com" port 8140) Info: Retrieving plugin Error: /File[/opt/puppetlabs/puppet/cache/lib]: Failed to generate additional resources using 'eval_generate': Failed to open TCP connection to pxe.localdomain.com:8140 (Connection refused - connect(2) for "pxe.localdomain.com" port 8140) Error: /File[/opt/puppetlabs/puppet/cache/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: Failed to open TCP connection to pxe.localdomain.com:8140 (Connection refused - connect(2) for "pxe.localdomain.com" port 8140) Info: Loading facts Error: Could not retrieve catalog from remote server: Failed to open TCP connection to pxe.localdomain.com:8140 (Connection refused - connect(2) for "pxe.localdomain.com" port 8140) Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run Error: Could not send report: Failed to open TCP connection to pxe.localdomain.com:8140 (Connection refused - connect(2) for "pxe.localdomain.com" port 8140)

I think it maybe due to the node's hostname invalid -- but as I tested -- the local hostname works -- [root@pos1 etc]# ping pos1.localdomain.com PING pos1.localdomain.com (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.036 ms 64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.057 ms ^C --- pos1.localdomain.com ping ... (more)

edit retag flag offensive close merge delete