Madan Linux
Madan Linux
Google ===>> aws console login ==>> AWs management console ===>> sign into console
==>>> create new account ==>> email : xyz , password 1243 , conform password : 1234
==>> Aws account name : ==>> continue..
==>>> debit card details ==>> 16 digits number ==>> CVV ===>>> OTP ( 2/-) ===>>> do
you have pancrad : no ===>>
AWS ==> verification ==>> mobile number ===>> voice message / text message (select)
==>> 4 digits ( 5896 )
my role is : student
AWs console login ==>> sign in ==>> email id with password ===>>
===================================================================================
======================
1. gitbash
2. putty
===================================================================================
======================================
Datacenter : physical linux servers ===>> hardware ===>> o.s install ( linux )
===>> application and databse installl ==>> APP ===>> EU.
AWS ==>> Cloud ===>>> AMI ( amazon machine image) ==>> Ec2 instance ==>>>
application and databse installl ==>> APP ===>> EU.
1. sun solaris 2. Redhat Linux ( open source and free of cost ) 3. IBM-AIX 4. HP-
UNIX..
Other remaining these three are enterpraise versions ===>> License purhase ===>>>>
manadatory..
windows :
Linux :
/ ==>>> root ===>>> operating system install ===>>> rootuser / parent user / super
user / Admin user.
===================================================================================
==================================================
ec2 : elastic cloud compute : ec2 ==>>> virtal machine. ==>>> ec2 instance.
Every AMI has their own identification number ===>> AMI ID.
Every operarting sysrem has their own AMI. ==>> o.s install.
security group :
ec2-user ( default user ) ===>> able to login we need to add a rule ==>> ssh
( mandatory)
===================================================================================
===========
when ever you created a ec2 intsance ==>> then automatically two Ip addresses will
come.
===================================================================================
===============
afetr launching the ec2 instance ===>> defaultly create publickey key .
privatekey and publickey -->>> match --->>> default user able to login into ec2
instance ( ec2-user).
===================================================================================
==================
===================================================================================
====================
Files operations :
I am new to linux ..
S3 and RDS ..
cat filename
cat ramakrishna
cp source destionation
mkdir directoryname
mkdir sachin
mv source destionation
mkdir directoryname
mkdir yuvi
mv oldname newname
mv ramakrishna srinivas
touch filename
touch abc
touch {a..m}
7. file1 ==>>>data and file2 empty file ==>> file1 data copy to file2. ==>>>
redirect.
cat file1 > file2
rm -rf filename
rm -rf ramakrishna.
===================================================================================
=
===================================================================================
=
directory operations :
mkdir directoryname
mkdir sachin
cd sachin
pwd
/home/ec2-user/sachin
mkdir rahul
cd rahul
pwd
/home/ec2-user/sachin/rahul
mkdir hardik
cd hardik
pwd
/home/ec2-user/sachin/rahul/hardik
mkdir lara
cd lara
pwd
/home/ec2-user/sachin/rahul/hardik/lara
cd ..
/home/ec2-user/sachin/rahul/hardik
cd ..
/home/ec2-user/sachin/rahul
cd ..
/home/ec2-user/sachin/
cd ..
/home/ec2-user/
mkdir -p /home/ec2-user/sachin/rahul/hardik/lara/ponting
cd /home/ec2-user/sachin/rahul/hardik/lara
pwd
/home/ec2-user/sachin/rahul/hardik/lara
cd ../../../../
pwd
/home/ec2-user/
================================
mv oldname newname
mv sachin dhoni
rm -rf directryname
rm -rf sachin
===================================================================================
==============
filter commands :
useradd ramakrishna
useradd bhargavi
more : page by page ===>> more /etc/passwd ==>>> space button press ==>> last page
==>> automatically exit..
less : page by page ==>> less /etc/passwd. ==>>> space button press ==>> last page
==>> not exit ==>>> q button press ==> quit
===================================================================================
===============
vi editor :
files ===>>> create , with in the files ==>> data ==>>> modify and delete by using
vi editor..
1. CLI mode.
2. Insert mode.
3. Extended mode.
I am new to Linux..
cat ramakrishna
===================================================================================
==============================
10 files
ramakrishna
ls -l | grep ramkrishna
ls -l | grep 123
ls -l | grep abc
ls -l | grep a
ls -l | grep A
i ==>> ignore case sensitive
ls -l | grep -i A
find :
options :
1. files
2. directories
3. users
4. groups
=================================================================
ls -l
- ==>> file
d ==>> directory
1. symbolic method.
2. Absolute method.
=======================
1. symbolic method.
=========================================================
2. Absolute method.
========================================================================
========================================================================
Booting process :
ex: windows ==>> power on button ==>> press ==>> password ====>> in between poweron
button and passowrd process ==>> Booting process..
Linux ==> power on button ==>> press then booting process will starts.
4. KERNEL :
5.INIT : initialization.
6. RUNLEVELS :
system integrity check ==>> system's hradware check ==>> motherboard , cpu , ram ,
harddisk ==>> properly working or not ??
vi /boot/grub/grub.conf
/boot/grub/grub.conf ==>>> this configuration file link to /etc/grub.conf.
4. KERNEL :
5. INIT :
init 2 ===>> multiuser mode with out network ( networking related commands are not
working)
init 3 ===>> multiuser mode with network ( networking related commands are working
here) ==>> default init level
init 6 ===>>> reboot ==>> danger command ===>> with respective people ==>>
approval.
vi /etc/inittab
6. RUNLEVELS :
shell scripts ==>>> application install or backup ==>> scripts to put inside inside
runlevels.
===================================================================================
==========
===================================================================================
===============
500gb harddsik ===>> 10 parttions ==>> each partition has the size ==>> 50 gb..
4 , 8 , 12 , 16.
Each physical linux servers ==>> 16 hard disks attached one linux servers..
/dev/sda to /dev/sdp
extranal we will attached to the physical linux server ==>>> /dev/sdf to /dev/sdp..
LInux ==>> file system types ==>> ext2 , ext3 , ext4 ( latest )
senario :
Application team ==>> request raise to linux admin team ==>> 500 gb ==>> disk space
( hard disk) ==>>>file sysyem ==>> app5 ==>> mount point ==>> application install.
Linux admin team ==>> request raise SAN ( storage area network ) team ==>> please
attach 500 gb hard disk to lx123 ( linux server name ).
SAN team request raise to data center people ( field engineers ) ==>>> lax123
==>attach to 500gb hard disk. ==>>> they will attach 500gb hard disk to linux
server.
4. mkdir app5
vi /etc/fstab
esc shift:wq!
8. cd app5
ls
touch {a..e}
reboot
===============================================================================
Application team ==>> request raise to linux admin team ==>> 500 gb ==>> volume
==>>> filesystem ==>>> app5 ==>> mount point ==>> application install.
EBS thumbrule :
After login into the ec2 instance ==>> device naming convension to display
diffrent. ==>>> /dev/xvdf to /dev/xvdp.
4. mkdir app5
vi /etc/fstab
esc shift:wq!
8. cd app5
ls
touch {a..e}
reboot
===============================================================================
ebs history :
===================================================================================
=========================
Networking :
Physical servers point of view ==>> data center ===>> onpremise infrastructure.
2. Each servers has at least one NIC card ( Network interface card / controller..)
4. After login into physical servers==>> eth0 ===>> logic nic name ==>> 192.168.0.1
( IP address ) and subnetmask ==>> 255.255.255.0.
===================================================================================
===
Networking advantages..
2. Remoteuserly login ==>> from one server to another server. ==>>> applications
install..
===================================================================================
=======
1. vi /tmp/central.pem
1. vi /tmp/central.pem
==============================================================================
1. How to transfer files from one server to another server.
touch bhargavi
touch ramakrishna
===================================================================================
=================
ssh -i /tmp/central.pem [email protected] ==>> enter ==>> now you are in server2.
ssh -i /tmp/central.pem [email protected] ==>> enter ==>> now you are in server1.
===================================================================================
====================
nic card logical name , up , running ,mtu ( memory tranfer unit )==>>9001
cd /etc/sysconfig/network-scripts
ls
ifcfg-eth0 ifcfg-eth1
vi ifcfg-eth0
IPADDR=192.168.20.5
save
vi /etc/sysconfig/network
hostame = xyz.com
save
===================================================================================
==================
hostname
xyz.com
===================================================================================
=================
===================================================================================
============
Each Linux servers has one Ipaddress along with one subnetmask..
4 * 8 = 32 bits..
We will decide Ipaddress ==>>> which class it will be avaible based on the first
bit.
CLASS A : 0 to 127 ===>> 255.0.0.0 ==>> subnetmask ====>>> CIDR block ==>> /8
CLASS B : 128 to 191 ===>> 255.255.0.0 ==>> sunbetmask ==>> CIDR block ==>> /16
===>> VPC
CLASS C : 192 to 223 ===>> 255.255.255.0 ==>> subnetmask ==>> CIDR block ==>> /24
==>> subnet.
CLASS D : R&D
CLASS E : unused.
CIDR block / notation ==>> we will decide the cidr notation based on the
subnetmask..
our own network ==>>> how many Ipaddresses will relases and In this network ==>>
how many ec2 instances will create.??
2. host portion ( dynamic and change) ==>> last 2 bits. ==>> 2 power 16 ===>> 500.
30.50.10.40 ==>> SBI network ==>>> in this network 500 Ipaddresse release ==>> 500
ec2 instances will create in this SBI network..
30.50.11.40
30.50.12.40
30.50.13.40
30.50.14.40
.
.
.
30.50.300.40
30.50.300.41
30.50.300.42
30.50.300.43
.
.
.
===========================================================================
2. host portion ( dynamic and change) ==>> last 1 bits. ==>> 2 power 8 ===>> 256
90.50.40.25 ==>> HDFC network ==>>> in this network 256 Ipaddresse release ==>> 256
ec2 instances will create in this HDFC network..
90.50.40.26
90.50.40.27
90.50.40.28
90.50.40.29
90.50.40.30
.
.
.
90.50.40.281
===================================================================================
==
windows ==>>> softwares like ==>> vlc media player , pdf , msooffice..
LINUX : RPM and YUM ==>> packages ==>> install , uninstall , verify , information ,
update , upgrade.
update ==>>> linux version 5.2 ===>>> linux version 5.5 ===>> patching.
step 1 :Physical linux server ===>> cd / dvd disk ===>>> group of packages copied
into cd / dvd disk.
Physical linux server ===>> cd / dvd disk ===>>> insert ==>>> all packages ==>>
copy to any location of the physical server.
rpm update
rpm upgrade
httpd install ==>> dependent ==>> java ==>> first you need to install java and
after that you need to install httpd.
To overcome the above drawbacks in RPM then YUM came into the picture.
step 1 :Physical linux server ===>> cd / dvd disk ===>>> group of packages copied
into cd / dvd disk.
Physical linux server ===>> cd / dvd disk ===>>> insert ==>>> all packages ==>>
copy to any location of the physical server.
vi /etc/repos.d/bhargavi.repo
[bhargavi]
gpgcheck = 0
enabled =1
esc shift:wq!
yum list
yum update -y
yum upgrade -y
========================================================================
1. cd / dvd disk ==>> no need insert. ==>> these instances are virtual instances.
===================================================================================
===
reload ===>> service ===>> httpd ==>>> install ==>>> internet issue ==>> 80 %
install==>> remaining 20 % install ==>> stop and start.
===================================================================================
===================================================================================
======
===================================================================================
======
Job ==>> task ==> perticular interval of time schedule ==>> job scheduling or job
automation.
1. at job.
2. cron job.
at task of time.
step of task
at now
mkdir sachin
at 10:30 am
ifconfig -a
ctrl + d ==>> save.
==>> when ever you created a job then automatically linux operating system gives a
one unique id ==>>> job id.
at rm 1234
===============
at , cron jobs are follows round robin algorithem.==>>> first in first out.
===================================================================================
cron jobs : It is used to repetative taks.. ====>> poll scm , build peridically
==>> jenkins.
crontab -e ==>>here we will create cron jobs and cronjobs has the fields..
* * 2 3 0 ./backup.sh
* ==>> all
*/2-4
*/ 2,4,6
crontab -l
crontab -r
crontab -u
===================================================================================
=
Troubleshooting commands / performance tuning / health checkup commands.
7. top ==>> process running , stop , uptime , load average , cpu , memory ,
swap ...etc..==>> exit ==>> press q button.
11. netstat ==>> networking statistics information ; netstat -nr ==>>> routing
table information.
===================================================================================
================
[root@ip-172-31-14-39 ec2-user]#
[root@ip-172-31-14-39 ec2-user]# history
1 ps
2 ps -elf
3 bg
4 fg
5 ps -ef | grep smon
6 ps -ef | grep pmon
7 top
8 top
9 iostat
10 vmstat
11 free -m
12 netstat
13 netstat -nr
14 sar
15 uptime
16 history
[root@ip-172-31-14-39 ec2-user]#
[root@ip-172-31-14-39 ec2-user]#
===================================================================================
=========================