Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins - change master's ip

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?

like image 355
Gilad Baruchian Avatar asked Dec 25 '22 18:12

Gilad Baruchian


2 Answers

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!

like image 185
Jc Almonte Avatar answered Dec 31 '22 12:12

Jc Almonte


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.
like image 23
Gilad Baruchian Avatar answered Dec 31 '22 11:12

Gilad Baruchian