Wednesday, December 15, 2010

Hudson - Setting up Windows Slave

Several of my colleagues  had trouble installing Hudson slave on a Windows machine. I was at a client site, and so decided to write step-by-step instructions for installing the same. It worked, and everyone was happy. So, here comes the instructions with screen shots.

1.    Log into the windows machine where the slave needs to be setup.
2.    Open up a browser and connect to the master. http://yourmaster:yourport. In my case, it is http://windowsserver:7223
3.    Click on Manage Hudson -> Manage Nodes. This will bring the following page:



4. Click on New Node. Provide a slave name and check on Dumb Node, and click OK.


5.Next, provide all the details for this slave


6. Save the setting. Put the slave.jar in a folder. From this folder run the following command:
java -jar slave.jar -jnlpUrl http://yourmasterserver:7223/computer/windowsslave/slave-agent.jnlp
windowsslave is the name you gave for the slave machine

7. This will start the slave, and you should see it running as follows:

 8.    And the slave should be listed on your Hudson Master dashboard as shown below:

The folder specified while configuring the slave will have the following slaves libraries downloaded:
  • maven2.1-interceptor.jar
  • maven-agent.jar
  • maven-interceptor.jar
Wasn't that easy?

13 comments:

  1. From Where we will get slave.jar file.and which path we need to specify in Remote FS root.

    ReplyDelete
  2. When you connect to the Master from the slave machine, it downloads the slave.jar as well.

    ReplyDelete
  3. saved a buch of time !! Thanks! :)

    ReplyDelete
  4. Thanks a lot, I configured as mentioned but I face a problem.

    When I close the slave command prompt
    I get a error message as " hudson slave connection was broken " on the master node

    Why is this happening ?

    ReplyDelete
    Replies
    1. Am also facing this problem. Kindly let me know the solution

      Delete
  5. Just wondering.. is it possible for a slave to download the latest from SVN and run msbuild and nant tasks?

    ReplyDelete
  6. when i am trying to run the below command from slave machine i geting the below issue.Could you please help me on this

    C:\Program Files (x86)\Java\jre6\bin>java -jar d:/hudson/_slave.jar -jnlpUrl htt
    p://korvm027.apac.bosch.com:8080/computer/Slave/slave-agent.jnlp

    Failing to obtain http://korvm027.apac.bosch.com:8080/computer/Slave/slave-agent
    .jnlp
    java.io.IOException: Failed to load http://korvm027.apac.bosch.com:8080/computer
    /Slave/slave-agent.jnlp: 404 Not Found
    at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:229)
    at hudson.remoting.Launcher.run(Launcher.java:191)
    at hudson.remoting.Launcher.main(Launcher.java:167)

    ReplyDelete
  7. What value should I put in for "Remote FS root"?
    I saw you put /root/, but that looks like a UNIX path, while the slave is a Windows box.

    Thanks,

    Absolute-Beginner

    ReplyDelete
  8. Hi Meera,

    Thank your for the nice article, Could you please let me know if i can new add node using hudson-cli.jar then i want to use this node for various builds. if you had tried adding node please let me know the steps.

    Thanks,

    ReplyDelete
    Replies
    1. I haven't tried adding new nodes using the cli.jar.

      Delete
  9. CouldNotLoadArgumentException[ Could not load file/URL specified: http://u4vmsoabld01.aus.amer.dell.com:7001/hudson/computer/slave/slave-agent.jnlp]
    at com.sun.javaws.Main.launchApp(Unknown Source)
    at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
    at com.sun.javaws.Main.access$000(Unknown Source)
    at com.sun.javaws.Main$1.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    i am getting this issue could you please let me know

    ReplyDelete