# Veritas Cluster Installation and Management

This chapter describes Veritas Cluster Installation and Management.

Veritas Cluster enables one system to failover to the other system. All related software processes are simply moved from one system to the other system with minimal downtime.

The cluster mode functionality enables PPT to provide high availability and critical redundancy support to retrieve data in failure of any one of the systems. Highly available clusters provide nearly continuous access to data and applications by keeping the cluster running through failures that would normally bring down a single server system.
The cluster setup offers several advantages over traditional single-server systems. These advantages include:

- Low entry price compared to traditional hardware fault-tolerant systems.
- Reduce or eliminate system downtime because of software or hardware failure.
- Provide enhanced availability of the system by enabling you to perform maintenance without shutting down the entire cluster.

This chapter contains following sections:

- Configuring Veritas Volume Manager and Veritas Cluster
- Verifying the Cluster Setup
- Veritas Cluster Files

## Configuring Veritas Volume Manager and Veritas Cluster

In veritas volume manager, external disks need to be configured and in veritas cluster PPT resources need to be configured.

### Veritas Volume Manager

The number of disks in each group depends upon the size of disks in the external storage.

Please contact your system administrator for setting up the external storage to make the required number of disks (luns) accessible from both the cluster nodes. When the external storage disks are made accessible, you can see them connected using multipath command:

    $ multipath
    -1

    mpath6 (36006016069902d008892bc0dec14e111)
    dm-7 DGC,RAID 5

    [size=300G][features=1
    queue_if_no_path][hwhandler=1 emc][rw]

    \_ round-robin
    0 [prio=0][active]

    \_ 8:0:0:1
    sdi 8:128 [active][undef]

    \_ 8:0:1:1
    sdk 8:160 [active][undef]

Use the following steps for setting up the external storage disks into separate disk groups:

1. Execute VxVM command to rebuild the disk lists with the new disks detected by the kernel.

       $ vxdctl initdmp

       $ vxdctl enable

2. Execute VERITAS vxdisk command to see the new disk.

       $ vxdisk -o
       alldgs list

       DEVICE        TYPE
                      DISK               GROUP             STATUS

       disk_0
          auto:none       -            -            online invalid

       disk_1
          auto:none       -            -            online invalid

       disk_2
          auto:none       -            -            online invalid

       disk_3
          auto:none       -            -            online invalid

       emc_clariion0_30
       auto            -            -            error

3. Execute the following command to setup the disk:

       $ /etc/vx/bin/vxdisksetup
       -i emc_clariion0_30

       [root@pnextappsucs460-1
       ~] # vxdisk -o alldgs list

4. With the newly initialized disks, create disk group for PPT.

       $ vxdg init
       ppt_dg ppt_dg01=emc_clariion0_30

   Note:

   In the above example, we have only one disk in each group. You can specify more disks in the above command.
5. After adding the disk into respective disk groups, you can verify them by executing vxdisk command.

       $ vxdisk -o
       alldgs list

       DEVICE
        TYPE                   DISK                   GROUP
         STATUS

       disk_0
          auto:none         -              -            online invalid

       disk_1
          auto:none         -             -            online invalid

       disk_2
          auto:none         -             -            online invalid

       disk_3
          auto:none         -             -            online invalid

       emc_clariion0_30
       auto:cdsdisk     ppt_dg01     ppt_dg       online

   VxVM ensures that the newly created disk groups are visible from both the cluster nodes. These disk groups can be used only from one node at a time. You have to import/deport a disk group from either node to use the disk groups and their volumes.
6. Next step is to create volumes in the disk groups. Execute the following command to create one volume in each disk group.

       $ vxassist
       -g ppt_dg make ppt_vol
       299g

7. Execute the following command to initialize the volumes with the vxfs file system. For better performance, use 4Kb block size and also enable the support for large files (more than 1 TB).

       $ mkfs -t
       vxfs -o bsize=4096,largefiles /dev/vx/rdsk/ppt_dg/ppt_vol

8. Create the mount point and execute the following command to mount the volumes.

       $ mount -t
       vxfs -o largefiles /dev/vx/dsk/ppt_dg/ppt_vol /shared_ppt

   IMPORTANT:

   The /shared_ppt should be entered for Shared Disk Path in Install Mode Configuration screen during installation.

### Veritas Cluster

This section describes PPT resource configuration in Veritas Cluster.
To explain how to configure PPT resources in Veritas Cluster, consider the following example:

- Shared disk path:`/shared_ppt`
- Shared IP: 10.4.83.151
- PPT shared directory: `/shared_ppt`
- PPT installation directory: `/users/ppt`
- PPT PostgreSQL data directory: `/shared_ppt/3rdparty/postgres/data`
- Shared IP address: 10.4.83.151 (could be on NIC eth0)
- Cluster nodes are: pnstextappsucs1 and pnstextappsucs3

1. Execute the following commands to create Resource Group (named ha) for PPT and add nodes to it.

       hagrp -add ppt-ha

       hagrp -modify ppt-ha SystemList -add  pnstextappsucs1
       1 pnstextappsucs3 2

2. Execute the following commands to create Disk Group resource for PPT partition.

       $ hares -add
       ppt-apps-dg DiskGroup ppt-ha

       $ hares -modify
       ppt-apps-dg DiskGroup ppt_dg

       $ hares -modify
       ppt-apps-dg Enabled 1

3. Execute the following commands to create volume resource for PPT partition.

       $ hares -add
       ppt-apps-vol Volume ppt-ha

       $ hares -modify
       ppt-apps-vol DiskGroup ppt_dg

       $ hares -modify
       ppt-apps-vol Volume ppt_vol

       $ hares -modify
       ppt-apps-vol Enabled 1

4. Execute the following commands to create mount resource for PPT partition.

       $ hares -add
       ppt-apps-mnt Mount ppt-ha

       $ hares -modify
       ppt-apps-mnt MountPoint /shared_ppt

       $ hares -modify
       ppt-apps-mnt BlockDevice /dev/vx/dsk/ppt_dg/ppt_vol

       $ hares -modify
       ppt-apps-mnt FSType vxfs

       $ hares -modify
       ppt-apps-mnt FsckOpt %-y

       $ hares -modify
       ppt-apps-mnt MountOpt largefiles

       $ hares -modify
       ppt-apps-mnt Enabled 1

5. Execute the following commands to create application resource for PPT processes.

       $ hares -add
       ppt-app Application ppt-ha

       $ hares -modify
       ppt-app User pptadmin

       $ hares -modify
       ppt-app StartProgram "<ppt-install-dir>/pptctl
       start"

       $ hares -modify
       ppt-app StopProgram "<ppt-install-dir>/pptctl
       forcestop"

       $ hares -modify
       ppt-app PidFiles "<ppt-install-dir>/3rdparty/psmon/psmon.pid"

       $ hares -modify
       ppt-app  Enabled 1

6. Execute the following command to set the Critical attribute of the above created application resource to 0.

       $ hares -modify ppt-app Critical 0

7. Execute the following commands to create the NIC resource.

       $ hares -add
       ppt-nic NIC ppt-ha

       $ hares -modify
       ppt-nic Device eth0

       $ hares -modify
       ppt-nic Enabled 1

8. Execute the following commands to create the IP resource.

       $ hares -add
       ppt-ip IP ppt-ha

       $ hares -modify
       ppt-ip Device eth0

       $ hares -modify
       ppt-ip Address 10.4.83.151

       $ hares -modify
       ppt-ip NetMask 255.255.255.0

       $ hares -modify
       ppt-ip Enabled 1

9. Execute the following commands to set the resource dependencies.

       $ hares -link
       ppt-app ppt-apps-mnt

       $ hares -link
       ppt-apps-mnt ppt-apps-vol

       $ hares -link
       ppt-apps-vol ppt-apps-dg

       $ hares -link
       ppt-app ppt-ip

       $ hares -link
       ppt-ip ppt-nic

10. Execute the following command to create AutoStartList and add the node in the list. $ haconf -makerw $ hagrp -modify ppt-ha AutoStartList pnstextappsucs1 $ haconf -dump

## Verifying the Cluster Setup

Once VCS is installed and PPT resources are configured in VCS setup, cluster setup needs to be verified.

1. The following command can be used to verify that the configuration.

       hastatus -sum

   This command will provide the summary of HA resources. Output would be similar to the one shown below:

       [root@pnqaems-ucs1
       ~]# hastatus -sum

       -- SYSTEM STATE

       -- System
            State                Frozen

       A  pnqaems-ucs1
            RUNNING              0

       A  pnqaems-ucs2
            RUNNING              0

       -- GROUP STATE

       -- Group
       System                Probed       AutoDisabled      State

       B  ems-rg
       pnqaems-ucs1         Y            N               OFFLINE

       B  ems-rg
       pnqaems-ucs2         Y            N               OFFLINE

       B  mur-rg
       pnqaems-ucs1         Y            N               OFFLINE

       B  mur-rg
       pnqaems-ucs2         Y            N               PARTIAL

       B  ppt-rg
       pnqaems-ucs1         Y            N               ONLINE

       B  ppt-rg
       pnqaems-ucs2         Y            N               OFFLINE

Veritas Cluster Files

Veritas Cluster log and config files can be used for troubleshooting and monitoring the VCS.
The below mentioned log and config files are useful:

- Log File: The log file contains the veritas logs like some resource has stopped on one node and some resources have started on other node. Log file name is appended by letters. Letter A indicates the first log file, B the second, C the third, and so on. The engine log is located at `/var/VRTSvcs/log/engine_A.log`.
- Config File: The cluster configuration information is stored in this file. This file also includes service group and resource dependency clauses. The config file is located at `/etc/VRTSvcs/conf/config/main.cf`.