Tuesday, 30 April 2013

What does the status D,R,S,Z indicate when i run top /ps aux command?

PROCESS STATE CODES:
       D   uninterruptible sleep (usually IO)
       R   runnable (on run queue)
       S   sleeping
       T   traced or stopped
       Z   a defunct ("zombie") process

       For BSD formats and when the "stat" keyword is used, additional letters may be displayed:
       W   has no resident pages
       <   high-priority process
       N   low-priority task
       L   has pages locked into memory (for real-time and custom IO)

Linux process state codes

Here are the different values that the s, stat and state output specifiers
(header "STAT" or "S") will display to describe the state of a process.

D Uninterruptible sleep (usually IO)

R Running or runnable (on run queue)

S Interruptible sleep (waiting for an event to complete)

T Stopped, either by a job control signal or because it is being traced.

W paging (not valid since the 2.6.xx kernel)

X dead (should never be seen)

Z Defunct ("zombie") process, terminated but not reaped by its parent.

For BSD formats and when the stat keyword is used, additional characters may be displayed:

< high-priority (not nice to other users)

N low-priority (nice to other users)

L has pages locked into memory (for real-time and custom IO)

s is a session leader

l is multi-threaded (using CLONE_THREAD, like NPTL pthreads do) 

+ is in the foreground process group

THE LINUX STUFF: MongoDB Installation and Configuration on Centos6....

THE LINUX STUFF: MongoDB Installation and Configuration on Centos6....: What is MongoDB? MongoDB (from “humongous”) is a scalable, high-performance, open source, schema-free, document-oriented database. Writt...

Saturday, 27 April 2013

Tips : How do I forcefully unmount a Linux disk partition?

Understanding device error busy error:

What happens basically, is that Linux / UNIX will not allow you to unmount a device that is busy. There are many reasons for this (such as program accessing partition or open file) , but the most important one is to prevent data loss.

Try the following command to find out what processes have activities on the device/partition. If your device name is /dev/sdb1, enter the following command as root user:


# lsof | grep '/dev/sda1'


Output:
vi 4453       vivek    3u      BLK        8,1                 8167 /dev/sda1
 
Above output tells that user vivek has a vi process running that is using /dev/sda1. All you have to do is stop vi process and run umount again. As soon as that program terminates its task, the device will no longer be busy and you can unmount it with the following command:

# umount /dev/sda1


Following disussion allows you to unmout device and partition forcefully using Linux commands.

Linux fuser command to forcefully unmount a disk partition:

Suppose you have /dev/sda1 mounted on /mnt directory then you can use fuser command as follows:

Type the command to unmount /mnt forcefully:

# fuser -km /mnt


Where,
  • -k : Kill processes accessing the file.
  • -m : Name specifies a file on a mounted file system or a block device that is mounted. In above example you are using /mnt
Linux umount command to unmount a disk partition You can also try umount command with –l option:

# umount -l /mnt


Where,
  • -l : Also known as Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore. This option works with kernel version 2.4.11+ and above only.

If you would like to unmount a NFS mount point then try following command:

# umount -f /mnt


Where,
  • -f: Force unmount in case of an unreachable NFS system
Caution: Using these commands or option can cause data loss for open files; programs which access files after the file system has been unmounted will get an error.

Tuesday, 23 April 2013

Veritas Cluster Server (VCS)


Chapter 1:Introducing Veritas Cluster Server

Veritas Cluster Server by Symantec is a high-availability solution for cluster configurations. Veritas Cluster Server (VCS) monitors systems and application services, and restarts services when hardware or software fails.

  • A single VCS cluster consists of multiple systems that are connected in various combinations to shared storage devices.
  • When a system is part of a VCS cluster, it is a node. VCS monitors and controls applications running in the cluster on nodes.
  • Applications can continue to operate with little or no downtime.

Figure 1-1 Example of a four-node VCS cluster 



















  • Client workstations receive service over the public network from applications running on VCS nodes. VCS monitors the nodes and their services.
  • VCS nodes in the cluster communicate over a private network.
  • VCS runs in a replicated state on each node in the cluster.

About shared storage :

  • A VCS hardware configuration typically consists of multiple nodes that are connected to shared storage through I/O channels.
  • Shared storage provides multiple systems with an access path to the same data. It also enables VCS to restart applications on alternate nodes when a node fails, which ensures high availability


    Figure 1-2 illustrates the flexibility of VCS shared storage configurations.
















About LLT and GAB :

VCS uses two components, LLT and GAB, to share data over private networks among systems.

1. LLT (Low Latency Transport) : it's provides fast, kernel-to-kernel communications, and monitors network connections.

LLT configuration files are as follows:
/etc/llthosts—lists all the nodes in the cluster
/etc/llttab file—describes the local system’s private network links to the other nodes in the cluster


2. GAB (Group Membership and Atomic Broadcast) : It monitors disk communications such as the VCS heartbeat utility.
The /etc/gabtab file is the GAB configuration file.


About network channels for heartbeating :

  • For the VCS private network, two network channels must be available to carry heartbeat information.
  • Each Linux cluster configuration requires at least two network channels between the systems. The requirement for two channels protects your cluster against network partitioning.


About VCS optional features :

                                                                   1. VCS notifications
                  1. VCS global clusters 
                     
                  2. I/O fencing


Note : The Veritas Installation Assessment Service (IAS) utility allows the preinstallation evaluation of a configuration, to validate it prior to starting an installation or upgrade.

VCS notifications:
You can configure both SNMP and SMTP notifications for VCS. Symantec recommends you to configure one of these notifications .

  • Configure SNMP trap notification of VCS events using the VCS Notifier component
  • Configure SMTP email notification of VCS events using the VCS Notifier component


VCS global clusters:
You require a separate license to configure global clusters.

I/O fencing
/O fencing protects the data on shared disks when nodes in a cluster detect a change in the cluster membership that indicates a split brain condition.

About VCS optional components :

Symantec Product Authentication Service
Veritas Cluster Server Management Console
Cluster Manager (Java console)
Figure 1-4 illustrates a sample VCS deployment with the optional components configured.









About Symantec Product Authentication Service (AT) :

VCS uses Symantec Product Authentication Service (AT) to provide secure communication between cluster nodes and clients. It uses digital certificates for authentication and SSL to encrypt communication over the public network to secure communications.

AT uses the following brokers to establish trust relationship between the cluster components:

Root broker
A root broker serves as the main registration and certification authority; it has a self-signed certificate and can authenticate other brokers.
Authentication brokers
Authentication brokers serve as intermediate registration and certification authorities.

Veritas Cluster Server Management Console :

Veritas Cluster Server Management Console is a high availability management solution that enables monitoring and administering clusters from a single Web console.

Cluster Manager (Java Console) :

Cluster Manager (Java Console) offers complete administration capabilities for your cluster. Use the different views in the Java Console to monitor clusters and VCS objects, including service groups, systems, resources, and resource types.

You can perform many administrative operations using the Java Console. You can also perform these operations using the command line interface or using the Veritas Cluster Server Management Console.