How do I set up a windows_slave agent via JNLP, If I have a Jenkins master configured on linux?

0 votes
I have a Jenkins master configured on Linux platform (ubuntu 18.04 virtual machine) and I need to configure a Windows-slave agent via java web start. How do I set up the node,and launch it?
Jun 3 in Jenkins by Sam
• 290 points
48 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

JNLP(JAVA NETWORK LAUNCH PROTOCOL) is used to Connect to/launch your java application( here Jenkins) from a remote location.

In order to setup a windows-slave agent you need to first Enable the JNLP Agents :

  • Go to Manage Jenkins -> Configure Global Security -> under Agents section -> TCP port for inbound agents -> select Random ->Save.

To set-up the Windows-slave agent:

  • Go to Manage Jenkins -> Manage Nodes ->click on New Node -> Enter the node name -> Select permanent agent.


     

  • Enter a sample description and the no of executors (ie. no of jobs you want to run parallely on windows),here I have given 1 executor.

  • Also specify the remote root directory which will act as the default jenkins workspace on the slave agent (F:\jenkins_remotedirectory is my remote root workspace on windows).

  • Give a label and for launch method ->select  launch agent by Connecting it to the master since we are configuring a windows slave (launch agents via ssh is for linux machines).

  • Click on Save

  • We have configured the slave machine but haven't launched the agent yet. 

  • In order to run any jenkins job on the master we had installed certain dependencies like Git (for source code management), JDK and Maven (for building the jobs). 

  • Similarly we need to download and install those dependency tools on our windows-slave (including setting the environment variables for JAVA_HOME and MAVEN_HOME).Test whether the tools are aptly configured and installed and mention the tool locations by specifying their paths in the windows-slave machine.

  • Next step is to connect the slave agent with the master. You can either do this by clicking on the launch button or you can do it via command line by executing the command that is mentioned.

  • Here I decide to launch the connection via command line.For this I have to first download the agent.jar file and paste it in my remote root directory that I have specified as workspace for windows-slave(F:/jenkins_remotedirectory). And then from the remote root directory in command prompt  of my slave agent I need to run the specified command.

  • NOTE: The IP address of the jenkins master could be some random IP. You need to specify the IP of your machine on which Jenkins master is configured.


     
  • Now the widows-slave is successfully configured and launched as shown below:




     
  • The widows-slave agent is now functional and the master can delegate any job to the slave agent node.
answered Jun 3 by Sirajul
• 940 points

Related Questions In Jenkins

0 votes
1 answer

I’m facing a login error when I try to run Jenkins on Docker. How do I solve this?

You have to open the /var/log/jenkins/jenkins.log file to ...READ MORE

answered Jul 24, 2018 in Jenkins by Sophie may
• 9,330 points
119 views
0 votes
1 answer
0 votes
2 answers

How can I make Jenkins CI with Git trigger on pushes to master?

Generic webhook trigger can be useful When configured ...READ MORE

answered Aug 13, 2018 in Jenkins by lina
• 8,100 points
67 views
0 votes
1 answer

How do I start jenkins on my Virtual Machine?

To start the Jenkins server please follow ...READ MORE

answered Dec 17, 2018 in Jenkins by Arohi
162 views
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.