lkcli drbd

lkcli drbd removesys

Option Default Description
--tag <str> Tag name of the DRBD resource
--sys <str> System to remove from the DRBD configuration

The removesys subcommand is used to remove a system from a resource file. This is used when the LifeKeeper hierarchy has been removed or unextended to a system but the system is still configured in the resource file. If the LifeKeeper configuration is extended to <sys> then this command will fail with the error:

Tag <tag> is extended to <sys>, resource configuration can not be removed.

To remove a system that is configured in both DRBD and LifeKeeper use unextend.

Permission lkadmin

lkcli drbd pause

Option Default Description
--tag <str> Tag name of the DRBD resource
--sys <str> Local system (optional) System to pause replication

The pause subcommand is used to pause replication to <sys> or to the local system if <sys> is not passed in. The resource must be in-service on another system and can continue in-use while the target is paused. The paused system will force the resource primary and the file system is mounted automatically to allow access on the paused system. When access from the paused system is complete, replication can be resumed using the resume subcommand. If the local system is the in-service node the command will fail with the error:

Pause does not support pausing the in-service server.

Permission lkadmin

lkcli drbd resume

Option Default Description
--tag <str> Tag name of the DRBD resource
--sys <str> Local system (optional) System to resume replication

The resume subcommand is used to resume replication to <sys> or to the local system if <sys> is not passed in. Resume will unmount the file system on the “paused” system and will set the state to secondary. The resume will discard the data from the paused system.

Permission lkadmin

lkcli drbd force

Option Default Description
--tag <str> Tag name of the DRBD resource
--sys <str> Local system (optional) System to force in-service

The force subcommand is used to in-service the DRBD resource where DRBD may not think the latest data exists. Use of this subcommand should be done with care as it may cause loss of committed data. This subcommand can be used on a paused system to force the paused system to be the in-service system. This will cause any changes on the original in-service system to be lost.

Permission lkadmin

lkcli drbd options

The options subcommand is used to add, change or delete optional settings for the DRBD resource. ** WARNING ** The options subcommand allows low-level, potentially dangerous changes to the DRBD resource configuration files. It is recommended only for experienced DRBD users. Run ‘lksupport -c’ prior to making any changes to the DRBD configuration files.

Refer to the DRBD 9 User’s Guide at www.linbit.com for more details.

Permission lkadmin

lkcli drbd options -h

Option Default Description
-h help

This will list all options supported by DRBD. The default values and valid settings for many options are provided. This information can also be found using the DRBD tool ‘drbdsetup —xml-help’. Sample output from ‘lkcli drbd options -h’:

split-brain (string) on-no-quorum (handler): io-error, suspend-io max-io-depth (numeric) Default: 8000; RANGE: [4 - 4294967295] auto-promote (boolean) Default: yes; yes/no quorum-minimum-redundancy (numeric-or-symbol) Default: off; RANGE: [1 - 32] or one of [off, majority, all]

Each line contains the name of the entry or option. In this example output the entries are “split-brain”, “on-no-quorum”, “max_io_depth”, “auto-promote”, and “quorum-minimum-redundancy”. Following the entry is the type of the entry (string, handler, numeric, boolean, and numeric-or-symbol).

  • “string” entry does not have a default or specified list of valid values
  • “handler” provides a list of valid entries but does not provide a default
  • “boolean” will show the default and the possible values (yes/no)
  • “numeric” will show the default value and the range of options and in some cases the units the value represents
  • “numeric-or-symbol” will show the default value, the range of values along with supported symbols

lkcli drbd options --tag <tag> --entry <entry> --value <value> [--sys <sys>]

Option Default Description
--tag <str> Tag name of the DRBD resource
--entry <entry> The name of the entry or option
--value <value> The appropriate value for this entry. Double quote strings that contain a space.
--sys <sys> Local system (optional setting) Operation is performed on <sys>

This will add (or change) <entry> with the specified <value> into the appropriate section in the DRBD resource file. The DRBD tools will automatically determine the appropriate section for the entry and validate the <value>. If the <entry> already exists then the <value> is replaced.

‘lkcli drbd options --tag drbd-test_lk1 --entry disk-barrier --value no’ adds "disk-barrier no;" to disk section at resource level Resource “lk1” { disk { disk-barrier no; } : }

lkcli drbd options --tag <tag> --entry <entry> -u [--sys <sys>]

Option Default Description
--tag <str> Tag name of the DRBD resource
--entry <entry> The name of the entry or option
-u Unset or delete the specified entry
--sys <sys> Local system (optional setting) Operation is performed on <sys>

This will unset (delete) the <entry> from the appropriate section in the DRBD resource file. No error is given if the <entry> does not exist.

‘lkcli drbd options --tag drbd-test_lk1 --entry disk-barrier -u’
deletes “disk-barrier no;” from disk section at the resource level

Resource “lk1” { disk { } : }

lkcli drbd options --tag <tag> --entry <entry> -c --host1 <host1> --host2 <host2> [--sys <sys>]

Option Default Description
--tag <str> Tag name of the DRBD resource
--entry <entry> The name of the entry or option
--value <value> The appropriate value for this entry. Double quote strings that contain a space.
-c Add <entry> to “net” section of the connection between <host1> and <host2>
--host1 <host1> Name of the first host in the connection
--host2 <host2> Name of the second host in the connection
--sys <sys> Local system (optional setting) Operation is performed on <sys>

This will add (or change) <entry> with the specified <value> into the “net” section of the connection section for <host1> and <host2>. If the <entry> is not valid for the “net” section or the connection for host1/host2 is not found an error is logged.

‘lkcli drbd options --tag drbd-test_lk1 --entry after-sb-0pri --value discard-zero-changes -c --host1 ip-12-0-3-160.ec2.internal --host2 ip-12-0-3-181.ec2.internal’
Adds ‘after-sb-0pri discard-zero-changes;’ into the net section for connection for ip-12-0-3-160.ec2.internal and ip-12-0-3-181.ec2.internal

Resource “lk1” { : connection { host ip-12-0-3-160.ec2.internal address ipv4 12.0.3.160:7790; host ip-12-0-3-181.ec2.internal address ipv4 12.0.3.181:7790; net { after-sb-2pri disconnect; protocol A; : } } : }

lkcli drbd options --tag <tag> --entry <entry> -u -c --host1 <host1> --host2 <host2> [--sys <sys>]

This will unset (delete) the <entry> from the connection section between <host1> and <host2>. An error will be logged if the connection is not found. An error will NOT be logged if the entry is not defined in that connection. If the <entry> is not valid for the “net” section or the connection for host1/host2 is not found an error is logged.

Option Default Description
--tag <str> Tag name of the DRBD resource
--entry <entry> The name of the entry or option
-u Unset or delete the specified entry
-c Add <entry> to “net” section of the connection between <host1> and <host2>
--host1 <host1> Name of the first host in the connection
--host2 <host2> Name of the second host in the connection
--sys <sys> Local system (optional setting) Operation is performed on <sys>

‘lkcli drbd options --tag drbd-test_lk1 --entry after-sb-0pri -u -c --host1 ip-12-0-3-160.ec2.internal --host2 ip-12-0-3-181.ec2.internal’
Deletes ‘after-sb-0pri …;’ from the net section for connection for ip-12-0-3-160.ec2.internal and ip-12-0-3-181.ec2.internal

Resource “lk1” { : connection { host ip-12-0-3-160.ec2.internal address ipv4 12.0.3.160:7790; host ip-12-0-3-181.ec2.internal address ipv4 12.0.3.181:7790; net { protocol A; : } } : }

lkcli drbd options --tag <tag> --entry <entry> --value <value> -v [--sys <sys>]

This will add (or change) <entry> with the specified value <value> into the volume 0 section for the specified <sys> or the local system if <sys> is not specified. If the <entry> is not valid for the “disk” section an error is logged.

Option Default Description
--tag <str> Tag name of the DRBD resource
--entry <entry> The name of the entry or option
--value <value> The appropriate value for this entry. Double quote strings that contain a space.
-v Add <entry> to “disk” section of volume 0 for <sys>
--sys <sys> Local system (optional setting) Operation is performed on <sys>

Example 1:

‘lkcli drbd options --tag drbd-test_lk1 --entry disk-flushes --value yes -v’
Adds ‘disk-flushes yes;’ into the disk section for the local system. In this example the command was run on ip-12-0-3-160.ec2.internal. The entry for ip-12-0-3-181.ec2.internal is not affected.

Resource “lk1” { : on ip-12-0-3-160.ec2.internal { volume 0 { disk /dev/disk/by-id/dm-uuid-LVM-212OIgBOgwNXkdh5FAeEfL4ANnR; meta-disk internal; device minor 2; disk { disk-flushes yes; } : } } on ip-12-0-3-181.ec2.internal { volume 0 { disk /dev/disk/by-id/dm-uuid-LVM-KZaPW9I2EkxedVAMi4e9rFnlJ8Ge; meta-disk internal; device minor 2; disk { resync-rate 40M; } } : }

: }

Example 2:

‘lkcli drbd options --tag drbd-test_lk1 --entry disk-flushes --value no -v --sys ip-12-0-3-181.ec2.internal’
Adds ‘disk-flushes no;’ into the disk section for ip-12-0-3-181.ec2.internal. In this example the command was run on ip-12-0-3-160.ec2.internal.

Resource “lk1” { : on ip-12-0-3-160.ec2.internal { volume 0 { disk /dev/disk/by-id/dm-uuid-LVM-212OIgBOgwNXkdh5FAeEfL4ANnR; meta-disk internal; device minor 2; disk { disk-flushes yes; } : } } on ip-12-0-3-181.ec2.internal { volume 0 { disk /dev/disk/by-id/dm-uuid-LVM-KZaPW9I2EkxedVAMi4e9rFnlJ8Ge; meta-disk internal; device minor 2; disk { disk-flushes no; resync-rate 40M; } } } : }

lkcli drbd options --tag <tag> --entry <entry> -v -u [--sys <sys>]

This will delete <entry> from volume 0 section of the specified <sys> or the local system if <sys> is not specified. No error is logged if <entry> does not exist in the volume 0 section. If the <entry> is not valid for the “disk” section an error is logged.

Option Default Description
--tag <str> Tag name of the DRBD resource
--entry <entry> The name of the entry or option
-u Unset or delete the specified entry
-v Delete <entry> to “disk” section of volume 0 for <sys>
--sys <sys> Local system (optional setting) Operation is performed on <sys>

‘lkcli drbd options --tag drbd-test_lk1 --entry disk-flushes -u -v’
Deletes ‘disk-barrier …;’ from the disk section for the local system. In this example the command was run on ip-12-0-3-160.ec2.internal.

Resource “lk1” { : on ip-12-0-3-160.ec2.internal { volume 0 { disk /dev/disk/by-id/dm-uuid-LVM-212OIgBOgwNXkdh5FAeEfL4ANnR; meta-disk internal; device minor 2; disk { } : } } : }

lkcli drbd status --tag <tag> [ --update]

Option Default Description
--tag <str> Tag name of the DRBD resource
--update Update the status every 2 seconds (optional)

Displays the status of the resource.

Permission lkadmin, lkoper, lkguest

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