08.06.2015 Views

LifeKeeper™ for Linux - SIOS

LifeKeeper™ for Linux - SIOS

LifeKeeper™ for Linux - SIOS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

LifeKeeper ® <strong>for</strong> <strong>Linux</strong><br />

Module 10: Command Line Interfaces


Overview<br />

This module reviews the following topic:<br />

• LifeKeeper Command Line Utilities<br />

• GUI Property Files<br />

• LifeKeeper Scripts<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 2


LCD Interfaces (LCDI)<br />

The following programs interface with the LCD. These are located<br />

in the $LKROOT/bin (/opt/LifeKeeper/bin) directory.<br />

lcd<br />

lcdremexec<br />

lcdsync<br />

lcdrecover<br />

lcdrcp<br />

lkstart<br />

lkstop<br />

Program<br />

Description<br />

lcd monitoring process<br />

Sends a remote request over the<br />

comm path<br />

Copies or syncs the version of the LCD<br />

in shared memory to disk.<br />

Coordinates the transfer of equivalent<br />

resources during a system failover<br />

Transfers files to another LK system<br />

using LCM<br />

LifeKeeper startup script<br />

LifeKeeper shutdown script<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 3


LCDI Flags<br />

LifeKeeper Flag Management CLI<br />

• Create a flag<br />

flg_create [-d destsys] -f flg<br />

• Remove a flag<br />

flg_remove [-d destsys] -f flg<br />

• Test <strong>for</strong> a flag<br />

flg_test [-d destsys] -f flg<br />

• List flags that have been set<br />

flg_list [-d destsys]<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 4


LCDI Systems<br />

System Management CLI<br />

• Create a system reference<br />

sys_create [-d destsys] -s sys<br />

• Remove a system reference<br />

sys_remove [-d destsys] -s sys<br />

• List known systems<br />

sys_list [-d destsys]<br />

• Get system state<br />

sys_getst [-d destsys] -s sys<br />

• Get description of why system is in the current state<br />

sys_getds [-d destsys] -s sys<br />

Commands that add, delete or change system<br />

references must be run on all cluster members. Run<br />

lcdsync after each command to sync in-memory LCD<br />

with backing store.<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 5


LCDI Networks<br />

Network Management CLI<br />

• Create a communications path<br />

net_create [-d destsys] -s sys -n {TCP|TTY} -D devicepath [-b<br />

baud] [-r remote_IP_address] [-l local_IP_address] [-p<br />

priority]<br />

• Remove a communications path<br />

net_remove [-d destsys] -s sys [-D devicepath] [-r<br />

remote_IP_address] [-l local_IP_address<br />

• List communications paths<br />

net_list [-d destsys] [-fC] [-s sysname]<br />

• Change communications path properties<br />

net_change [-d destsys] -s sys -D {device|address pair} [-N<br />

newsys] [-P newdev] [-n {TCP|TTY}] [-b baud]<br />

Commands that add, delete or change communications<br />

paths must be run on all cluster members. Run lcdsync<br />

after each command to sync in-memory LCD with<br />

backing store.<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 6


LCDI Instances<br />

Resource Instance Management CLI<br />

• Create a resource<br />

ins_create [-d destsys] -a appname -r restyp -t tag -i id [-I<br />

{AUTORES_ISP|INIT_ISP| INIT_OSU}] [-v info] [ -s<br />

AUTOMATIC/INTELLIGENT]<br />

• Remove a resource<br />

ins_remove [-d destsys] [-R roottag] [-a appname] [-r restyp]<br />

[-t tag] [-i id] [-v] [-I] [-N] [-G] [-U]<br />

• List resources<br />

ins_list [-d destsys] [-fC] [-R root] [-a appname] [-r restyp]<br />

[-t tag] [-i id]<br />

“Extending” a resource requires creating a resource<br />

with the same properties on all cluster members. Then,<br />

create a Shared Equivalency between resources on all<br />

cluster members. Remember to run the same<br />

commands on all nodes where the equivalency is to be<br />

defined. Run lcdsync after each command to sync inmemory<br />

LCD with backing store.<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 7


LCDI Instances<br />

Resource Instance Management CLI<br />

• Other functions<br />

ins_gettag [-d destsys] -i id<br />

ins_mark [-d destsys] -t tag -m mark -v {TRUE|FALSE}<br />

Ins_setid [ -d destsys] -t tag -i id<br />

ins_setinfo [-d destsys] -t tag [-v info]<br />

ins_setinit [-d destsys] -t tag -I {AUTORES_ISP | INIT_ISP |<br />

INIT_OSU}<br />

ins_setstate [-d destsys] [-A] -t tag -S {ISP | ISU | OSU} [-R<br />

reason]<br />

ins_setas [-d destsys] -t tag -s {INTELLIGENT | AUTOMATIC}<br />

Commands that add, delete or change resource<br />

attributes must be run on all cluster members. Run<br />

lcdsync after each command to sync in-memory LCD<br />

with backing store.<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 8


LCDI Relationships<br />

Dependency Relationship Management CLI<br />

• Create a dependency relationship between resources<br />

dep_create [-d destsys] -p parent -c child<br />

• Remove a dependency relationship between resources<br />

dep_remove [-d destsys] [-p parent] [-c child]<br />

• Lists the dependency relationship between resources<br />

dep_list [-d destsys] [-fC] [-a app] [-r typ] [-C allchild | -P<br />

allparent | -c ofparenttag | -p ofchildtag]<br />

Must be run on each server where resources have a<br />

shared equivalency. Run lcdsync after each command<br />

to sync in-memory LCD with backing store.<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 9


LCDI Relationships<br />

Shared Equivalency Relationship Management CLI<br />

• Relationship between resources on different systems that represent<br />

the same physical entity. When systems have a shared equivalency<br />

relationship, LifeKeeper ensures that only one system has access to<br />

the resource at a time (ISP status).<br />

• When a resource is extended to another server, a shared equivalency<br />

relationship is created as the last step.<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 10


LCDI Relationships<br />

Shared Equivalency Relationship Management CLI<br />

• Create an equivalency between specified resources<br />

eqv_create [-d destsys] -t tag [-p sysPriority]<br />

-S othersys -o othertag [-r othersysPriority] -e {COMMON |<br />

SHARED | COMPOSITE}<br />

• Remove the specified equivalency<br />

eqv_remove [-d destsys] -t tag -S othersys<br />

[-o othertag] -e {COMMON | SHARED | COMPOSITE}<br />

• List the equivalency relations <strong>for</strong> the specified resource<br />

eqv_list [-d destsys] [-t tag] [e {COMMON | SHARED |<br />

COMPOSITE}] [-fC]<br />

Commands that create or remove an equivalency must be run on<br />

each server involved in the equivalency relationship. Run lcdsync<br />

after each command to sync in-memory LCD with backing store.<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 11


Other LCDI Functions<br />

LCDI Resource Type<br />

• Create a resource type<br />

• Remove a resource type<br />

• List resource types<br />

LCDI Applications<br />

• Create an application<br />

• Remove an application<br />

• List applications<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 12


LifeKeeper Alarm Interface<br />

LifeKeeper Alarm Interface<br />

• Based on the UNIX SVR4 alarming mechanism, sendevent<br />

• LifeKeeper utilizes sendevent when a failure or recovery event has been<br />

detected in the monitored resource.<br />

• sendevent passes all of its options to an event response script defined by the<br />

application<br />

• Alarm classes are under the /opt/LifeKeeper/events directory<br />

• sendevent has the following required options:<br />

-C event class (e.g. LifeKeeper)<br />

-E event type (e.g. lcm_avail)<br />

-m program invoking sendevent<br />

-n resource instance<br />

$LKROOT/bin/sendevent -C class-of-object -E event –m monitor-name –<br />

n name-of-obj-inst [-c class-of-obj] [-i id-of-alarm/event-type] [-<br />

t YYMMDDHHMMSS] [-T timestamp] [–s severity] [-a alarm/event-type]<br />

[-o] [-z] [-w] [-P problem-type] [-p problem-code] [-d problemdata]<br />

[-x problem-text] [-S system-name] [-O outfile-actfiles]<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 13


LifeKeeper Alarm Interface<br />

Example<br />

• The following sendevent command will notify LifeKeeper that the lcm<br />

process is available:<br />

$LKROOT/bin/sendevent -C lifekeeper -E lcm_avail -s1 -<br />

mLK:eventslcm –O $LKROOT/out/LCM -n23365<br />

• Scripts in the following directory would be invoked:<br />

$LKROOT/events/lifekeeper/lcm_avail/lifekeeper<br />

• Based on the in<strong>for</strong>mation to sendevent, the event response script can<br />

be located<br />

$LKROOT/events/lifekeeper// / <br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 14


LRACI<br />

• The LifeKeeper Recovery Action & Control Interface (LRACI)<br />

determines the appropriate action script to run.<br />

• The arguments passed to the LRACI determine which action to<br />

per<strong>for</strong>m.<br />

• The LRACI software can be invoked through a command line<br />

interface.<br />

$LKROOT/bin/per<strong>for</strong>m_action<br />

• The restore and remove actions should only be invoked through the<br />

LRACI and never directly.<br />

• per<strong>for</strong>m_action does the following:<br />

• finds the resource specified by the tag name<br />

• finds the action script specified by the action name<br />

• executes the action script<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 15


LRACI<br />

• per<strong>for</strong>m_action first looks <strong>for</strong> action scripts <strong>for</strong> a particular {application<br />

} / {resource type} pair:<br />

$LKROOT/subsys/{application}\/resources/{resource type }/actions/{action<br />

name}<br />

• The remove script <strong>for</strong> the IP resource is:<br />

$LKROOT/subsys/comm/resources/ip/actions/remove<br />

where:<br />

application = comm<br />

type = ip<br />

action name = remove<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 16


LifeKeeper GUI Architecture<br />

Overview<br />

• The LifeKeeper GUI<br />

• Client / server application developed using Java technology<br />

• Provides a graphical administration interface to LifeKeeper<br />

• LifeKeeper GUI client is implemented as:<br />

– Stand-alone Java application<br />

– Java applet invoked from a web browser<br />

• LifeKeeper GUI server is implemented as a set of JavaBeans and is<br />

mirrored on the client-side by a parallel implementation.<br />

• Network communication between the client/server beans - RMI.<br />

• The LifeKeeper GUI server communicates with the LifeKeeper core<br />

software via the Java Native Interface (JNI).<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 17


GUI Directory Structure<br />

$LKROOT/ (/opt/LifeKeeper/)<br />

htdoc<br />

LifeKeeper.jar<br />

LifeKeeper.html<br />

java.policy<br />

jars help com<br />

Optional<br />

Recovery<br />

Kit Jar files<br />

LifeKeeper<br />

Online Help<br />

Files<br />

steeleye<br />

LifeKeeper<br />

locale<br />

RecoveryKits<br />

Property files <strong>for</strong> Recovery Kits<br />

_.properties<br />

< application >__extend.properties<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 18


GUI Wizard Framework<br />

• GUI administration tasks such as Recovery Kit resource hierarchy<br />

creation and extension are per<strong>for</strong>med via dialog wizards implemented<br />

with Java classes and properties files.<br />

• When a user selects a menu in the GUI corresponding to a Recovery<br />

Kit, the GUI client requests the server to load the properties file<br />

corresponding to that selection. A dialog wizard reads the properties<br />

file. The properties file directs the wizard on its user display and<br />

presents a list of client beans <strong>for</strong> execution.<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 19


GUI Wizard Framework<br />

Recovery Kit Interface:<br />

• The dialog wizard provides a customizable interface <strong>for</strong> Recovery Kit<br />

configuration. By plugging into the wizard framework, the Recovery<br />

Kit developer has access to numerous classes and dialogs already<br />

defined in the GUI.<br />

• To use the framework, Recovery Kit developers provide two or more<br />

Java properties files:<br />

• _.properties<br />

• __extend.properties<br />

• See the Extender <strong>for</strong> more in<strong>for</strong>mation on developing a customized<br />

recovery kit.<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 20


Leveraging Existing Capabilities<br />

• When attempting to do anything that involves LCD configuration, it is<br />

typically easier to leverage GUI property files and the scripts that are<br />

called from them rather than utilize the LCDI command lines directly.<br />

• GUI property files are located under:<br />

$LKROOT/htdoc/com/steeleye/LifeKeeper/locale<br />

• Process:<br />

• Examine property file(s) to determine required arguments and syntax <strong>for</strong><br />

invoking the script that per<strong>for</strong>ms the function.<br />

• Create alternative to GUI <strong>for</strong> gathering appropriate arguments.<br />

• Invoke script with properly <strong>for</strong>med arguments.<br />

Sep-10 Copyright © 2000-2010 by SteelEye Technology, Inc. All Rights Reserved World Wide. 21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!