linux slave is not coming online after jenkins service restart. Jenkins master is on windows - jenkins

I have my jenkins installed on windows . and have two linux node added to it.
for some reason I needed to restart the jenkins service and now my linux is not coming online.but
when I go to these nodes I can see the option to mark them offline Which I believe comes when node is actually online like below
[![enter image description here][2]][2]
How To bring these nodes back online. before jenkins restart everything was fine and I have not made any changes to slaves.
**Changes I made to jenkins.xml before restart was **
Changed the java version
<executable>C:\Program Files\Java\jdk-17.0.5\bin\java.exe</executable>
Added keystore value in pre existing argument
<arguments>-Xrs -Xmx512m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -Dhudson.model.DirectoryBrowserSupport.CSP="" -jar "%BASE%\jenkins.war" --httpPort=-1 --httpsPort=8000 -httpsKeyStore="jenkins.jks" --httpsKeyStorePassword=xxxxx -webroot="%BASE%\war"</arguments>

I don't think your changes had anything to do with the error. Try these options:
Go into the Linux VMs and make sure they are online
Ping the Linux VMs from the master VM to see if they are reachable
Edit the slave node configuration, check everything is as it was before, and save
Finally, remove the slave nodes and add them again

Related

How to set / connect jenkins slave agent back on previous machine

Is there any possibility to set a slave agent back to the previous machine without deleting the agent / node? Will the node be completely deleted if i'm deleting the agent?
In my case for example, if someone has installed by accident the agent via "Launch"-Button (Java WS) on an other machine. But this other machine is not intended to have an connection with the agent (because of missing files and wrong user).
He got the option displayed to add an agent for his current used machine (wrong machine) which led to the problem, but now i don't see this option ("Launch"-Button) anymore to reconnect the agent with the previous necessary machine.
Maybe this could be a resolution?
Already tried:
Using following command line on required slave machine in C:\Jenkins:
java -jar slave.jar -jnlpUrl http://<<build-server:port>>/computer/<<agent name>>/slave-agent.jnlp
Execution wasn't successful..
Thanks in advance!!

Jenkins - Master Slave set up questions

I followed tutorial to get Jenkins set up on Windows.
What i have is:
Jenkins running with recommend plugins installed
Jenkins URL changed to http:// my ipv4:8080/
A project with a simple command [echo hi]
For nodes i currently have just the Master node which is tied to my main PC
My goal is have one computer send a command to all the slave PC's so they run a python script i created.
I create a windows VM and connected to the Jenkins server. I logged in with the admin account and created a new node.
I cant find anything useful to help me figure out what to put in launch command. When i launch my node on the VM without the launch command specified, it fails to launch.
Is the batch script i wrote in the project, what's sent to all the slave machines or do I have this all wrong?
Thank you!
EDIT
I got it working thanks to the answer posted here. I wrote up a doc on how i got Jenkins working from installation to deployment. There are other resources out there but i hope this will help someone.
Jenkins Master/Agent Setup
If you want to have the option Launch slave agents via Java Web Start you should specify the TCP port for slaves.
It is done through Manage Jenkins > Configure Global Security > TCP port for JNLP agents. You can select fixed port 50000. More info here.

Jenkins Windows Slave Disappears on restart

I have a Jenkins master setup which has 2 linux slaves and a windows slave. I have a configuration where all boxes are switched off in the night and restarted in the morning. The Jenkins master shows 2 linux nodes in the morning however it does not show windows slave (it just disappears and not even shown offline). The Jenkins version I am using : 2.73.
The problem was related to swarm configuration which was resolved after putting together correct configuration files and enable on machine startup (to handle a situation if the machine goes down).

Jenkins port incorrect from API

I want to run Jenkins on a non-default port, so I modified Jenkins.xml like this:
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=1010</arguments>
It works properly from http://servername:1010 (and not from http://servername:8080) but the API (http://servername:1010/api/json?depth=1) still reports the path to the jobs on port 8080. (i.e. "url":"http://servername:8080/job/NameOfTheJob/)
I am running Jenkins version 1.632 on Windows, and have stopped/started Jenkins after making the configuration change, as well as rebooted the server.
You also need to re-configure the base URL in the Jenkins configuration. Under Manage Jenkins -> Configure System -> Jenkins Location, set the Jenkins URL to the appropriate value. In my Jenkins (1.609.1), applying the change was enough to fix the REST API results (no reboot was necessary).

Is this a supported Jenkins Master-slave configuration?

We have a master Jenkins running on a Linux system. The same master is attached as node using "Launch slave via execution of a command on the master". It has the same FS root as the JENKINS_HOME. The command is ssh "machine_name" "shell_script"
The shell script gets the latest slave.jar and runs it.
The master has 0 executors. The node has been given 7. I'm seeing weird behavior in the builds, like workspaces being deleted once a day, etc. I'm not sure if this is related to the way the Jenkins Master-slave is configured.
Any ideas if this is a supported configuration?

Resources