Friday, October 4, 2013

Hudson: A Continuous Integration Tool Master-Slave Configuration

In this post we will look into howtos of master slave setup in Hudson and Jenkins( it’s should be same).
1] One fascinating feature of Hudson is its endowment to run a job in a master-slave configuration, i.e., there would be a Hudson master machine which would take up all the requests like defining a job, configuring it, triggering it, etc., while there will be a set of slave machines on which the executions would actually happen.



2] Let’s say you want to define a job which has to be run on more than one platform. You define it in the Hudson master, the interface for all your configurations, and then tie it to all the machines that you would want to run the job on. The underlying mechanism of Hudson takes care of all the communication between the Hudson master and each of the slaves which are registered with it.
--> Now, we will see how to setup Hudson - the master and slave(s).
Setting up the Hudson Slave:
1] Open the Hudson URL localhost:7000 and go to Managed Hudson which is available in the Left sidebar.
clip_image004[6]
2] Now go to the “Managed Nodes” option available under that page.
clip_image006[8]
3] Now in that “Managed Nodes” page already master is exist, now we need to add the “Slaves” to it. In order add slave now just click the “New Node” option available in the left pane.
clip_image008[9]
4] Specify the slave name now and select the “Dumb Slave” radio button now, finally click OK.
clip_image010[9]
5] Now specify the number of executors, Remote File System Path and Select Launch Method as “Launch Slave agents on Unix Machine via SSH”. Along with also specify the remote machine details.
a] Hostname
b] Username
c] Password
d] SSH Port number
e] Java Path
And now, please don’t forgot to save it J
clip_image012[6]
6] It’s easy to monitor the availability of slave using the “Log” option available in the left pane.
clip_image014[6]
7] That’s it!! The slave is now added successfully to the master over SSH !!
clip_image016[6]
8] Now initiate some build process, that build will be automatically triggered on the remote machine. See the attached snapshot for reference.
clip_image018[7]
9] For verification go to the “Remote Slave – File System” specified at creation time of the slave. There you could able to see the directory workspace and all your associated build related files inside.
clip_image020[7]
10] Thank you !!

No comments:

Post a Comment