bsradm

bsradm [options...] [-- [ backend-options...]] {command} {context...}

DESCRIPTION

The bsradm utility is used to manage bsr based on configuration files. This command overrides the "bsrsetup" and "bsrmeta" utilities by converting high-level commands that control kernel modules and manipulate metadata on disk into one or more low-level commands. Works on one or more resources, devices, connections, or peer devices, depending on the command. Specify resources by name, and the all keyword refers to all resources.

The following command context is defined.

device

Device. Specify as a minor number (minor-minornumber, e.g. minor-0) or as a resource volume number (resource/volume). If you specify only resources, the command repeats for all devices in that context.

connection

Connection. Specify as resource: connection-name. If you specify only a resource, the command repeats for all connections in that context.

peer_device

Peer device. Specify Resource:connection name/volume number (resource: connection-name/volume). If you specify only resources, devices, and connections, the command repeats for all peer devices in that context.

bsradm knows most of the options in bsrsetup and passes all double dash options or no double dash options to the specified low-level utility.

OPTIONS

-V, --version

Print the version information of the BSR.

-d, --dry-run

Displays commands to execute without actually executing, such as bsradm -d up <resource>. This can be a useful way to learn how to use bsrsetup and bsrmeta.

-c, --config-file file

Alternative configuration files can be used. By default, bsradm uses the first one of the following: /etc/bsr-90.conf, ./etc/bsr-84.conf, /etc/bsr-83.conf, /etc/bsr-82.conf, /etc/bsr-08.conf, /etc/bsr.conf.

-t, --config-to-test file

Additional configuration files are available. This option can only be used with the dump and sh-nop commands.

-s, --bsrsetup file

Specifies the full path to the bsrsetup. If this option is omitted, bsradm looks first in the same path and then in the PATH path.

-m, --bsrmeta file

Specifies the full path to the bsrmeta. If this option is omitted, bsradm looks first in the same path and then in the PATH path.

-S, --stacked

Deprecated.

COMMANDS

adjust resource}

Adjust the kernel module's configuration to match the configuration file. The result should be the same when stopping and restarting all resources ('bsradm up all' followed by 'bsradm up all'). The Adjust command may interpret configuration changes incorrectly in some cases. For safety, see what the command will do (using the --dry-run option) before running the actual command.

adjust-with-progressresource}

Same as adjust, but provides additional information on the progress of the command.

apply-aldevice}

Apply the activity log of the specified device.

attach device}

Attach the lower-level devices as replicated devices.

connect {connection}

Activate an existing connection to the peer. Connections must be made first with the new-peer command and one or more paths with the new-path command.

create-md {device}

Initialize the device's metadata. This is required before connecting the clone device for the first time.

cstate {connection}

Displays the current connection status.

detach {device}

Detach the lower device of the replicated device.

disconnect {connection}

Remove the connection to the peer host.

disk-options {device}

Change the disk options of the attached device.

down {resource}

This command stops all volumes, connections, and the resource itself.

dstate {device}

Prints the current disk status of the lower device.

dump {resource}

Parse the configuration file and print it to stdout.

dump-md {device}

Dumps the device's metadata in text format. Bitmaps and activity logs are also included.

get-gi {peer_device}

Outputs the generatation identifiers(GI) for a device on a specific connection. Use bsrsetup for attached devices and bsrmeta for detached devices.

hidden-commands

Displays all commands that are not explicitly documented.

invalidate {peer_device}

Synchronize the device's local data with the peer's data.

invalidate-remote {peer_device}

Synchronize data from peer devices to devices on the local node.

net-options {connection}

Change the net options of an existing connection.

new-current-uuid {device}

Create a new current UUID.

new-current-uuid --no-rotate-bitmap {device}

Creates a new current UUID but does not rotate the bitmap UUID. Gives the effect that I/O occurred locally.

outdate {device}

Set the data of the child device to outdated.

pause-sync {peer_device}

Set the local pause flag to stop resynchronization between local and peer devices.

primary {resource}

Change the role of the node in the resource to primary.

resize {device}

Resize the lower device of the replica on all nodes. This is done by combining check-resize and resize low-level commands.

resource-options {resource}

Change resource options for an existing resource.

resume-sync {peer_device}

Clear the local sync pause flag so that resynchronization resumes.

role {resource}

Print the current role of the resource.

secondary {resource}

Change the role of the resource to Secondary. This command will fail on Linux if the resource's replicated device is in use. On Windows, it is demoted whether or not the device is used.

show-gi {peer_device}

Displays the data generation identifier of the device on a specific connection. Also, the output is explained in detail.

up {resource}

Start the resource in the following procedure.

verify {peer_device}

Start, stop, or specify verification for specific parts of online verification.

wait-connect {[device] | [connection] | [resource]}

Wait for devices on the peer, all devices on the connection, all devices on all peers to be verified.

wait-sync {[device] | [connection] | [resource]}

Wait for the device to connect and the final resync operation to complete. Also available at the connection and resource level

wipe-md {device}

Clears the device's bsr metadata.

forget-peer {connection}

Removes references to unconnected peers completely from metadata.

bsrsetup

bsrsetup command {argument...} [option...]

DESCRIPTION

The bsrsetup utility configures the bsr kernel module and displays the current configuration. Users typically interact with the bsradm utility, which provides a higher level interface to bsr than bsrsetup. (See bsradm's --dry-run option to see how to use bsrsetup in bsradm.) Some option arguments have a default scale applied when specifying a regular number (eg, Kilo). These default scales can be overridden using a suffix (eg Mega for M). Common suffixes K = 2^10 = 1024, M = 1024K and G = 1024M are supported.

COMMANDS

bsrsetup attach minor lower_dev meta_data_dev meta_data_index,

bsrsetup disk-options minor

The attach command attaches a lower-level device to an existing replicated device. The disk-options command changes the disk options of the attached child device. All commands All Targets the clone device created by bsrsetup new-minor and specifies it as the minor number of the replicated device. lower_dev is the name of the child device. meta_data_dev is the name of the device that contains the metadata, it can be the same as lower_dev. meta_data_index is the number of index metadata or the internal keyword for internal metadata or the flexible keyword for variable-size external metadata. The available options are:

--disk-barrier--disk-flushes--disk-drain bsr has three ways to handle the order of write requests.

Of these three methods, bsr uses the first method enabled and supported by the backup storage device. If you turn off all three options, bsr submits the request without worrying about write dependencies. On a cluster node in another environment, write requests can be reordered according to the I / O stack and submitted in a different order. This can result in data loss or corruption. Therefore, we recommend that you do not turn off all three methods of controlling the write order.

A general guideline for configuring write ordering is to use disk-barrier or disk-flush when using a regular disk (or a regular disk array) with a volatile write cache. Disk-drain is suitable for storage with no cache or with a battery-backed write cache.

bsrsetup peer-device-options resource peer_node_id volume

The following options affect the peer device.

bsrsetup check-resize minor

Remembers the current size of the specified replicated lower devices. Used by bsradm. Size information is stored in the /var/lib/bsr/bsr-minor-minor.lkbd file.

bsrsetup new-peer resource peer_node_id,

bsrsetup net-options resource peer_node_id

The new-peer command creates a connection within the resource. Resources must be created with bsrsetup new-resource. The net-options command changes the network options of an existing connection. Before activating a connection with the connect command, you must add at least one path with the new-path command. The available options are:

bsrsetup new-path resource peer_node_id local-addr remote-addr

The new-path command creates a path within the connection. The connection must be made with bsrsetup new-peer. local-addr and remote-addr must describe local and remote protocols, network addresses, and ports in the form [address-family:] address [: port]. ipv4, ipv6 are supported. If no address family is specified, "ipv4" is assumed. For all address families except ipv6, the address uses IPv4 address notation (e.g. 1.2.3.4). For ipv6, addresses are enclosed in parentheses and use IPv6 address notation (eg [fd01: 2345: 6789: abcd :: 1]). The default port is 7788.

bsrsetup connect resource peer_node_id

The connect command activates the connection. That is, the bsr driver binds and listens to all local addresses in the connection path. Tries to establish one or more connection paths. The available options are:

bsrsetup del-peer resource peer_node_id

The del-peer command removes a connection from a resource.

bsrsetup del-path resource peer_node_id local-addr remote-addr

The del-path command removes the path from the connection. However, if you need to keep the connection already connected, this command will fail. To remove all paths, you must first disconnect.

bsrsetup cstate resource peer_node_id

Displays the current status of the connection. Connections are identified by the peer's node-id.

bsrsetup del-minor minor

Remove the replicated device. Subsequent devices will no longer be attached after this.

bsrsetup del-resource resource

Remove resources. To do this, you must first remove all volumes and connections (bsrsetup del-minor, bsrsetup disconnect). Or you can use bsrsetup down to remove resources with all volumes and connections.

bsrsetup detach minor

Detach the lower device from the replicated device. The available options are:

bsrsetup disconnect resource peer_node_id

Remove the connection to the peer host. Connections are identified by the peer's node-id.

bsrsetup down {resource | all}

Stop resources by removing all volumes, connections, and the resource itself.

bsrsetup dstate minor

Displays the current disk status of the child device.

bsrsetup events2 {resource | all}

Displays the current state of all configured bsr objects and any changes in state. Output starts with the type of event. There are types of events, such as when an existing object is created, destroyed, or changed, an event handler is called or returned. The following describes the resource, device, connection, peer device, and helper object to which the event applies. The rest identifies the object and displays the object's status. The following options are available.

bsrsetup get-gi resource peer_node_id volume

Displays the data generation identifier of the device on a specific connection. Devices are identified by volume number, and connections by endpoints. See the "bsrsetup connect" command. The output now consists of the first two historical UUIDs, which consist of a UUID, bitmap UUID, and a set of flags. The current UUID and historical UUID are device-specific. Bitmap UUIDs and flags vary by peer device. This command only displays the first two historical UUIDs. bsr maintains one historical UUID for each peer device that is internally possible.

bsrsetup invalidate minor

Synchronize the device's local data with the peer's data. All space used by the peer's filesystem is marked out of sync and resynchronized with the specified local data.

bsrsetup invalidate-remote resource peer_node_id volume

Synchronize peer data with local data. All space used by the local file system is marked out of sync and resynchronized with the specified peer data.

bsrsetup new-current-uuid minor

Create a new current UUID and rotate all other UUID values. The available options are:

bsrsetup new-minor resource minor volume

Create a new clone device within the resource. This command creates a block device inode for the clone device (/dev/bsr minor by default). The volume number identifies the device within the resource.

bsrsetup new-resource resource node_id,

bsrsetup resource-options resource

The new-resource command creates a new resource. The resource-options command changes the resource options of the created resource. The available options are:

bsrsetup outdate minor

Displays data of sub-devices as outdated. Used for fencing and prevents future devices from becoming primary resources.

bsrsetup pause-sync resource peer_node_id volume

Set the local pause flag to stop resynchronization between the local device and peer device. Resynchronization can only be resumed if the pause flags on both sides of the connection are cleared.

bsrsetup primary resource

Change the role of the node in the resource to primary. This allows replicated devices of this resource to be mounted or opened for writing. Available options:

bsrsetup resize minor

Resize the subdevice of the replicated device on all nodes. This command is called after resizing the replicated device because all nodes' low-level devices have grown. The available options are:

bsrsetup resume-io minor

Resume I/O on the replicated device.

bsrsetup resume-sync resource peer_node_id volume

Clear the local sync pause flag so that resynchronization resumes.

bsrsetup role resource

Shows the current role of the resource.

bsrsetup secondary resource

Change the role of the node in the resource to secondary. On Linux, the command will fail if the replicated device is in use. On Windows, demote to Secodary regardless of whether it is used or not.

bsrsetup show {resource | all}

Displays the current configuration settings for a resource or all resources. The available options are:

bsrsetup show-gi resource peer_node_id volume

Displays the data generation identifier of the device on a particular connection and describes the output. Same as the "bsrsetup get-gi" command except for the description.

bsrsetup state

An alias for the bsrsetup role. Deprecated.

bsrsetup status {resource | all}

Displays the status of a resource or all resources. The output consists of one paragraph for each configured resource. Each paragraph has one line for each resource, one line for each device, and one line for each connection. The device and connection lines are indented. After the connection line, there is one line for each peer device. These lines are indented on the connecting line. Long lines are wrapped with terminal width and indented to show how the lines are joined. The available options are:

bsrsetup suspend-io minor

Not Supported.

bsrsetup verify resource peer_node_id volume

Start an online verification, change or stop the test if you see a specific part of the device. The command must have a specified peer connected. The online check compares each disk block of local and peer nodes. Other blocks between nodes are written as OOS, but are not automatically resynchronized. To synchronize, you need to disconnect and reconnect the resource. You can monitor the progress in the output of bsrsetup status --statistics. Available options:

bsrsetup wait-connect-volume resource peer_node_id volume,

bsrsetup wait-connect-connection resource peer_node_id,

bsrsetup wait-connect-resource resource,

bsrsetup wait-sync-volume resource peer_node_id volume,

bsrsetup wait-sync-connection resource peer_node_id,

bsrsetup wait-sync-resource resource

The wait-connect-* command waits for the peer's device to appear. The wait-sync-* command waits until the peer's device is up to date. bsr is not recommended for use with commands that are rarely used.

bsrsetup forget-peer resource peer_node_id

The forget-peer command removes all traces of peer nodes from metadata. You can free up bitmap slots in the metadata and use them to allocate additional bitmap slots if a node you have never seen connects. You must disconnect to use this command. If the peer reconnects later, bitmap based resynchronization is replaced by full synchronization.

bsrmeta

bsrmeta [--force] [--ignore-sanity-checks] { device} {v06 minor | v07  meta_dev index | v08 meta_dev index | v09  meta_dev index} { command} [cmd args...]

DESCRIPTION

The bsrmeta utility is used to create, display and modify bsr's on-disk metadata. Users typically interact with the bsradm utility, which provides a higher level interface to bsr than bsrarm. (See bsramm's dry-run option for how to use bsradm.) This utility is only available for devices not currently used by the kernel. The first argument (device) specifies the bsr device associated with the volume, or "-" if no device is associated with the volume. If a bsr device is specified, the bsr utility checks to see if the bsr device has a volume attached first to prevent metadata corruption on the currently active volume. The second argument is the version of the metadata to use (v06, v07, v08, v09). Designate. In most versions of metadata, the third argument (meta_dev) specifies the device that contains the metadata. This argument can be the same as the device. The fourth argument (index) is the keyword internal (for internal metadata), flex-internal variable (v07 for variable-size metadata, v07 is fixed-size internal metadata by default), flex-external (of variable size) Case). External metadata or numeric matadata index (for fixed-size external metadata) See Meta disk parameters in bsr.conf.

OPTIONS

--force

Assuming yes and answering all questions bsrmeta will ask.

--ignore-sanity-checks

In general, bsrmeta performs some defect checking before writing to the metadata device. For example, if the device contains a file system, it refuses to write meta to protect the file system from corruption. Use this option to ignore this defect check.

COMMANDS

create-md [--peer-max-bio-size=val] (metadata versions v06, v07, and v08),

create-md {number-of-bitmap-slots} [--peer-max-bio-size=val] [ --al-stripes=val] [--al-stripe-size-kB= val] (metadata version v09)

Initialize metadata. This is required before attaching the bsr resource. When bsrmeta finds the old version of bsr metadata on the device, it asks if it needs to convert the format. bsradm sets the bitmap slot count argument to the number of peers in the resource when invoking bsrmeta's create-md command for the device. To reserve additional bitmap slots (so you can add more peers in the future), call bbsrmeta instead. If you use the device before the first connection to the peer, bsr assumes that the peer can only handle 4KiB requests by default. Use the "peer-max-bio-size" option to set a more optimistic value. Use this if the bsr version to which this device will connect is known. If you want to use more than 6433 activity log ranges or configure over stripe RAID, you need to specify the number of stripes (--al-stripes, default 1) and the size of stripes (--al-stripe- size-kB, default 32). To use a larger linear on disk ring buffer, keep the number of stripes to 1 and increase only the size.

get-gi [--node-id=id]

Displays the data generation identifier of the device on a specific connection. bsr supports multiple peers. Use the node-id option to define the data generation identifier of the peer to be displayed.

show-gi [--node-id=id]

Similar to get-gi, but with descriptive information.

dump-md

Dump the device's metadata, including bitmap and activity log, in text format.

outdate

The data of the lower device is marked as outdated.

dstate

Displays the current disk status of the lower device.

check-resize

Check the device size of the sub-device and the last known device size (stored as /var/lib/bsr/bsr-minor-minor.lkbd by bsrsetup check-resize). For internal metadata, the size of the low-level device If it changes and you can find the metadata in the old location, move the metadata from the end of the block device to the new location.

apply-al

Apply the activity log of the specified device. This is needed before the device is reattached by the kernel.

EXPERT COMMANDS

The bsrmeta utility can be used to fine-tune metadata. This can lead to metadata corruption or data corruption automatically. Use with caution.

set-gi gi [--node-id=id

Set the generation identifier. bsr supports multiple peers and is set up with the same syntax as in the get-gi output. You can use the --node-id option to define the data generation identifier of the peer to be set.

restore-md dump_file

Replace the device's metadata with the contents of dump_file. The dump file format is defined by the output of the dump-md command.

bsrcon

bsrcon command {argument...}

DESCRIPTION

Set up the BSR's network, logs, volumes, handlers, etc.

COMMANDS

/nodelayedack [ip|guid]

Disables the delayed ACK behavior of TCP/IP. This is required for replication to work and is Windows only.

/delayedack_enable [ip|guid]

Enables delayed ACK behavior for TCP/IP. Windows only.

/release_vol [letter]

This command completely releases the volume lock that controls the Windows volume. This command must be performed as the final step in deleting a resource and is Windows only.

If you perform this command, you must reorganize the resource and perform a full synchronization again.

/bsrlock_use

Commands to temporarily enable or disable locks on a volume. This is for debugging purposes and is Windows only.

/bsrlock_status

Commands to view the lock status of a volume. Windows only.

/info

Prints the volume's partitions, mount points, and other related information. Windows only.

/handler_use [0,1]

Enables or disables the BSR's handler.

/maxlogfile_cnt [LogFileMaxCount : 0 ~ 1000]

/climaxlogfile_cnt [adm, setup, meta] [LogFileMaxCount : 0 ~ 255]

/minlog_lv [sys, dbg] [Level : 0~7] level info, emerg(0) alert(1) criti(2) err(3) warning(4) notice(5) info(6) debug(7)

/minlog_lv feature [flag : 0,1,2,4] level info, none(0) oos(1) latency(2) verify(4)