Showing posts with label Step by Step. Show all posts
Showing posts with label Step by Step. Show all posts

Thursday 3 May 2018

How to configure Network Bonding on RHEL 7

Step by Step method to configure the network bonding on RHEL 7:
 
➤ Please log on to linux server and run the "ip a" command to check the available interfaces.

    [root@localhost]# ip a
    lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever

    eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:50:56:bd:c7:f9 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.2 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever

➤ Load the bonding driver called “bonding” in the kernel with the modprobe command if it is not already loaded, and verify with the modinfo command:

[root@localhost]# modprobe bonding
[root@localhost]# modinfo bonding
 
➤ In this step you need to generate UUIDs for interfaces using the below command.

[root@localhost]# uuidgen <interface-name>
 
➤ Now create a file called ifcfg-bond0 in the /etc/sysconfig/network-scripts directory for bond0 with the following settings. Please use vi editor to edit this file.

[root@localhost]# cd /etc/sysconfig/network-scripts
[root@localhost]# vi ifcfg-bond0

DEVICE=bond0
Name=bond0
TYPE=bond0
BONDING_MASTER=yes
BONDING_OPTS="mode=balance-rr"
ONBOOT=yes
IPADDR=192.168.1.23
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
 
➤ Now create ifcfg-eth2 and ifcfg-eth3 files in the /etc/sysconfig/network-scripts directory for eth2 and eth3 interfaces with the following settings. Set the MASTER directive to bond0. Both interfaces will act as slaves with no IP addresses assigned to them.

[root@localhost]# vi ifcfg-eth1

DEVICE=eth1
TYPE=Ethernet
NAME=eth1
UUID=23a32d65-343d-48a2-8rf7-d2jh2388f666
ONBOOT=yes
MASTER=bond0
SLAVE=yes

[root@localhost]# vi ifcfg-eth2

DEVICE=eth2
TYPE=Ethernet
NAME=eth2
UUID=22a32d65-443d-48d2-8rf7-d2jh222f666
ONBOOT=yes
MASTER=bond0
SLAVE=yes
 
➤ Now deactivate and reactivate bond0 with the ifdown and ifup commands:

[root@localhost]# ifdown bond0; ifup bond0
 
➤ Check the status of bond0 and the slaves with the ip command. It should also show the assigned IP.

[root@localhost]# ip addr
 
➤ Restart the system to ensure the configuration survives system reboots
[root@localhost]# reboot

Thursday 26 April 2018

How to update and upgrade ESXi host

Please find the below steps and command to update and upgrade the ESX host.

You need to understand first, the update and upgrade both are different thing in case of ESX.

Update means you have update the VMware release build.

Upgrade means you have upgrade the VMware version like 5.0 to 6.0 

Please find the below command to update the VMware release build:

# esxcli software vib update -d /vmfs/volumes/updates/VMware-ESXi-5.1.0-Update3-2323236-HPE-510.9.5.0.30-Apr2016-depot.zip

It is asking for reboot please press true and reboot the esx host gracefully, once the host reboot successfully check the new release build. 

Please find the below steps to upgrade the ESX host:

Now we need to upgrade the ESX host from 5.1.0 to 5.5.0 , to perform this task please follow the below steps

Take a remote console of this ESX host from ILO.

Copy the VMware-ESXi-5.5U1-Rollup_2ISO.iso

attached the iso with remote console

boot the ESX host with attached iso VMware-ESXi-5.5U1-Rollup_2ISO.iso

When esx boot this iso during upgrade process it is asking for you 3 option, please select the below option.

Upgrade the ESX host with keeping existing datastore.

Once the upgrade will be successfully, please login on the esx host and check the latest version and all service will working fine.

Please let me know if you have any question regarding this upgrade issue.

Tuesday 24 April 2018

How to add linux host in Active Directory (AD) domain

Before performed such work, please collect the below information:-

Host: Server name which need to be add in AD
DA account: .da account which used to add server to domain
Domain name

Please find the below process step by step to add a server in to AD:-

[root@localhost ~]# hostname localhost.redhat.com

[root@localhost ~]# adinfo

Not joined to any domain
Licensed Features: Enabled

[root@localhost ~]#  adjoin -u xyz.da --name localhost -a localhost.redhat.com -w redhat.com

xyz.da@REDHAT.COM's password:
Using domain controller: redhat01.redhat.com writable=true
Join to domain:redhat.com, zone:Auto Zone successful
Centrify DirectControl started.
Loading domains and trusts information
........................

Note: .da account required to add server in domain

Monday 5 February 2018

How to start/stop and enable/disable Firewall on Redhat 7 Linux system

In RHEL7, to stop/start and enable/disable the firewall is quite different from RHEL6. In Red hat 7 "firewalld" named service we used for local firewall. Please find the below example step by step to check the firewall status.

How to check status of RHEL7 firewall:

[root@localhost ~]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
Active: active (running) since Thu 2018-02-05 12:37:47 IST; 0 months 1 days ago
Main PID: 332 (firewalld)
CGroup: /system.slice/firewalld.service
           └─332 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
Feb 05 12:37:47 localhost systemd[1]: Starting firewalld - dynamic firewall daemon...
Feb 05 12:37:49 localhost systemd[1]: Started firewalld - dynamic firewall daemon.

In the above status firewall is by default enable on the linux system. It is enable automatically when system restart or on.

How to Stop and Start RHEL7 firewall:
 
Please use the below commands to start stop the firewall on redhat linux 7 operating system. 

[root@localhost ~]# service firewalld stop
Redirecting to /bin/systemctl stop  firewalld.service
Stopped firewall will start again after system's reboot.

[root@localhost ~]# service firewalld start
Redirecting to /bin/systemctl start  firewalld.service

How to Disable and Enable RHEL7 firewall:

If you want to disable permanently firewall so that after reboot it is not enable again, please use the below command.

[root@localhost ~]# systemctl disable firewalld
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'

If you want to enable the firewall again run please use the below command.

[root@localhost ~]# systemctl enable firewalld
ln -s '/usr/lib/systemd/system/firewalld.service' '/etc/systemd/system/basic.target.wants/firewalld.se

Thursday 11 January 2018

SSH login without password in linux

If you want to connect one Linux host to other Linux host through SSH with password-less connection then you need to perform below steps.

Lets suppose you need password-less login from host "server01" / user "redhat" to host "server02" / user "centos".

1. First login in on "server01"as user "redhat" and generate a pair of authentication keys.

[redhat@server01]# ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/home/redhat/.ssh/id_rsa):
Created directory '/home/redhat/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/redhat/.ssh/id_rsa.
Your public key has been saved in /home/redhat/.ssh/id_rsa.pub.
The key fingerprint is:
1e:4f:05:79:3a:9f:96:7c:2b:ad:e9:58:37:sc:37:e4 redhat@server01

Note: Do not enter a passphrase.

2. Now you use ssh to create a directory ~/.ssh as user "centos" on server02.

Note: If directory already exist, you do not create it again.

[redhat@server01]# ssh centos@server02 mkdir -p .ssh

centos@server02's password:

Finally append redhat's new public key to centos@server02:.ssh/authorized_keys and enter centos's password one last time:

3. Now copy the rsa key to server 02 ssh authorized_keys file

[redhat@server01]# cat .ssh/id_rsa.pub | ssh centos@server02 'cat >> .ssh/authorized_keys'

centos@server02's password:

Now you can log into server02 as "centos" from server01 as "redhat"a without password.

4. Now you can test the password less connection.

[redhat@server01]# ssh centos@server02

You are successfully login on the server02 without any password.

Note:  In case of any permission issue you need to set "700" permission on .ssh folder on server02.

Tuesday 18 July 2017

NFS mount on Solaris 11 Non-Global zones systems

In this article, we would learn how we mount folder from one Non-Global zone to another zone on Solaris 11 operating system using network file sharing.

For an example, we can use take a two local zone "sunz01" & "sunz02". We will mount one folder named "/export/backup" from "sunz01" local zone to another zone "sunz02" on "/project/export/data" location.

Step by Step method of NFS mount on Solaris 11:
 
➦ In the first step we will create the directory on "sunz02" zone where we want to mount the folder.

sunz02#mkdir /project/export/data
 
➦ In second step, we will make a configuration for this process. So for this work you need to login on global zone with root access and make an entry on the dfstb configuration file.

sun#vi /etc/dfs/dfstab

share -F nfs -o rw=sunz02 /zones/sunz01/root/export

If you see the above entry, we have provided the read/write access to directory on sunz02 server where we mount the folder from sunz01 local zone.
 
➦ In next step you need to login on sunz02 server and mount the shared folder using below command.

sunz02#mount sun:/zones/sunz01/root/export/backup /project/export/data
 
➦ Once you run the above command the folder is mount from one local zone to another zone temporarily. You can go to the directory and verify that the data which is listed on /export/backup folder is show on sunz02 directory.
 
➦ In the last step you need to restart the NFS service on the global zone so the configuration files and other changes makes affect. But these configuration are available until we are not taking reboot of the zone.

If you have any query regarding this topic, please post your comment here, we will get back to you shortly.

Thursday 13 July 2017

How to mount CIFS file system on Linux Operating server machine

Generally on linux or Unix operating system servers when we are mounting the any other linux machine folder is quite easiy in comparision to mount the window shared folder on linux machine.

Step by Step method for Mount CIFS on Linux Server:
 
➤ In the initial step we will gather all rpm's or packages information which is required for CIFS file system.

[root@localhost]# rpm -qa | grep cifs
cifs-utils-4.8.1-20.el6.x86_64

if you see the above output, this packages is required for CIFS file system on Linux system. So you can install this rpm using rpm command if you have rpm packages on the server otherwise you will install the packages using YUM utility.

[root@localhost]# rpm -ivh cifs-utils-4.8.1-20.el6.x86_64.rpm

if you are using YUM, then please install the packages using below command.

[root@localhost]# yum install cifs-utils*

it is installed all required dependency related to CIFS file system.
 
➤ In this step, we will create the mount point on the server where we need to mount the CIFS file system.

[root@localhost]# mkdir -p /backup/cifs

We will create the above mount directory where i will mount the file system.
 
➤ Now, we will create a CIFS user and assign a password so the user can access mount folder.

[root@localhost]# touch /etc/cifspasswd
[root@localhost]# chmod 600 /etc/cifspasswd

[root@localhost]# vi /etc/cifspasswd

user=castwebsvc
password=*******
 
➤ In this step we need to make a permanent entry of mounted file system so once we reboot the machine mounted file system not umount.

[root@localhost]# vi /etc/fstab

ADD fstab entry :

//WindowsServer/share /mount/point cifs rw,mand,user=USER,password=PASS 0 0

Example :
//192.168.0.1/CAST_data4/AICCodeUpload  /backup/cifs cifs   rw,mand,credentials=/etc/cifspasswd         0 0

You can take an example for your system. Please change the mount point as per your requirement.
 
➤ In the final step you need to mount the file system using below command.

[root@localhost]# mount /backup/cifs
[root@localhost]# mount -a

Using above command the CIFS file system has been mounted successfully

Tuesday 4 July 2017

Step by Step Configuration of NTP Server on HP-UX Server

In this post, I would like to explain how we configure the NTP (network time protocol) server on HP-UX operating system server. In my recent post you can found the NTP configuration on Solaris and AIX platform. 

As you know NTP ( Network time Protocol) is one of the oldest internet protocol still in use and it allows the synchronization of computer clocks distributing UTC (Coordinated Universal Time) over the network. It is basaiclly used for time synchronization on Unix servers.

Step by Step Configuration of NTP Server on HP-UX:

➤ In the first step we will check the configuration files of "xntpd" daemon. By default the configuration file for this daemon is "/etc/rc.config.d/netdaemons".

hpx:/> vi /etc/rc.config.d/netdaemons

######################################
# xntp configuration.  See xntpd(1m) #
######################################
#
#  Time synchronization daemon
#
# NTPDATE_SERVER: name of trusted timeserver to synchronize with at boot
# (default is rootserver for diskess clients)
# XNTPD:        Set to 1 to start xntpd (0 to not run xntpd)
# XNTPD_ARGS:  command line arguments for xntpd
#
# Also, see the /etc/ntp.conf and /etc/ntp.keys file for additional
# configuration.
#
export NTPDATE_SERVER=
export XNTPD=0
export XNTPD_ARGS=

This is default configuration entry of this file so for xntpd daemon we need to change the variable which is defined.

export NTPDATE_SERVER='ntp.in.pool.org'
export XNTPD=1
export XNTPD_ARGS=

Note: You must change the NTPDATE server name.

➤ For ntp config please set the correct timezone is setup in /etc/TIMEZONE file.

hpx:/> cat /etc/TIMEZONE
TZ=IST-5:30
export TZ

You can edit the file in vi editor and change the time zone as per your location.

➤ Now, we need to make some changes in NTP configuration files. 

hpx:/> cat /etc/ntp.conf
#Configuration NTP des serveurs
server ntp.in.org.com
server ntpin.in.org.com

You need to replace ntp server name accordingly. In my post I will use dummy server name.

➤ After setting the NTP server name we need to restart the NTP service on HP-UX operating system and verify the ntp configuration.

hpx:/> /sbin/init.d/xntpd restart

hpx:/> ntpq -p

If it is showing you correct ntp server information now. You can match these information with the NTP server name which we use in above step.

Sunday 28 May 2017

How to add a new disk on Logical Volume Manager (LVM) in AIX Operating System

AIX logical volume manager (LVM) is a widely used tool for logical volume management which includes allocating disks and resizing logical volumes.

Using logical volume manager, a hard disk or set of hard disk is allocated to one or more physical volumes. Logical volume manage (LVM) allows users to create partitions from more than one disk and allows them to extend the filesystem size online within few seconds.

In below text, you can find how to add a new drive in AIX operating system using LVM.

Step by step method to add a new disk on LVM:

➤ Initially we need to add the new physical or virtual disk to the logical partition. After successfully adding virtual disk you need to re scan your server hardware so we can get the new disk information.

For scanning please run the below command on AIX server terminal.

ibm_aix:/> cfgmgr

The command output show you the available new disk which are connected to this AIX machine.

➤ Let’s assume that the new disk is hdisk01,please run the below command to check the disk.

ibm_aix:/> lsdev -Cc disk
hdisk00  Available  Virtual SCSI Disk Drive
hdisk01  Available  Virtual SCSI Disk Drive

In above output two disk is available hdisk00 & hdisk01.

➤ You need to create a new group and move the new disk hdisk01 in there. Let's assume the new group named is "rootvg". So please find the below command to create a new group and add the disk in it.

ibm_aix:/> mkvg -y rootvg hdisk01

in this step we add "hdisk01" into "rootvg".

➤ "lspv" command is used for getting an information about the new disk "hdisk01". Please find the "lspv" command output as given below.

ibm_aix:/> lspv hdisk01
PHYSICAL VOLUME:    hdisk01                   VOLUME GROUP:     rootvg
PV IDENTIFIER:      00f68f03d1e42951 VG IDENTIFIER     00f68f0300004c0000000153d1e429c1
PV STATE:           active
STALE PARTITIONS:   0                        ALLOCATABLE:      yes
PP SIZE:            128 megabyte(s)          LOGICAL VOLUMES:  17
TOTAL PPs:          799 (102272 megabytes)   VG DESCRIPTORS:   2
FREE PPs:           118 (15104 megabytes)    HOT SPARE:        no
USED PPs:           681 (87168 megabytes)    MAX REQUEST:      256 kilobytes
FREE DISTRIBUTION:  11..00..00..00..107
USED DISTRIBUTION:  149..160..159..160..53
MIRROR POOL:        None

If you look the above output you can see the all information regarding the new disk in details.

➤ In this step, you need to create a log logical volume for jfs2 file system and this needs to be part of volume group "rootvg".

ibm_aix:/> mklv -t jfs2log rootvg 1

➤ Please check the new logical volume (lv) and  used the "lsvg" command to check the new logical volume present on the AIX server.

ibm_aix:/> lsvg
rootvg

The command shown you he existing logical group on the server.

ibm_aix:/> lsvg -l rootvg
rootvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
hd5                 boot       1       1       1    closed/syncd  N/A
hd6                 paging     404     404     1    open/syncd    N/A
loglv00             jfs2log    1       1       1    open/syncd    N/A
hd4                 jfs2       4       4       1    open/syncd    /

In above output, you can see "rootvg" is volume group present and in rootvg, you can find the logical volume "loglv00".Now we create a logical volume and fixed their size , lets assume we will used 20GB size and used the logical volume name lv_aix.

ibm_aix:/> lsvg rootvg
ibm_aix:/> mklv -t jfs2 -y lv_aix rootvg 30G
ibm_aix:/> mkfs -o log=/dev/loglv00 -V jfs2 /dev/lv_aix

➤ After successfully create filesystem, we will mount the filesystem to a particular folder.

ibm_aix:/> mkdir /aix
ibm_aix:/> mount -o log=/dev/loglv00 /dev/lv_aix /aix

So, nwly "/aix" filesystem has been created, for permanent it, please make an entry in "/etc/filesystems file. So when you will take a reboot of machine the filesystem not umount.

Please comment on the post, if you have any query regarding this topic.

Sunday 21 May 2017

Step by Step method to enable SAR (System Activity Reporter) on Solaris Server

When you work on Solaris operating system, you need to managed the performance of the operating system. If the performance are very good then your server behave normal and run the long time without any issue.

Sometime your Solaris server performance is not good and memory and resource utilization get very high, then you need to find out what is the cause of this high utilization and if you are working on client project then your client must want the report.

So on Solaris server we are used SAR (System Activity Reporter) to generate all the report related to server health.

SAR (System Activity Reporter) is used to troubleshoot the performance issue on Sun Solaris Servers. Using SAR (System Activity Reporter) we can troubleshoot or monitored the disk, memory or CPU performance issues on the Solaris operating system servers.

Step by step procedure to enable SAR (System Activity Reporter):

⏩ By default SAR utility are installed on the Solaris 11 operating system. If you want to check the current service status of SAR, then you need to run the below command.

!-[solaris]# svcs status sar
disabled        May_22  svc:/system/sar:default

You can used also below command to check the current status of SAR services.

!-[solaris]# svcs -a | grep -i sar
disabled        May_22  svc:/system/sar:default

In above command output, if you see currently the sar service is disable so in the next step we need to enable this service

⏩ In this step, you need to enable the SAR services which is disable on the my solaris server.

!-[solaris]# svcadm enable svc:/system/sar:default

Using above command the SAR service has been started, if you want to check the current status please run the below command.

!-[solaris]# svcs status sar
enabled        May_22  svc:/system/sar:default

⏩ We will make a setup for automatic data collection, once we enable the sar service. The default script for SAR utility are located the below directory location.

/usr/lib/sa/sa1➤ This is a shell script to collect and store data in the binary file /var/adm/sa/sadd, where dd is the current day.

/usr/lib/sa/sa2➤ This is a  shell script for generating daily report in the file /var/adm/sa/sardd, where dd is current day.

As these above script are used normally to collect the automatically data from Solaris Server. If you required the daily report or weekly report then you need to add both the script in crontab file which is describe in next step.

⏩ If you required the SAR report regularly then you need to make an entry of above script on the crontab file.

!-[solaris]# crontab -e

Using these command you can edit the existing file and make an entry of above script according to your requirement when you want to generate the report.

Please comment on my post, if you have any query related to this sar topic.

Sunday 14 May 2017

How to configure YUM Server in Red Hat Linux 7 Operating System

This is my first post, hope you are like my blog content. I am trying to provide you the simple and straight forward solution on this post.

In this post, I will guide to you, how to configure YUM server in Red Hat Linux 7 operating system. Yum tends for Yellowdog Updater Modified utility which used for package management system on Linux environment. In the below post, you can find the step by step method of configuration and installation of YUM.

Step by Step Method of Installation & Configuration of YUM:

➤ If you have Red Hat Linux 7 operating system image or cd, then please mount this iso or cd on cdrom device of operating system.

[root@localhost]# mount -o loop /dev/cdrom /mnt

In above command syntax, you can able to see we have mount the our Red Hat Linux 7 operating system image on /mnt file system. Normally /mnt file system are used for mounting purpose only but its depends upon every user understanding.

➤ Please create a directory where you want to copy the all packages files for configuration of YUM server.

[root@localhost]# mkdir /"Directory Name"

In linux operating system mkdir command are used for creating a directory. In my case I normally use "/yumserver" name for YUM configuration. When you create a directory please change your directory name.

➤  Please copy the all files from "/mnt" directory to /"Directory Name".

[root@localhost]# cp -rvf /mnt/* /"Directory Name"

Using this command all the packages files are copied on the other place, you need to keep save this directory otherwise your YUM configuration is not works.

➤ In this step, we will go the the packages directory and install the required rpm packages which are required for installation of YUM server.

[root@localhost]# cd /yumserver/Packages

You can use your directory name to reach the packages folder. Now once we reached in this directory then we will install the required rpm packages one by one in below sequence.

[root@localhost]# rpm -ivh deltarpm-3.6-3.el7.x86_64.rpm
[root@localhost]# rpm -ivh python-deltarpm-3.6-3.el7.x86_64.rpm
[root@localhost]# rpm -ivh createrepo-0.9.9-23.el7.noarch.rpm

If you are trying to install the above rpm packages and not follow the above installation of rpm's in same sequence then you are definitely getting an dependency error.

➤ For creating a repo packages, you need to createrepo of all the packages, for this please run the below command on your terminal window.

[root@localhost]# createrepo  –v /yumserve/Packages

Please change the yum directory name which you used in above steps. Using this command all the packages repo has been created on the yum directory.

➤ Create a repo file on the below directory location. Please used the valid name while creating a repo file.

[root@localhost]# cd /etc/yum.repos.d/
[root@localhost]# vi yumserver.repo

You can change the repo file name according to your feasibility. Now please write the below entry inside this file.
#########################
[Packages]
baseurl=file:///yumserver/Packages 
gpgcheck=0
enable=1
########################

This is the main file content, so please more careful while doing the entry in this file. You can change the baseurl location as per your YUM packages directory location. After saving the file go for final step.

➤  In final step, as you configured the YUM configuration file, now you need to clean your yum repo and used it for installation the packages.

[root@localhost]# yum clean all

When you run this command , some space from /var file system get free, actually during packages installation /var file system get increase sometimes.

[root@localhost]# yum list

above command show you all the yum repo which exist on this server. In our case you can find the yumserver repo.

To test the yum server is configured properly or not then please run the below command to installed the any packages on the server using yum commands.

[root@localhost]# yum install samba*

When you run this command, if all the packages related to yum are installed that's means your YUM server installation and configuration are successful. If you are see any error then please check the above all steps configuration one by one.