I am migrating my setup to a new Jenkins server and I am faced with an interesting issue. Agents will not connect to the master unless I specify the hostname in the Jenkins URL config. My old server never suffered this issue though. The IP address of the server (it's Natt'd) resides in the URL config and the agents connect fine.
My agents are connecting in a headless manner and one thing I noticed is that on the old server, the JNLP connection seems to look for multiple addresses when connecting:
INFO: Locating server among [ IP ADDRESS, HOSTNAME ] - where the actual values reside in the array.
On the new server though, the single value is the IP ADDRESS. So the question is, where would I configure the agents to look at multiple addresses/URL's for the master?
CodePudding user response:
I think this is because my old jenkins is running a version prior to 2.249 where the alternate URL had support. As per https://www.jenkins.io/doc/upgrade-guide/2.249/#alternate-url-removed-from-inbound-agent
Unfortunately, I don't see where to add the -url change. When I add that as an arg to my agent.jar command, it tells me that -url is not an option.
Update: The reason why the -url arg wasn't found was because agent.jar didn't support it. However, running in -headless -classpath mode with hudson.remoting.jnlp.Main had it. All working now!