• VMware

    Learn about VMware virtualization for its products like vsphere, vCenter Server, VMware View, VMware P2V and many more

  • Linux Tutorials

    Step by step configuration tutorials for many of the Linux services like DNS, DHCP, FTP, Samba4 etc including many tips and tricks in Red Hat Linux.

  • Database

    Learn installation and configuration of databases like Oracle, My SQL, Postgresql, etc including many other related tutorials in Linux.

  • Thursday, April 24, 2014

    Overview of services used in Red Hat Cluster

    Below are a list of services used in Red Hat Cluster.

    ccsd


    • This is an abbreviation used for Cluster Configuration System daemon
    • This is responsible for loading /etc/cluster/cluster.conf and managing configuration versions
    • ccsd is provided by the ccsd package in RHEL 4
    • In RHEL 5 and 6 this package is included in cman package


    cman

    • This is an abbreviation used for Cluster Manager. 
    • CMAN is a distributed cluster manager and runs in each cluster node. 
    • It is responsible for monitoring, heartbeat, quorum, voting and communication between cluster nodes.
    • CMAN keeps track of cluster quorum by monitoring the count of cluster nodes.
    • cman package is available in the base channel of RHEL 5 and RHEL 6

    clvmd

    • This is a daemon for CLVM (Clustered Logical Volume Manager)
    • In a shared storage red hat cluster scenario where multiple nodes are writing data concurrently to the same storage there comes a probability of metadata being get overwritten or corrupted. So clvmd service is responsible for managing clustered shared storage to reflect the metadata changes instantly on all the cluster nodes using the same storage which removes the possibility of meta data corruption. With this option same volume group or logical volume can be mounted on multiple nodes of a cluster as long as clvmd service is running and cluster is quorate.
    • The daemon clvmd is provided by the package lvm2-cluster in RHEL 5, and RHEL 6

    fenced

    • This is a fencing daemon
    • It is responsible for disconnecting a node from the cluster. 
    • When any of the node stops communicating with other nodes(verified using qdisk and cman heartbeat mechanism) of the cluster in that case the inactive node is fenced to avoid corruption of data
    • This is very improtant in a cluster environment to protect the data integrity.
    • In RHEL 5 and RHEL 6 fenced service is started/stopped by cman service
    • It doesnot needs to be downloaded manually unlike RHEL 4, this package is automatically downloaded along with cman package in RHEL 5 and RHEL 6.

    qdiskd

    • This daemon is responsible for managing a quorum disk(qdisk).
    • It includes the concept of qdisk i.e. quorum disk. A Red Hat Cluster runs only if Quorate state is achieved which is determined by the no. of active votes representing the cluster. Each node by default counts as one vote. Now in extreme condition when you want your cluster to be running with minimum no. of nodes in those case we use quorum disk having predefined vote count. Now this may sound confusing so let me explain with an example:
    For a 3 node cluster a quorum state is present untill 2 of the 3 nodes are active i.e. more than half. But what if due to some reasons the 2nd node also stops communicating with the the 3rd node? In that case under a normal architecture the cluster would dissolve and stop working. But for mission critical environments and such scenarios we use quorum disk in which an additional disk is configured which is mounted on all the nodes with qdiskd service running and a vote value is assigned to it.

    So suppose in above case I have assigned 1 vote to qdisk so even after 2 nodes stops communicating with 3rd node, the cluster would have 2 votes (1 qdisk + 1 from 3rd node) which is still more than half of vote count for a 3 node cluster. Now both the inactive nodes would be fenced and your 3rd node would be still up and running being a part of the cluster.

    • The qdiskd daemon is provided by the cman package on RHEL 4, RHEL 5. On RHEL 6 
    • In RHEL 5 and RHEL 6 qdiskd service is started/stopped by cman service

    gfs and gfs2

    • This is an abbreviation used for Global File System ( In RHEL 4 and 5 it is gfs and RHEL 6 it is gfs2)
    • These are the services responsible for mounting/unmounting GFS and GFS2 filesystems from /etc/fstab respectively.
    • GFS is a cluster file system that allows a cluster of nodes to simultaneously access ablock device that is shared among the nodes.
    • To maintain file system integrity, GFS uses a lock manager to coordinate I/O. When one node changes data on a GFS file system, that change is immediately visible to the other cluster nodes using that file system
    • The daemon gfs is provided  by the package gfs-utils on RHEL 4 and RHEL 5.
    • The daemon gfs2 is provided  by the package gfs2-utils on RHEL 5 and RHEL 6.

    rgmanager

    • This is a service termed as Resource Group Manager
    • RGManager manages and provides failover capabilities for collections of cluster resources called services, resource groups, or resource trees
    • it allows administrators to define, configure, and monitor cluster services. In the event of a node failure, rgmanager will relocate the clustered service to another node with minimal service disruption
    • Commands used under rgmanager are clusvcadm, clustat, clurgmgrd (Daemon used to handle user service), clurmtabd (Daemon used to handle Clustered NFS mount tables).
    • This service is provided by the rgmanager package on RHEL4, RHEL5, and RHEL6

    luci

    • It is the server component of the Conga administration utility
    • Conga is an integrated set of software components that provides centralized configuration and management of Red Hat clusters and storage
    • luci is a server that runs on one computer and communicates with multiple clusters and computers via ricci
    • This service needs to be running only on the system having Conga installed.
    • It is provided by the luci package on RHEL 5 and RHEL 6

    ricci

    • It is the client component of the Conga administration utility
    • ricci is an agent that runs on each computer (either a cluster member or a standalone computer) managed by Conga
    • This service needs to be running on all the client nodes of the cluster.
    • Conga web utility connects to all the nodes using the ricci dameon.

    dlm_controld

    • Daemon responsible for Lock management
    • DLM is a short abbreviation for Distributed Lock Manager.
    • GFS and CLVM use locks from the lock manager to simultanously synchronize the metadata on the shared storage (LVM/Volume Groups).
    • without a lock manager, there would be no control over access to your shared storage, and the nodes in the cluster would corrupt each other's data.
    • In addition, rgmanager uses DLM to synchronize service states.
    • In RHEL 5 and RHEL 6 dlm_controld service is started/stopped by cman service
    Related Articles:

    Follow the below links for more tutorials

    Monday, April 14, 2014

    How to find/view all the members of a group in Linux

    Now in Linux we have two types of groups
    • Primary Group
    • Secondary Group

    View all the members of the primary group

    First you need to know the GID of the group of whoose members you want to query for

    Syntax:
    # grep "group_name" /etc/group
    # grep dba /etc/group
    dba:x:503:

    Now grep that GID to get list of users under dba group
    # grep 503 /etc/passwd
    deepak:x:501:
    503::/home/deepak:/bin/bash
    user:x:502:503::/home/user:/bin/bash
    deep:x:503:503::/home/deep:/bin/bash

    View all the members of the secondary group

    To do this we have a no. of methods

    Method 1
    # getent group dba
    dba:x:503:deepak,deep,user,user1

    Method 2
    # grep dba /etc/group
    dba:x:503:deepak,deep,user,user1

    Method 3
    Syntax
    # groupmems -g "group_name" -l
    # groupmems -g dba -l
    deepak  deep  user  user1


    Related Articles
    How to create password less ssh connection for multiple non-root users
    How to create user without useradd command in Linux
    How to give normal user root privileges using sudo in Linux/Unix
    How to give permission to user to run some commands in Linux


    Follow the below links for more tutorials

    What is the difference/comparison between Unix and Linux ?
    What are the maximum and minimum limits for RHEL 4 vs 5 vs 6 ?
    RAID levels 0, 1, 2, 3, 4, 5, 6, 0+1, 1+0 features explained in detail

    Sunday, April 13, 2014

    10 practical examples to use USERADD command in linux

    Q: How do you know what default values would be assigned to a user when created using useradd command?

    A: These are the two files which contain the default values to be assigned to a user when created using useradd
    # less /etc/default/useradd
    GROUP=100
    HOME=/home
    INACTIVE=-1
    EXPIRE=
    SHELL=/bin/bash
    SKEL=/etc/skel
    CREATE_MAIL_SPOOL=yes

    You can also view the default parameters set for new user to be created using
    # useradd -D
    GROUP=100
    HOME=/home
    INACTIVE=-1
    EXPIRE=
    SHELL=/bin/bash
    SKEL=/etc/skel
    CREATE_MAIL_SPOOL=yes

    The second file containing values used by useradd command for UID, GID, password encryption method and expiry related information
    # less /etc/login.defs
    MAIL_DIR        /var/spool/mail

    PASS_MAX_DAYS   99999
    PASS_MIN_DAYS   0
    PASS_MIN_LEN    5
    PASS_WARN_AGE   7

    UID_MIN                   500
    UID_MAX                 60000

    GID_MIN                   500
    GID_MAX                 60000

    CREATE_HOME     yes
    UMASK           077

    USERGROUPS_ENAB yes
    ENCRYPT_METHOD SHA512

    Friday, April 11, 2014

    What is the difference/comparison between Unix and Linux ?

    There are not much differences between Linux and UNIX in terms of most of the commands and working if looking from an end-user perspective. But internally in the sense of hardware, kernel, patches etc there are numorous differences. 

    Well to be specific Linux is considered as Unix-Like Operating system coming under the category of UNIX clones. A clone is a program (i.e., an operating system or an application program) that has functions and behavior similar to another program but which does not contain source code from that program.

    License

    (History)
    UNIX was developed and evolved more as a licensed version or proprietary software.It was used more for commercial purpose. This was one of the reason for Linux to be developed as a free operating system by Linus Torvalds. Once the Linux kernel was developed later it was released under GPL (GNU General Public License) integrated with libraries, compilers, text editors transforming it into an operating system and releasing worldwide as opensource.

    (Present)
    Even now most UNIX operating system are proprietary as they are mostly commercially used like Oracle's Solaris, Hewlett-Packard's HP-UX, and IBM's AIX. Well there are also some open source OS for UNIX like Open Solaris, OpenBSD.

    Coming to Linux kernel you can find a long list of free and opensource operating system like CentOS, Scientific Linux, Fedora, OpenSUSE, Ubuntu etc. For commercial version there is Red hat Linux, SUSE etc.

    Hardware Architectures

    Linux can be much more flexible as compared to Unix as they can be installed on almost any hardware(NOT ALL). But Unix OS are very restricted when it comes for the supported hardware for example HP-UX is available on PA-RISC and Itanium machines. Solaris is available on SPARC and x86. AIX is only for power processors etc.

    Kernel

    Kernel can be considered the HEART of any operating system. Now as explained in the history part Linux is just an kernel and integrating it with other features like libraries, editors, compilers makes it an Operating System. 

    The source code for most UNIX kernel specially commercial versions are not available freely. On the other hand most Linux OS source code are free available under the GPL and can be read, modified and used by any and everyone.

    Patches and updates

    Linux being open source their patches are released in the form of source code which can be manually and updated. Now one negative point on this one can be that these patches are not much tested for bug as compared to commercial version of UNIX. In case of Linux based on the feedback of users and developers the bugs are fixed and patches are released. But in case of UNIX developers test the patch multiple times before releasing it to the update server of their OS.

    NOTE: In case of commercial version of Linux the patches are checked and verifed prior releasing it to their relative OS. Re-revised version of OS are released at regular intervals with all the bug fixes as developed.

    UNIX OS seems to be more stable in terms of releasing patches or upgrades and the code works for longer time for the same driver as compared to Linux.

    Filesystem support

    Linux has very high scalibility be it in terms of hardware architectures or filesystem as it suports many of them unlike UNIX OS which supports very few type of filesystem.

    Filesystem supported under Linux
    adfs, affs, autofs,  cifs,  coda, coherent,  cramfs,  debugfs,  devpts,  efs, ext, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, msdos, ncpfs, nfs, nfs4, ntfs, proc,  qnx4,  ramfs,  reiserfs,  romfs,  smbfs, sysv,  tmpfs,  udf, ufs, umsdos, usbfs, vfat, xenix, xfs, xiafs

    Filesystem supported under UNIX
    OS
    File system
    AIX
    jfs, gpfs
    HP-UX
    hfs, vxfs
    Solaris
    ufs, zfs
    Irix
    xfs

    System Administration Tools

    Well mostly Linux/Unix are preferred to be used on CLI rather than GUI in corporate world. But still to make things easier both the OS offer different type of GUI tools for administrators.

    In Red Hat - system-config-*
    In HP-UX - SAM (System Administration Manager)
    In SUSE - YaST

    As per the command perspective, there can be seen many differences 

    For example to install a package
    In Red Hat - rpm -i file
    In Solaris - pkgadd -d pkgfile
    IN HP-UX - swinstall -s depot software
    IN AIX- installp - [-c] FileSet

    System Initialization scripts

    Location of the system init scripts is different on both the types of OS
    System
    Location
    HP-UX
    /sbin/init.d
    AIX
    /etc/rc.d/init.d
    Irix
    /etc/init.d
    Solaris
    /etc/init.d
    Red Hat
    /etc/rc.d/init.d
    SUSE
    /etc/rc.d/init.d
    Debian
    /etc/init.d
    Slackware
    /etc/rc.d

    Cost

    As discussed in earlier part of this article most UNIX use their own hardware for their OS their cost price rises accordingly where on the opposite side getting a commercial version of Linux OS is very much cheaper.

    Examples for Linux and UNIX

    UNIX
    Linux
    HP-UX
    Red Hat
    AIX
    Debian
    Irix
    Ubuntu
    Solaris
    SUSE
    BSD
    CentOS

    Fedora

    Scientific Linux

    Slackware

    Reference:
    Differentiate Unix and Linux

    Related Articles:


    Follow the below links for more tutorials

    Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
    How to secure Apache web server in Linux using password (.htaccess)
    Red hat Enterprise Linux 5.5 Installation Guide (Screenshots)
    15 tips to enhance security of your Linux machine
    Why is Linux more secure than windows and any other OS
    How to log iptables messages in different log file

    How to fix "E575: viminfo: Illegal starting char in line"

    The other day I was trying to open a text file to work on it but surprisingly on my every attempt to open the file, the below error was coming up and not allowing me to edit or save the file.

    Error:

    $ vi IIG.TEST.2014-04-02.2014-04-07-00.26.30.000000.out
    E575: viminfo: Illegal starting char in line: ^I+^I3^I18
    E575: viminfo: Illegal starting char in line: ^I+^I3^I0
    E575: viminfo: Illegal starting char in line: ^I+^I3^I0
    E575: viminfo: Illegal starting char in line: ^I+^I3^I0
    E575: viminfo: Illegal starting char in line: ^I+^I3^I0
    E575: viminfo: Illegal starting char in line: ^I+^I3^I4
    E575: viminfo: Illegal starting char in line: ^I+^I3^I28
    E575: viminfo: Illegal starting char in line: ^I+^I3^I65
    E575: viminfo: Illegal starting char in line: ^I+^I6^I0
    E575: viminfo: Illegal starting char in line: ^I+^I3^I47
    E136: viminfo: Too many errors, skipping rest of file

    Reason:

    This happens because the user's viminfo file gets corrupted somehow and certain characters are not interpretted so everytime you try to open the original file, it throws out "Illegal starting char in line"

    Solution:

    You can delete the user's viminfo file from the user's home directory using which you were getting the error. 

    NOTE: You can find .viminfo inside every user's home directory starting with a dot (.) as it is a hidden file.

    What is .viminfo file? 
    This file contains the history of all the vim editor records i.e the files edited and the arguments you used inside the editor etc. 

    Will it affect my current saved work?
    No deleting .viminfo file is not going to affect any of your existing work, It is the same way you erase your cache history but it does not affects any of your work done.

    Do I need to recreate a new .viminfo file?
    No, this file gets automatically created inside user's home directory as soon you start working on any text file using vi editor.


    Follow the below links for more tutorials

    Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
    How to secure Apache web server in Linux using password (.htaccess)
    Red hat Enterprise Linux 5.5 Installation Guide (Screenshots)
    15 tips to enhance security of your Linux machine
    Why is Linux more secure than windows and any other OS
    How to log iptables messages in different log file