You are here: User Guide > Using LifeKeeper Linux > Advanced Tasks > LCDI Commands

LCDI Commands

LifeKeeper provides two mechanisms for defining an application resource hierarchy:

The LCDI is a set of interface commands provided by LifeKeeper that you can use to create and customize resource hierarchy configurations to meet your application needs. You use the command interface when an application depends upon multiple resources (such as two or more file systems).

For a description of the commands, see the LCDI manual pages. This topic provides a development scenario that demonstrates the way you can use both the GUI and command functions to create a resource hierarchy.

Scenario Situation

The example application, ProjectPlan, has data stored in SCSI file systems shared by Servers 1 and 2. Server 1 will be the primary hierarchy for the application. The application has two file systems: /project-data and /schedule. The first step in the hierarchy definition is to determine the dependencies.

The example application has these dependencies:

As a result, the task is to create a hierarchy that looks like the following diagram.

     

shrdequiv.gif     

Hierarchy Definition

These are the tasks required to construct the example application hierarchy:

  1. Create file system resources. The LifeKeeper GUI provides menus to create file system resources. See Creating File System Resource Hierarchies

At the end of this definition task, the LCD has two filesys resources defined as follows:

ID

Tag

Server

/project-data
/project-data

project-data-on-Server1
project-data-from-Server1

Server1
Server2

/schedule
/schedule

schedule-on-Server1
schedule-from-Server1

Server1
Server2

Note: LifeKeeper does not place any significance on the tag names used; they are simply labels. The tag names shown are the LifeKeeper defaults.

  1. Define resources. The example requires the following definitions:

Application:

projectapp

Resource Type:

plan

Instance ID:

1yrplan

Tag:

the-project-plan

Note: Although you can create much of the definition using the LifeKeeper GUI, the rest of this example demonstrates the command interface.

  1. Create directories. On each system, you create the necessary application recovery directories under the directory /opt/LifeKeeper/subsys with the command:

mkdir -p /opt/LifeKeeper/subsys/projectapp/Resources/plan/actions 

  1. Define application. The following commands create the application named projectapp:

app_create -d Server1 -a projectapp

app_create -d Server2 -a projectapp 

  1. Define the resource type. The following commands create the resource type named plan:

typ_create -d Server1 -a projectapp -r plan

typ_create -d Server2 -a projectapp -r plan 

  1. Install recovery scripts. Copy your restore and remove scripts to the following directory on each server:

/opt/LifeKeeper/subsys/projectapp/Resources/plan/actions

  1. Define instance. The following commands define an instance of resource type plan with the id 1yrplan:

ins_create -d Server1 -a projectapp -r plan -I\

AUTORES_ISP -t the-project-plan -i 1yrplan 

ins_create -d Server2 -a projectapp -r plan -I\

SEC_ISP -t the-project-plan -i 1yrplan  

The -I AUTORES_ISP instruction for the instance created on Server1 tells LifeKeeper to automatically bring the resource in service when LifeKeeper is restarted. In this case, the resource’s restore script is run and, if successful, the resource is placed in the ISP state. This operation is not performed if the paired resource is already in service.

The -I SEC_ISP instruction for the instance created on Server2 tells LifeKeeper that this resource instance should not be brought into service when LifeKeeper is restarted. Instead, Server2 will serve as the backup for the resource on Server1, and the local resource will be brought in service upon failure of the primary resource or server.

  1. Define dependencies. The following commands define the dependencies between the application and the file systems:

dep_create -d Server1 -p the-project-plan -c project-data-on-System1

dep_create -d Server2 -p the-project-plan -c project-data-from-Server1

dep_create -d Server1 -p the-project-plan -c schedule-on-Server1

dep_create -d Server2 -p the-project-plan -cschedule-from-Server1 

  1. Execute lcdsync. Execute the following lcdsync commands to inform LifeKeeper to update its copy of the configuration:

lcdsync -d Server1

lcdsync -d Server2 

  1. Bring resources into service. Access the LifeKeeper GUI on the primary server and on the Edit menu, select Resource, then In-Service to bring the resources into service.

© 2012 SIOS Technology Corp., the industry's leading provider of business continuity solutions, data replication for continuous data protection.