LKCLI provides functions that can be performed with the LifeKeeper GUI through the command line interface. LifeKeeper provides export/import of communication paths and resource information which the GUI does not provide. Export/import functionality enables duplicating a created system and easy deployment from a testing environment to a production environment.

Supported Environments

LKCLI is supported in the following environments:

  • Number of nodes – Only a two-node cluster environment is supported.
  • OS – All operating systems supported by LifeKeeper are supported.
  • Communication path – Supported only in environments where nodes are connected via TCP/IP.
  • Application Recovery Kits – Only environments configured with the Application Recovery Kits in the “Supported ARK List” are supported. If unsupported ARK resources have been created on a node, the environment is not supported. If you want to perform command line operations in an unsupported environment, please consider using the Command Line Interface.

Restrictions

LKCLI can be executed only with root privileges (lkadmin group privileges).

Commands

lkcli license Install a license key
lkcli start Starts LifeKeeper
lkcli stop Stops LifeKeeper
lkcli import Creates communication paths, resources
lkcli export Exports communication paths, resources information
lkcli clean Deletes communication paths, resources
lkcli commpath Operates on communication paths
lkcli dependency Operates on dependencies
lkcli resource Operates resources
lkcli status Lists resource status
lkcli log Displays a LifeKeeper log
lkcli server Configures/operates servers
lkcli mirror Operates DataKeeper mirroring

Common Options Available for All Commands

Option Default Description
[--remote <str>] Hostname of the machine where you want to run a command.
If the option is not specified, the command is executed on the local machine.
Before you can execute commands remotely, the machine on which you want to execute the command and the communication path must be bidirectionally connected.
Note: The start,stop, commpath and clean commands are not supported with this option.

lkcli license

Registers your LifeKeeper license.

Option Default Description
--file <str> A path to the license file

lkcli start

Starts LifeKeeper

lkcli stop

Stops LifeKeeper

Option Default Description
[-f] Stops only the LifeKeeper daemon and does not stop protected services.
[-r] Stops LifeKeeper without changing the settings for automatic startup of the LifeKeeper daemon.
[-n] Performs failover when LifeKeeper stops.This option cannot be used with -f or -r.

lkcli import

Reads the LifeKeeper settings from a file and creates communication paths and resources.

lkcli import commpath

Reads LifeKeeper settings from a file and creates communication paths. In order to connect a communication path bidirectionally, execute this command on both the local machine and the remote machine.

Option Default Description
--file <str> A LifeKeeper configuration file path.
Create a communication path from a file (YAML format) where the output was saved with lkcli export.
The communication path protocol that can be created is TCP/IP (socket).

lkcli import resource

Reads LifeKeeper settings from a file and creates resources.

Option Default Description
--file <str> A LifeKeeper configuration file path.
Create a communication path from a file (YAML format) where the output was saved with lkcli export.
Refer to the ARKs list for files that can be created.

Notes:

  • This command fails if the environment including the hostname, IP address or application is not prepared.
  • Rollback is not performed even if it fails. Only some resources may be created.
  • Execution of the command where resources already exist is not supported.

lkcli export

Exports LifeKeeper settings.
The current LifeKeeper settings are exported. The node where the command is executed and all nodes to which the communication path is connected are targeted.

Save the output in a file in YAML format.

# lkcli export > lk_export.yml

Notes:

  • The communication path protocol that can be export is TCP/IP (socket).
  • Refer to the ARKs list for resources that can be exported.
  • The resource status (In Service, Out of Service, etc.) is not exported.
  • The server property value is not exported.
  • Only the configured values on LifeKeeper are exported. The settings of the protected applications are not exported.
  • For the exported configuration file, edit only the hostname and IP address manually. Manual changes to other items are not supported.

lkcli clean

Deletes LifeKeeper settings.
Delete the communication path and resource settings of the node where the command was executed. If you want to delete LifeKeeper configurations on all nodes, execute this command on all nodes. Please note that if the communication path is deleted at this time, commands cannot be executed remotely.

Option Default Description
--mode <str> Specify “all” or “resource”.
  • all – Delete all communication paths and all resources.
  • resource – Delete all resources.

lkcli commpath

Operates communication paths.

lkcli commpath create

Creates a communication path for the node where the command is executed. The created communication path is the path from the local machine to the remote machine. Execute this command on both the local machine and the remote machine to connect a communication path in both directions. The communication path protocol that can be created is TCP/IP (socket).

Option Default Description
--laddr <str> IP address on the local machine to be set for the communication path.
--raddr <str> IP address on the remote machine to be set for the communication path.
--dest <str> Hostname of the remote machine to be set for the communication path.
[--priority <str>] Maximum value of existing paths +1 Priority of the communication path.

Note: Specify the same value on both the local machine and the remote machine.

lkcli commpath delete

Deletes the communication path of the node where the command was executed.
The communication path to be deleted is the path from the local machine to the remote machine. Execute this command on both the local machine and the remote machine to delete communication paths in both directions,

Option Default Description
--laddr <str> IP address on the local machine to be set for the communication path.
--raddr <str> IP address on the remote machine to be set for the communication path.
--dest <str> Hostname of the remote machine to be set for the communication path.

lkcli dependency

Creates/deletes dependencies for LifeKeeper resources.

lkcli dependency create

Creates a new dependency between two resources.

Option Default Description
--parent <str> The tag name of the parent resource.
--child <str> The tag name of the child resource.

lkcli dependency delete

Deletes the dependency between the two resources.

Option Default Description
--parent <str> The tag name of the resource that is a parent of the dependency you want to delete.
--child <str> The tag name of the resource that is a child of the dependency you want to delete.

lkcli resource

Operates on the LifeKeeper resources.

lkcli resource create

Creates resources.

Option Default Description
--tag <str> Tag name of the resource to create.
Existing tag names cannot be created. See Resource Tag Name Restrictions for more details.
[--switchback <str>] INTELLIGENT Switchback settings for the resource.
Specify “INTELLIGENT” or “AUTOMATIC”.
OPTIONS FOR EACH ARK Options vary by ARK.
See Subcommands for Each ARK for options for each ARK.

lkcli resource extend

Extends resources.

Option Default Description
--tag <str> Tag name of the resource to extend.
Tag names that exist on the extension target cannot be extended. See Resource Tag Name Restrictions for more details.
--dest <str> The hostname of the target server where the resource hierarchy is extended.
[--switchback <str>] INTELLIGENT Switchback settings for the resource.
Specify “INTELLIGENT” or “AUTOMATIC”.
[--template_priority <num> 1 The priority of the resource hierarchy from which to extend.
For the priority, unused values from 1 to 999 are valid, with lower numbers having higher priority.
[--target_priority <num> 10 The priority of the extension target resource hierarchy.
For the priority, unused values from 1 to 999 are valid, with lower numbers having higher priority.
OPTIONS FOR EACH ARK Options vary by ARK
See Subcommands for Each ARK for options for each ARK.

lkcli resource config

Changes resource settings.

Option Default Description
--tag <str> The tag name of the resource to change.
OPTIONS FOR EACH ARK Options vary by ARK
See Subcommands for Each ARK for options for each ARK.

lkcli resource unextend

Unextends the resource.

Option Default Description
--tag <str> Tag name of the resource to unextend.
--dest <str> The hostname of the target server where you want to unextend the resource hierarchy.

lkcli resource delete

Deletes a resource.

Option Default Description
--tag <str> Tag name of the resource to delete.

lkcli resource restore

Brings the resource hierarchy on the active node in service.

Option Default Description
--tag <str> The tag name of the resource to bring in service.

lkcli resource remove

Takes the resource hierarchy on the active node out of service.

Option Default Description
--tag <str> The tag name of the resource to take out of service.

lkcli resource info

Outputs the resource property information. The output differs for each ARK.

Option Default Description
--tag <str> Tag name of the resource for which the property information is output.

lkcli resource eqv

Outputs the equivalency information of the resource.

Option Default Description
--tag <str> Tag name of the resource that for which the equivalency information is output.

lkcli resource reorder-priority

Changes the priority of a resource on an active node.

Option Default Description
--tag <str> The tag name of the resource where the priority is to be changed.
--priority <num> Priority after the change.
For the priority, unused values from 1 to 999 are valid, with lower numbers having higher priority.

lkcli resource switchback

Change the switchback settings of the resource on the active node.

Option Default Description
--tag <str> The tag name of the resource to change.
--switchback <str> INTELLIGENT Switchback settings for the resource.
Specify “INTELLIGENT” or “AUTOMATIC”.

lkcli status

Displays LifeKeeper status.
See Detailed Status Display for the output status information.

Option Default Description
[-q] Outputs the information of each resource in the local system in a short report.
[-e] Outputs the information of each resource in the local system in a short report and lists the backup system (with the next highest priority).
[-u] Suppresses duplicate resource entries in the output of the command with -q or -e options.
[-r <str>] Specifies the resource root tag.
Restrict the report to specific resource root tags.

lkcli log

Displays LifeKeeper logs.

Option Default Description
--lines <num> 10 Number of log lines to display.

lkcli server

Performs operations related to the LIfeKeeper server.

lkcli server info

Checks the server shutdown method and failover functionality.

lkcli server shutdown-strategy

Configures the server shutdown method.

Option Default Description
--mode <str> The value of switchover or do_not_switchover.
  • switchover – LifeKeeper starts the backup server resources with a graceful shutdown.
  • do_not_switchover – LifeKeeper does not start backup server resources upon a graceful shutdown.

lkcli server confirmso

Configures whether to confirm the user for switching to the backup node when a failover occurs due to a node failure on the LifeKeeper cluster.
See Confirm Failover section in Confirm Failover and Block Resource Failover for details.

Option Default Description
--server <str> Name of the failover target server.
--value <str> enable or disable
  • enable – Enable user confirmation at failover.
  • disable – Do not confirm the user at failover.

lkcli server block-failover

Configures settings to block failover caused by a resource failure in the specified system.
See the Block Resource Failover section in Confirm Failover and Block Resource Failover for details.

Option Default Description
--server <str> Name of the failover target server.
--value <str> enable or disable
  • enable – Block failover to the specified server.
  • disable – Do not block failover to the specified server.

lkcli mirror

Performs mirroring with DataKeeper.
See Mirroring with SIOS DataKeeper for Linux for more information.

Option Default Description
--tag <str> Tag name of the DataKeeper resource.

lkcli mirror status

Displays the status of the mirror.

lkcli mirror resume

Resumes the mirror.

lkcli mirror pause

Pauses the mirror.

lkcli mirror fullresync

Resyncs the entire mirror with a full disk resynchronization.

lkcli mirror force

Forces the mirror to come online, even if LifeKeeper has marked the mirror disk as possibly out of sync.

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment