Multipath configuration in Redhat Linux


Redhat multipathing Configuration:


A.Prerequesties:

#rpm -q device-mapper-multipath

B.Configure

#cd /etc
#mv multipath.conf multipath.conf.dist
#sed '/^#/d; /^$/d' multipath.conf.dist > multipath.conf

#vi multipath.conf

change to blacklist local harddrive only,

blacklist {
devnode "sda"
}

C. Start the Multipath service 

#service multipathd start
#chkconfig multipathd on

D. Verify the disk paths now

#fdisk -l
#sfdisk -s



Static route and Dynamic route add in Linux server




Here i posted about the static route add and Dynamic route add procedure in linux. 




A. Create a file - /etc/sysconfig/network-scripts/route-

To add a persistent static route in Redhat Enterprise Linux create a file called route-X in the /etc/sysconfig/network-scripts/ directory

where is the interface number and X is the interface number. As you would expect, these are specified in seperate file for each of the available interface.



B. Every entry or a route has three entities as follows:


GATEWAY=xxx.xxx.xxx.xxx
NETMASK=yyy.yyy.yyy.yyy
ADDRESS=zzz.zzz.zzz.zzz

As the names implies, they are the gateway IP, Netmask and the IP/Network Address

Note the next to each of the three entities. This number defines the route entry number and should be the same on all the entities.

Example:

GATEWAY0=192.168.1.2
NETMASK0=255.255.255.0
ADDRESS0=10.10.10.0


GATEWAY1=192.168.1.3
NETMASK1=255.255.255.0
ADDRESS1=20.20.20.2

C. Once the file is created, restart the network service as follows:

# service network restart

D.To view the routes type

# route

or 

#ip route show



A.To dynamically add a route, try the folowing:

Syntax:

# ip route add / via dev X

Example:

# ip route add 10.10.10.0/24 via 192.168.1.1 dev eth0

or 


Syntax:

# route add [-net|-host] netmask gw dev X

Example:

# route add -net 10.10.10.0 netmask 255.255.255.0 gw 192.168.1.1 dev eth0




How to clear the cache memory in Linux - Using drop_caches




Linux OS is maintaining cache for file-systems, memory pages etc to speedup the cpu process reducing the hard disk i/o. From 2.6.16 kernel a new mechanism has been introduced to have the kernel drop the pagecache, 
dentries or inodes cache which helps the administrator to throw away that script that allocated a ton of memory just to get rid of the cache.

Below is the steps we need to follow to clear the pagecache / and memory cache.


0 -> Will give the Kernel full control to the cache memory 
1 -> Will free the page cache 
2 -> Will free dentries and inodes 
3 -> Will free dentries and inodes as well as page cache



So, just enter those values to the file /proc/sys/vm/drop_caches, with echo, and as root:

sync; echo 0 > /proc/sys/vm/drop_caches
or

sync; echo 1 > /proc/sys/vm/drop_caches
or

sync; echo 2 > /proc/sys/vm/drop_caches
or

sync; echo 3 > /proc/sys/vm/drop_caches




Blogger Tips and TricksLatest Tips And TricksBlogger Tricks