Tuesday, 2 September 2014

Redhat Enterprise Linux – Network Bonding

Bonding is a feature to combine two or more network interface to form a single, logical “bonded” interface, for redundancy or increased throughput purpose.
We can configure Linux bonding in 7 different modes. The behavior of the bonded interfaces depends upon the mode.

1. Balance-rr (mode 0)
2. Active-backup (mode 1)
3. Balance-xor (mode 2)
4. Broadcast (mode 3)
5. 802.3ad (mode 4)
6. Balance-tlb (mode 5)

7. Balance-alb (mode 6)

Balance-rr (mode 0): Configuring a bonding Channel between eth0 and eth1 using the default mode.

1)# service NetworkManager stop
#chkconfig NetworkManager off

2)Bonding module should be configured and loaded. To enable bonding module, create a bonding.conf file as below.
Note : you can add multiple entries to create multiple bonding channels like bond0, bond1, bond2…etc

# cat > /etc/modprobe.d/bonding.conf
alia bond0 bonding
options bond0 mode=1 miimon=100 

3. Create a configuration file for the bonding channel i.e. bond0, as below
# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.50.111
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS=”mode=0 miimon=100″

4.) Create configuration files for all the interfaces  i.e. eth0 and eth1, which are participating in the bonding channel.
# cat > /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
HWADDR=aa:bb:cc:dd:ee:ff  
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
# cat > /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth0
BOOTPROTO=none
HWADDR=yy:xx:zz:aa:bb:cc
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

5. Activating Bonding Channel 
a. With out rebooting
# modprobe bonding
# service network restart
b. with reboot
# reboot
6. Verify that Bonding channel is active, by using the commands
# cat /proc/net/bonding/bond0 
Ethernet Channel Bonding Driver: v3.0.2 (Nov 25, 2012) 
Bonding Mode: adaptive load balancing 
Primary Slave: None 
Currently Active Slave: eth0 
MII Status: up 
MII Polling Interval (ms): 100 
Up Delay (ms): 0 
Down Delay (ms): 0 
Slave Interface: eth0
MII Status: up 
Link Failure Count: 0 
Permanent HW addr: aa:bb:cc:dd:ee:ff

Configurable Bonding Parameters:-
max_bonds : specifies the number of bonding devices that can be configured on single bonding driver.
xmit_hash_policy      : Slecect the transmit has policy to use for slave selection in balance-xor and 802.3d modevice. Possible values , layer2 (default) , larer2+3 or layer3+4
arp_interval : Specifies the ARP link monitoring frequency in milli seconds
arp_ip_target : Specifies the IP addresses to use as ARP monitoring peers when arp_interval is > 0. Multiple IP addresses must be seperated by comma. At least one IP addres must be given for ARP monitoring to work. Max. no. of target IPs are 16.

arp_validate : Specifies Whether or not ARP probes and replies should be validated in the active-backup mode. This causes the ARP monitor to examine the incoming ARP requests and replies, and only consider a slave to be up if it is receiving the appropriate ARP traffic. Possible values  
none(0) – default value
active(1) – validate only the active slave
backup(2) – validate only the backup slave
all(3) – validate all slaves
miimon : Specifies the MII link monitoring frequency in milliseconds. A value of 0 disables the MII link monitroing. A value of 100 is recommended.
updelay : specifies the time, in milliseconds, to wait before disabling a slave after a link recovery has been detected.
downdelay : specifies the time, in milliseconds, to wait before disabling a slava after a link failure has been detected.
use_carrier : specifies whether or not miimon shoudl use MII/ETHTOO “ioctls for value of 0 ” or ” netif_carrier_ok() for value 1 ( default value)” functions to determine the link status.

Sunday, 11 May 2014

What is a container?

 A native, default zone on the Oracle Solaris 10 OS is called a container. The other containers that run on Oracle Solaris 10 include Oracle Solaris 8 Containers and Oracle Solaris 9 Containers. Many people use the terms "zone" and "container" interchangeably.

how to install JAVA in LINUX?

download  latest version of java and extract it in /usr/local #./jdk-6u14-linux-i586.bin

#which java : display java location

#cd /usr/local
#ln -s jdk1.6.0_14 java : create soft link with name java
#mv /usr /bin/java /usr /bin/java.org
#ln -s /usr/local/java/bin/java  /usr/bin/java
#/usr/bin/java -version : it will display the latest version of java


Thursday, 8 May 2014

password expiration extension command for UNIX?

LINUX:-

if password has expired.no need to reset password.we can extend the password.

#chage -d <date year-month-day:current date>  user

solaris:
#usermod -e  <data it has to expire> username

in solaris,suppose to day date is may10th. u have to give as auguest10th. i.e password has extended up to aug 10th. in linux u have to give to day date.

Monday, 5 May 2014

how to synchronize system local time with hwclock by using NTP server in LINUX?

Following is the process to synchronize  local time with hwclock by using NTP server.


  • ntpdate
  • ntpdate <server name>
  • check system date by using #date command.
  • #hwclock --show : it will display hwclock
  • #ntpstat : communicate with ntp server and display time.
  • check which time zoemne has mentioned in server  #cat /etc/sysconfig/clock.
                ls -ltr /etc/localtime
                rm -rf /etc/localtime
                ln -s /usr/share/zoneinfo/America/Denver /etc/localtime
                ls -ltr /etc/localtime
      now check hwclock and system date as same.

  •          still if you are facing problem,check  /etc/ntp.con file with ntp server details.

how to bring newly added disk under control of LVM ?

#first check all available disks: fdisk -l
#check pvs and lvs
#create disk partition using : fdisk /dev/sdb
#create physical volume : pvcreate /dev/sdb1
#create volume group : vgcreate mysql_vg /dev/sdb1
#create logical volume : lvcreate -L 20G -n datavol mysql_vg
#make a file system : mkfs.ext4 -m 2 /dev/mysql_vg/datavol
#create a mount point 
#mount the Partition : mount /dev/mysql_vg/datavol  <mount point>  

Saturday, 3 May 2014

how to scan LUNS in LINUX with out rebooting server?

first check busing fdisk -l command.
if new luns has not detected.before that take lun id from storage team.it is easy to identify lun.

#powemt config
Assuming that there are two hbas, numbered 0 and 1 :-

echo "- - -" > /sys/class/scsi_host/host0/scan

echo "- - -" > /sys/class/scsi_host/host1/scan

#echo "1" > /sys/class/fc_host/host0/issue_lip
#echo "1" > /sys/class/fc_host/host1/issue_lip
then,
powermt display dev=all | grep "Pseudo"
powermt display dev=all | grep "Logical device"
we can check with lun id provided by storage team.

Thursday, 1 May 2014

how to remove logical volume form LVM

unmount the partation : umount  <mount point>

remove logical volume : lvremove <lv name>

check with lvdisplay command,to check status.

vgremove <vg name > : remove volume group

pvremove /dev/sdb1 : remove physical volume

fdsik -l : check the physical partations.