0% found this document useful (0 votes)
14 views7 pages

Lab 5 (Jenkins Slave Configuration)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views7 pages

Lab 5 (Jenkins Slave Configuration)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Jenkins Slave Configuration

STEP1- Create a Slave EC2 Ubuntu Instance server:

STEP 2- Install jre on slave Ubuntu instance

1. sudo apt-get update


2. sudo apt-get upgrade
3. install a Java Runtime Environment: sudo apt-get install openjdk-8*
4. sudo apt-get install default-jre

STEP 3- By default SSH plugin not installed in your Master Instance. We have to install
manually.
 manage plugins -> search ssh in available tab -> select check box for ssh plugin to install
without restart.

STEP 4- Install nginx in your slave instance.

Use of nginx: Setting up an Nginx Proxy for port 80 -> 8888


we need to setup Nginx to proxy port 80 to 8888 so that you can keep Jenkins on 8888.

Command- sudo apt-get install nginx

Remove default configuration:


 $ cd /etc/nginx/sites-available
 $ sudo rm default ../sites-enabled/default
 Open new file /etc/nginx/sites-available
 Creating a file: sudo vi jenkins
After Creating jenkins file please paste the below code and change that if your port number is
different and paste masters node (public dns ipv4)
Note: Please look into the yellow to make changes in your jenkins file

upstream app_server {
server 127.0.0.1:8888 fail_timeout=0;
}

server {
listen 80;
listen [::]:80 default ipv6only=on;
server_name ec2-34-207-115-93.compute-1.amazonaws.com;

location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;

if (!-f $request_filename) {
proxy_pass http://app_server;
break;
}
}
}
Link the configuration from sites-available to sites-enabled
 sudo ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/
 sudo service nginx restart

STEP 5– Go to Jenkins page and look for Build Executor Status


Creating a New Node and name it:

STEP 6– Changes to be made


 remote root directory always - /home/Ubuntu
 Launch Method- Launch slave agents via SSH
 Host- Always Slave IPv4 Public IP
 Press Add Jenkins
 Kind: Select SSH Username with private key
 Username always- Ubuntu is your user name.

Open your Terminal:

 Copy your Private Key code and Select Enter Directly and paste your Master Node
Private Key
Look for Credentials and select Ubuntu and save it.

Node is created

 Open node and Click on Log to check Connections will be allowed or not.

You might also like