Jenkins - change master's ip

17.6k views Asked by At

I had a technical problem that forced me to change my jenkins master computer. I took the hard disk and moved it to a new computer, but now the IP of the master computer changed.

The master jenkins works but the slave nodes are marked as offline, and when I try to create new nodes the installation fails on the node pc. I noticed that the error I get when creating new nodes is connection time out, and i see the old IP.

How can I fix this?

2

There are 2 answers

2
Gilad Baruchian On

I found the solution, I will post it in case anyone else will have this problem:

  • Go to the jenkins folder in the slave node (this is the folder you defined when you created the node).
  • open jenkins-slave.xml and in change the ip address to the new address.
0
Jc Almonte On

I had a similar situation as the one described by Gilad, and i use the web start launch method (thanks Vitali for the comment). I solved it doing the following:

  1. In your jenkins Dashboard go to Manage Jenkins > Configure System
  2. Under Jenkins Location set the Jenkins URL to the new IP address of your server computer
  3. Save changes
  4. On jenkins dashboard under Build Executor Status click on your slave node
  5. Click launch button to download new slave agent with updated IP and save it in desired location. web start slave launch. On the picture, below the sentence "Run from slave command line" you should see a command that includes the new IP address

  6. Launch the slave agent and it should now connect to the new IP address successfully!

Hope this helps anyone else!