Commands 1
Commands 1
Commands 1
----------------------
HA-Proxy Configuration
-------------------------------------
# vi /etc/hosts
[press 'i' for insert ]
172.31.17.224 ip-172-31-17-224.us-east-2.compute.internal
172.31.17.146 ip-172-31-17-146.us-east-2.compute.internal
172.31.30.208 ip-172-31-30-208.us-east-2.compute.internal
[press 'Esc' key ]
[:wq ---> for write and quit ]
1
Page
Step-3: Install HA-Proxy :
-------------------------------------
Ubuntu / Debian :
* apt
* apt-get
Redhat / Amazon :
* yum
* rpm (Redhat Package Manager)
App-Server:
-----------------
* to deploy static and dynamic web-pages (.war files)
* path: /var/lib/tomcat/webapps
DB-Server:
----------------
* to Manage Data (insert, update, delete, select...)
# whoami
# sudo su - --> to switch for root user
# cat /etc/os-release
# apt-get update
# apt-get install openjdk-11-jdk -y --> to install java
# java -version
# which java
# apt-get install apache2 -y --> to install web-server
# apt-get install tomcat9 -y --> to install app-server
# apt-get install mysql-server -y --> to install db-server
# whoami
# sudo su - --> to switch for root user
# cat /etc/os-release
# yum update -y
# yum install java -y --> to install java
# java -version
# which java
3
# cd /var/www/html/
# ls
# rm index.html
# vi index.html
[press 'i' for insert ]
<h1> Hello from Web-Server-1 </h1>
<h1> Hello from Web-Server-1 </h1>
......
[press 'Esc' key ]
[:wq --> for write and quit ]
# vi /etc/default/haproxy
ENABLED=1
# curl http://localhost
# while true; do curl http://localhost; sleep 1; done
Dev + Op
-----------------
Cloud : Data storage, Servers (or) Instances
-----------------------------------------------
Page
#1. VM-Ware
#2. Virtual Box
#3. Vagrant
#4. Cloud (AWS, Azure, IBM, Google cloud, Oracle cloud...)
AWS-EC2 Instance
----------------------------
* create a new AWS account
* select "services" --> "Compute"
* select "EC2" (Elastic Compute Cloud)
* select "Launch Instances"
Google ---> search "Git for Windows" ---> download & Install Git-Bash
Linux commands
---------------------------
$ cp ~/Downloads/DEVOPS.pem ~/Desktop/
$ ssh -i "DEVOPS.pem" ec2-user@ec2-compute.amazonaws.com
$ cat /etc/os-release
$ whoami
$ who
$ date
6
Page