Tuesday, September 29, 2009

Clearing Sendmail queue

This one is quite old but still handy. For those of still using sendmail that ever felt the need of flushing the sendmail queue then this post is for you.

If you're worried about sendmail pending mail flush do the following two things:

1) manually method –> delete /var/spool/mail/*.* files in this dir –> delete /var/mqueue/*.* files

then check if all mail gone using mailq command. all mail will be deleted.

2) using command:

use simple command sendmail -v -q in root prompt. it will flush all pending mails.

3) if you want to delete a certain domain or user or recipient mail use this command

sendmail -qS -v test.com it will delete all mail from *@test.com

sendmail -qR -v hotmail.com it will delete all mail from recepient of hotmail….

Read the rest of this entry...

Bookmark and Share My Zimbio http://www.wikio.com

Tuesday, September 8, 2009

How to: Mounting an ISO image in Solaris

we can use the Loopback File driver to mount an ISO image without having to write the ISO image onto a CD or DVD.

Following procedure should help you mount an ISO image in Sun Solaris

Attach a Block Device

sunsolaris# lofiadm -a /export/software/iso_image.iso /dev/lofi/1

Mount the ISO Image block device

sunsolaris# mount -F hsfs -o ro /dev/lofi/1 /mnt

Where /mnt is the mount point.

This should mount the ISO image.

To confirm, change directory to /mnt and do a “ls” to lis the files

sunsolaris# cd /mnt

sunsolaris# ls

if at anytime, you want to look at these block devices simply type “lofiadm” command with no arguement.

sunsolaris# lofiadm
Block Device File
/dev/lofi/1 /export/software/iso_image.iso

When we are done with the files on the mounted ISO, we can unmount and detach the Block device we attached earlier:

sunsolaris# umount /mnt

sunsolaris# lofiadm -d /dev/lofi/1

Read the rest of this entry...

Bookmark and Share My Zimbio http://www.wikio.com

Thursday, September 3, 2009

How to: IPMP Load Balancing & Resilience in Solaris

P Multipathing (IPMP) in Sun Solaris enables the load balancing capabilities and resilience for Network connections with multple Network Interface Cards (NIC).

Discussed here is about providing resilience for network connections with multiple NICs on the system.

Now, we take it to the next step and make the network connections not only resilient but also load balance the network connections such that both the NICs participating in IPMP are active and forwards traffic. This improves the network throughput and thereby efficiency of the server especially if it is a critical system serving multiple connections.

The requirements to configure IPMP for load balancing are:

1. Two Virtual IP Addresses. These IPs are used by the Applications for data.

2. Test IP Address for each NIC. These IPs are not used by applications and are only used to prode a remote target device to check connectivity.

3. Each Interface has unique MAC-Address. By default in SPARC platforms, all NICs have a System-wide MAC-Address assigned and so they share a single MAC-Address.

The NICs doesn’t have to be of the same kind but have to be of the same speed (10/100/1000Mbps).

In our configuration,

192.168.1.99 – Virtual IP1

192.168.1.100 – Virtual IP2

192.168.1.101 – Test IP for ce0 (NIC1)

192.168.1.102 – Test IP for ce1 (NIC2)

appserver – Actual hostname

appserver-1 – Hostname for Data IP2

appserver-2 – Hostname for Data IP2

appserver-ce0 – Hostname for test IP on ce0 interface

appserver-ce1 – Hostname for test IP on ce1 interface

Add Host Entries in /etc/hosts

Let’s start with adding the hosts entries for the IP addresses in the /etc/hosts file.

# IPMP group appserver-ipmp
127.0.0.1 localhost
192.168.1.99 appserver-1 loghost
192.168.1.100 appserver-2 appserver loghost
192.168.1.101 appserver-ce0 loghost
192.168.1.102 appserver-ce1 loghost

We have configured a hostname for each of the Virtual IPs and the Test IPs. However, the Test IPs should not be used by applications for any network connections.

Create hostname.ce* files

For every interface on the system create a hostname.ce* file. For us, create the files

hostname.ce0 & hostname.ce1

Edit hostname.ce0

Add the following on the hostname.ce0 file. This is the primary or master interface of the IPMP Pair

appserver-ce0 netmask + broadcast + group appserver-ipmp deprecated -failover up \
addif appserver netmask + broadcast + failover up

where
netmask – assigns the default netmask

broadcast – assigns the default broadcast value

group – specifies the IPMP group

deprecated – indicate test Interface not be used for data transfer

-failover – makes the test interface not to failover

Now, the configuration is complete and an ifconfig output should look like as follows:

root@ appserver:/$
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
ce0: flags=9040843 mtu 1500 index 2
inet 192.168.1.99 netmask ffffff00 broadcast 192.168.1.255
groupname appserver-ipmp
ether 0:xx:xx:xx:xx:x
ce0:1: flags=1000843 mtu 1500 index 2
inet 192.168.1.101 netmask ffffff00 broadcast 192.168.1.255
ce1: flags=69040843 mtu 1500 index 3
inet 192.168.1.100 netmask ffffff00 broadcast 192.168.1.255
groupname appserver-ipmp
ether 0:xx:xx:xx:xx:x
ce1:1: flags=1000843 mtu 1500 index 4

inet 192.168.1.102 netmask ffffff00 broadcast 192.168.1.255

Now, both the NICs will forward traffic and when one of the inerface fails, it transparently failover the virtual IP address onto the other active interface and you can see an interface “ce1:2″ would be created for the failed over IP. When the link is restored, this will be failed back to the ce0 interface. There should be no disruption to the network connections

Read the rest of this entry...

Bookmark and Share My Zimbio http://www.wikio.com