Jenkins master with JNLP slaves

In this document, I will show how to configure Jenkins master and slave nodes. In the slave nodes, AWS CLI and Docker must be installed and configured. All of the topology will be configured with Vagrant.

The network topology will be as following:
Jenkins-Network-Topology

I have used my WiFi card as the public network to direct connection in the Virtual machines. For that, you need to change your own Physical or WiFi card in the Vagrantfile configuration file.

Download codes from git repository and start all machines:

$ git clone https://github.com/jamalshahverdiev/jenkins-gitlab-gogs-webdeploy.git
$ cd jenkins-gitlab-gogs-webdeploy
$ vagrant up

Get ‘admin’ password for Jenkins master server:

$ vagrant ssh JenkMaster -c 'sudo cat /var/lib/jenkins/secrets/initialAdminPassword'
6990a0935e7149c28cacbf3a3110328a

Default login for Nexus is ‘admin’ and password is ‘admin123’. Jenkins listens on port 8080 and Nexus listens on port 8081.

Login to the Jenkins server:
jenkins-first-page

Go to the ‘Manage Jenkins’ -> ‘Manage Plugins’
jenkins-manage-plugins

At the end of list select ‘All’ -> ‘Download now and install after restart’
download-and-restart

Then go to the ‘Manage Jenkins’ -> ‘Manage Plugins’ -> ‘Available’ tab and then select checkbox ‘Self-Orginizing Swarm Plug-In Modules’ and then press the ‘Download now and install after restart’ button.
install-swarm-plugin

Create user for our slave nodes(This username and password is defined in our /etc/rc.local file for each of nodes). Go to the ‘Manage Jenkins’ -> ‘Manage Users’ -> ‘Create User’ then add username and password and press to the ‘Create User’ button
Manage-Jenkins.png
create-jenkins-user
create-jenkins-user1

Before connection slave nodes go to the -> ‘Manage Jenkins’ -> ‘Configure Global Security’
Jenkins-GLobal-Security-Configure

In the ‘TCP port for JNLP agents’ -> ‘Random’ and then press ‘Save’ button:
tcp-jnlp-random-save

Note it is important and there is a bug in the Jenkins. Before start slave nodes do the following thing in the master node. Go to the ‘Manage Jenkins’ -> ‘Configure System’ and then press ‘Save’ button.
Jenkin-Configure-system
Jenkin-Configure-system1

At the end we must see the similar result as flowing:
result-of-slave-nodes

Advertisements

One thought on “Jenkins master with JNLP slaves

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s