Bootstrap a Node 3 and Deploy Apache Web Server

Share via:

Bootstrap a Node 3 and Deploy Apache Web Server

In this article,we will see Bootstrap a Node 2 and Deploy Apache Web Server.

Implementation Steps

Bootstrap a Node 3

  1. Check Availability Zone of your workstation.
  2. Create a Node “Chef-Node-1” by launching instance.
  3. Open your workstation Linux terminal through putty.
  4. Switch to root user.
  5. Go to chef-repo.
  6. Run bootstrap command to bootstrap a node 2.
  7. Verify bootstrap nodes.

Deploy an Apache Web Server

  1. Attach recipe “ktexperts-apache-recipe’rb” to node “ktexperts-node 2”.
  2. Verify recipe in run list.
  3. Verify the content of node 2 “Chef-Node-2”.
  4. Modify recipe “ktexperts-apache-recipe.rb”.
  5. Upload cookbook to chef server.
  6. Verify the content of node 1 “Chef-Node-1”.

Bootstrap a Node 3

Check Availability Zone of your workstation

we can see the Availability Zone “ap-south-1a” of your workstation.

Note

Workstation is in ap-south-1a AZ.

we create a node in the same Availability Zone “ap-south-1a”.

we need to open SSH and HTTP ports.

we need to specify some commands in the userdata while launching instance.

Create a Node “Chef-Node-3” 

Launch Linux EC2 Instance

Check below link to Launch Linux EC2 Instance.

Launch Linux EC2 Instance

We can see the node  “Chef-Node-3” which was created earlier.

 

Open your workstation Linux terminal through putty

Switch to root user

[ec2-user@ip-172-31-42-243 ~]$ sudo su [root@ip-172-31-42-243 ec2-user]#

Go to chef-repo 

[root@ip-172-31-42-243 ec2-user]# cd chef-repo/ [root@ip-172-31-42-243 chef-repo]#

Run bootstrap command to bootstrap a node

we need specify private IP key file of chef-node-1 in bootstrap command.

Copy private IP of chef-node-3

Specify username,private IP(chef-node-2) and pem key “chef.pem” (chef-node-2) in the bootstrap command.

Note

Two actions will be done while bootstrapping.

Adding node to chef server.

Installing chef package.

 Verify bootstrap nodes

To the bootstrap nodes

The ktexperts-note 3 has added to chef server successfully.

Deploy an Apache Web Server

We have already uploaded the recipe to chef server.

Attatch recipe “ktexperts-apache-recipe’rb” to node “ktexperts-node 3”

Verify recipe in run list

Verify the content of node 1 “Chef-Node-3”

Copy the IPV4 Public IP of node 1″Chef-Node-3″

Search IPV4 Public IP in browser

We can able to see the content of node 3 “Chef-Node-3”

Modify recipe “ktexperts-apache-recipe.rb” 

Note

:wq! — to quit.

Upload cookbook to chef server

we can’t upload individual recipes so,we can upload cookbook that the recipe present inside the cookbook itself.

Verify the content of node 3 “Chef-Node-3”

Refresh IPV4 Public IP the browser

we can see the content has been modified successfully.

 

Thank you for giving your valuable time to read the above information.

Follow us on 

Website :  www.ktexperts.com

Facebook Page : KTexperts

Linkedin Page : KT EXPERTS

Share via:
Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading...

One thought on “Bootstrap a Node 3 and Deploy Apache Web Server

  1. This is such a great platform which contains experts on various technologies and we can expect immediate answers to the most difficult queries. Kudos!

Add Comment