Greetings !

AWS Free tier account and Creatiing ec2- instance guides are presnet in your LMS.

Also, attach 2 elastic ip to both the instances you launch. Please find below steps :

Below are the screenshots orderwise ( 879 -> 882)

Once both the elastic ip's are attached to instances, you can now use below url to see the steps to connect to instance.


Once we are connected to both the ec2 instances, we can use below guide to install the tools below

Master instance :

1) Puppetmaster
2) Git
3) Jenkins
4) Openjdk-8
5) Tomcat
6) Docker
7) Nagios

Slave Instance 

1) Puppet agent

1) Nagios installation guide is attached.
2) Puppet :

Actually we need to do this before nagios set up so that host names do not change.

As of now you can stop the running instances and create 2 new instances for Puppet master and Puppet Agent and perform the below steps.

1) Login to both the instances 
2) Create a root password for both 
  • sudo passwd
  • enter password and re enter password
  • su
  • you are root user now
  • cd
  • you will be in root directory of instance now
3) Edit /etc/hostname file for both instances as below :
  •    Instance 1 : puppetmaster.edureka.com
  •    Instance 2 : puppetclient.edureka.com
Reboot machines 

4) Edit /etc/hosts file for both instances :
 
  • Instance 1 : Add the public ip of puppetclient and hostname of puppetclient and this word "puppet client "
  • Instance 2 : Add the public ip of puppetmaster and hostname of puppetmaster and these words " puppetmaster" "puppet"
So, /etc/hosts file in both the machines should have details of both master and slave like shown below :

192.168.1.17 puppetclient.edureka.com puppetclient
192.168.1.16 puppetmaster.edureka.com puppetmaster puppet

6) Login as root on both instances and reboot the machines

7) Instance 1 : sudo apt-get update
                        sudo apt install puppetmaster
 
    Instance 2 : sudo apt-get update
                        sudo apt install puppet
 

Restart master daemon
 
sudo systemctl restart puppetmaster.service

On Instance 2 run below command :

sudo systemctl start puppet.service

sudo puppet agent --fingerprint

On Instance 1 Run below command :

sudo puppet cert list
sudo puppet cert sign puppetclient.edureka.com

On Instance 2 Run below command

sudo puppet agent --test

This should install puppet successfully, create certificate and pass it to master and install the apache2 in your instance 2 successfully.
336999
3) Jenkins installation :


image

Install OpenJDK 8 on Ubuntu

Add a repository, perform an apt-update and install JDK. The commands are as below: 

sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update 
sudo apt-get install -y default-jdk
sudo apt-get install -y openjdk-8-jdk

Installing Maven, Git


Execute the following commands
sudo apt-get install -y maven git

Configure git with following commands ( Username and Email are the ones you used when signed up in github.com) :

git config --global user.name EdurekaDemo 
git config --global user.email demouser@edureka.com
git config --global push.default simple

Verify maven with
mvn –version

TO INSTALL DOCKER :


Verify your kernel version 
uname -r

This has to be 3.13 and upwards. 

Update your Apt sources

sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates

Add new GPG key 
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

sudo apt-get update

Purge the old repo if it exists.
sudo apt-get purge lxc-docker

Verify it is pulling correct data
apt-cache policy docker-engine

Install linux extra packages
sudo apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual

install Docker
sudo apt-get install -y docker-engine

Start the daemon
sudo service docker start

verify It is correct
sudo docker run hello-world

Add user and group
sudo groupadd docker
sudo usermod -aG docker $USER

Restart Daemon
sudo service docker restart

358848:41453TO
Installation of Tomcat 


Perform an update and add an user called tomcat

sudo apt-get update
sudo groupadd tomcat
sudo useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat

wget http://Paste the Link you can get from Apache Tomcat website (core, .tar.gz)

sudo mkdir /opt/tomcat
sudo tar xvf apache-tomcat-8*tar.gz -C /opt/tomcat --strip-components=1
cd /opt/tomcat
sudo chgrp -R tomcat conf
sudo chmod g+rwx conf
sudo chmod g+r conf/*
sudo chown -R tomcat work/ temp/ logs/

Create a file to start tomcat as a service

sudo nano /etc/init/tomcat.conf

A sample file is listed below 

description "Tomcat Server"

  start on runlevel [2345]
  stop on runlevel [!2345]
  respawn
  respawn limit 10 5

  setuid tomcat
  setgid tomcat

  env JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
  env CATALINA_HOME=/opt/tomcat

  env JAVA_OPTS="-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom"
  env CATALINA_OPTS="-Xms512M -Xmx512M -server -XX:+UseParallelGC"

  exec $CATALINA_HOME/bin/catalina.sh run

  # cleanup temp directory after stop
  post-stop script
    rm -rf $CATALINA_HOME/temp/*
  end script

*Save the tomcat.conf file

*Restart Tomcat8

sudo initctl reload-configuration
sudo initctl start tomcat

Now to Change the Port of tomcat to 8083 and add a user over there :

1) To change port
  * First stop Tomcat : cd /opt/tomcat/bin/
                                  : ./shutdown.sh

 * Open server.xml file : cd /opt/tomcat/conf/
                                    : sudo gedit server.xml
                                  
Screenshot 1 : 
image
                           
Screenshot 2 :
image
     

Adding Users in Tomcat8 :

cd /opt/tomcat/conf/

sudo gedit tomcat-users.xml

image

Add 2 users, Once is to open manager app of tomcat and the other user credentials are for deployment in Jenkins :

image
Till here you are all set with tomcat.

You can goto check on your browser url : public_ip:8083 

Let us know if you need help.


We are ridiculously committed to you and your progress. 



Regards,
Yeshwanth at Edureka
edureka! Support Team


394488:41453