bsradm

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

DESCRIPTION

bsradm 유틸리티는 구성 파일을 기반으로 bsr을 관리하는데 사용됩니다. 이 명령은 커널 모듈을 제어하고 디스크상의 메타 데이터를 조작하는 상위 레벨 명령을 하나 이상의 하위 레벨 명령으로 변환하여 "bsrsetup"및 "bsrmeta"유틸리티로 재지정 합니다. 명령에 따라 하나 이상의 리소스, 장치, 연결 또는 피어 장치에 대해 작동합니다. 리소스는 이름으로 지정하고 all 키워드는 모든 리소스에 대한 지정을 의미 합니다.

다음과 같은 명령 컨텍스트가 정의됩니다.

device

장치. minor 번호로 지정하거나(minor- minornumber, e.g. minor-0) 리소스/볼륨번호(resource/volume)로 지정합니다. 리소스만 지정하면 해당 문맥의 모든 장치에 대해 명령을 반복합니다.

connection

연결. 리소스:연결이름(resource:connection-name)으로 지정합니다. 리소스만 지정하면 해당 문맥의 모든 연결에 대해 명령을 반복합니다.

peer_device

피어 장치. 리소스:연결이름/볼륨번호(resource:connection-name/volume)로 지정합니다. 리소스, 장치, 연결만 지정하면 해당 문맥의 모든 피어 장치에 대해 명령을 반복합니다.

bsradm은 bsrsetup의 대부분 옵션을 알고 있으며 모든 이중 대시 옵션 또는 이중 대시 없는 옵션을 지정된 하위 수준 유틸리티에 전달합니다.

OPTIONS

-d, --dry-run

bsradm -d up resource와 같이 실제로 실행하지 않고 실행할 명령을 표시합니다. 이것은 bsrsetup 및 bsrmeta 사용법을 배우는 유용한 방법이 될 수 있습니다.

-c, --config-file file

대체 구성 파일을 사용할 수 있습니다. 기본적으로 bsradm은 다음 중에서 존재하는 첫 번째 파일을 사용합니다: /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

추가 구성 파일을 사용할 수 있습니다. 이 옵션은 dump 및 sh-nop 명령에서만 사용할 수 있습니다.

-s, --bsrsetup file

bsrsetup 프로그램의 전체 경로를 지정합니다. 이 옵션을 생략하면 bsradm이 먼저 같은 경로에서 찾은 다음 PATH 경로를 찾습니다.

-m, --bsrmeta file

bsrmeta 프로그램의 전체 경로를 지정합니다. 이 옵션을 생략하면 bsradm이 먼저 같은 경로에서 찾은 다음 PATH 경로를 찾습니다.

-S, --stacked

bsr에서 사용하지 않는 옵션입니다.

COMMANDS

adjust resource}

구성 파일과 일치하도록 커널 모듈의 구성을 조정합니다. 그 결과는 모든 리소스를 중지하고 다시 시작할 때('bsradm down all' 다음에 'bsradm up all')와 동일해야 합니다. adjust 명령은 경우에 따라 구성 변경을 잘못 해석 할 수 있습니다. 안전을 위해 실제 명령을 실행하기 전에 명령이 수행 할 작업(--dry-run 옵션 사용)을 확인하십시오.

adjust-with-progressresource}

adjust 와 동일하지만 명령 진행 과정에 대한 추가 정보를 제공합니다.

apply-aldevice}

지정된 장치의 activity log 를 적용합니다.

attach device}

하위 수준의 장치를 복제 장치로 적재합니다.

connect {connection}

피어에 대한 기존 연결을 활성화 합니다. 연결은 new-peer 명령으로 먼저 작성해야 하며 new-path 명령으로 하나 이상의 경로를 작성해야 합니다.

create-md {device}

장치의 메타 데이터를 초기화 합니다. 이것은 복제 장치를 최초 연결하기 전에 필요합니다.

cstate {connection}

현재의 연결 상태를 표시합니다.

detach {device}

복제 장치의 하위 장치를 분리합니다.

disconnect {connection}

피어 호스트와의 연결을 제거 합니다.

disk-options {device}

적재된 장치의 disk 옵션을 변경합니다.

down {resource}

이 명령을 통해 모든 볼륨과 연결 그리고 리소스 자체를 제거하여 중지 합니다.

dstate {device}

하위 장치의 현재 디스크 상태를 출력합니다.

dump {resource}

구성파일은 파싱하여 stdout 으로 출력합니다.

dump-md {device}

장치의 메타데이터를 텍스트 형식으로 덤프합니다. 비트맵과 액티비트 로그도 포함됩니다.

get-gi {peer_device}

특정 연결의 장치를 위한 생성 식별자(GI)를 출력합니다. 적재된 장치에는 bsrsetup, 적재되지 않은 장치에는 bsrmeta 를 사용합니다.

hidden-commands

명시적으로 문서화되지 않은 모든 명령을 표시합니다.

invalidate {peer_device}

장치의 로컬 데이터를 피어의 데이터로 동기화 합니다.

invalidate-remote {peer_device}

피어 장치의 데이터를 로컬 노드의 장치로 동기화 합니다.

net-options {connection}

기존 연결의 net 옵션을 변경합니다.

new-current-uuid {device}

새로운 current UUID 를 생성합니다.

outdate {device}

하위 장치의 데이터를 outdated 로 지정합니다.

pause-sync {peer_device}

로컬 일시 정지 플래그를 설정하여 로컬 장치와 피어 장치 간의 재 동기화를 중지합니다.

primary {resource}

리소스에서 노드의 역할을 primary로 변경합니다.

resize {device}

모든 노드에서 복제장치의 하위 장치 크기를 조정합니다. 이것은 check-resizeresize 하위 레벨 명령을 결합하여 수행합니다.

resource-options {resource}

기존 리소스의 리소스 옵션을 변경합니다.

resume-sync {peer_device}

로컬 동기화 일시 정지 플래그를 지워서 재 동기화가 재개 되도록 합니다.

role {resource}

리소스의 현재 역할을 출력합니다.

secondary {resource}

리소스의 역할을 Secondary 로 변경(강등)합니다. 만약 리소스의 복제 장치가 사용 중 이라면 리눅스에서 이 명령은 실패합니다. 윈도우즈에선 장치 사용 여부와 관계없이 강등합니다.

show-gi {peer_device}

특정 연결에서 장치의 데이터 생성 식별자를 표시합니다. 또한 출력에 대해 부연설명 합니다.

up {resource}

다음의 과정으로 리소스를 기동합니다

verify {peer_device}

온라인 검증을 시작, 중지, 또는 특정 부분에 대한 검증을 지정할 수 있습니다.

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

피어 상의 장치, 연결 상의 모든 장치들, 모든 피어상의 모든 장치들이 확인 될 때까지 기다립니다.

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

장치가 연결되고 최종 재 동기화 작업이 완료 될 때까지 기다립니다. 연결 및 리소스 수준에서도 사용할 수 있습니다

wipe-md {device}

장치의 bsr 메타 데이터를 지웁니다.

forget-peer {connection}

메타 데이터에서 연결되지 않은 피어에 대한 참조를 완전히 제거합니다.

bsrsetup

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

DESCRIPTION

bsrsetup 유틸리티는 bsr 커널 모듈을 구성하고 현재 구성을 표시합니다. 사용자는 일반적으로 bsrsetup보다 bsr에 더 높은 수준의 인터페이스를 제공하는 bsradm 유틸리티와 상호 작용합니다. (bsradm에서 bsrsetup을 사용하는 방법을 보려면 bsradm의 --dry-run 옵션을 참조하십시오.) 일부 옵션 인수에는 일반 숫자를 지정할 때 적용되는 기본 스케일이 있습니다 (예: Kilo). 이러한 기본 스케일은 접미사 (예: M의 경우 Mega)를 사용하여 재정의 할 수 있습니다. 공통 접미사 K = 2^10 = 1024, M = 1024K 및 G = 1024M이 지원됩니다.

COMMANDS

bsrsetup attach minor lower_dev meta_data_dev meta_data_index,

bsrsetup disk-options minor

attach 명령은 하위 수준의 장치를 기존 복제 장치에 연결합니다. disk-options 명령은 연결된 하위 장치의 디스크 옵션을 변경합니다. 두 경우 모두 bbssetup new-minor를 사용하여 복제 된 장치를 만들어야 합니다.

두 명령 모두 복제장치의 minor 번호로 지정합니다. lower_dev는 하위 장치의 이름입니다. meta_data_dev는 메타 데이터를 포함하는 장치의 이름이며, lower_dev와 동일 할 수 있습니다. meta_data_index는 인덱스 메타 데이터의 번호이거나 내부 메타 데이터의 경우 internal 키워드 또는 가변 크기의 외부 메타 데이터의 경우 flexible 키워드 입니다. 사용 가능한 옵션은 다음과 같습니다:

--disk-barrier--disk-flushes--disk-drain bsr에는 쓰기 요청의 순서를 처리하는 세 가지 방법이 있습니다.

이 세 가지 방법 중에서 bsr은 백업 저장 장치가 활성화하고 지원하는 첫 번째 방법을 사용합니다. 이 세 가지 옵션을 모두 해제하면 bsr은 쓰기 의존성을 신경 쓰지 않고 요청을 제출합니다. 다른 환경의 클러스터 노드에서는 I/O 스택에 따라 쓰기 요청이 다시 정렬되어 다른 순서로 제출될 수 있습니다. 이럴 경우 데이터가 손실되거나 손상될 수 있습니다. 따라서 쓰기 순서를 제어하는 세 가지 방법을 모두 해제하지 않는 것이 좋습니다.

쓰기 순서를 구성하기위한 일반적인 지침은 휘발성 쓰기 캐시가있는 일반 디스크(또는 일반 디스크 어레이)를 사용할 때 disk-barrier 나 disk-flush 를 사용하는 것입니다. 캐시가 없거나 배터리 백업 쓰기 캐시가 있는 스토리지에서는 disk-drain이 적합합니다.

bsrsetup peer-device-options resource peer_node_id volume

다음은 피어 장치에 영향을 주는 옵션입니다.

bsrsetup check-resize minor

지정된 복제 장치의 하위 장치의 현재 크기를 기억합니다. bsradm에서 사용합니다. 크기 정보는 /var/lib/bsr/bsr-minor-minor.lkbd 파일에 저장됩니다.

bsrsetup new-peer resource peer_node_id,

bsrsetup net-options resource peer_node_id

The new-peer command creates a connection within a resource. The resource must have been created with bsrsetup new-resource. The net-options command changes the network options of an existing connection. Before a connection can be activated with the connect command, at least one path need to added with the new-path command. Available options:

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

The new-path command creates a path within a connection. The connection must have been created with bsrsetup new-peerLocal_addr and remote_addr refer to the local and remote protocol, network address, and port in the format [ address-family:] address[:port]. The address families ipv4ipv6ssocks (Dolphin Interconnect Solutions' "super sockets"), sdp (Infiniband Sockets Direct Protocol), and sci are supported ( sci is an alias for ssocks). If no address family is specified, ipv4 is assumed. For all address families except ipv6, the address uses IPv4 address notation (for example, 1.2.3.4). For ipv6, the address is enclosed in brackets and uses IPv6 address notation (for example, [fd01:2345:6789:abcd::1]). The port defaults to 7788.

bsrsetup connect resource peer_node_id

The connect command activates a connection. That means that the bsr driver will bind and listen on all local addresses of the connection-'s paths. It will begin to try to establish one or more paths of the connection. Available options:

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 a path from a connection. Please note that it fails if the path is necessary to keep a connected connection in tact. In order to remove all paths, disconnect the connection first.

bsrsetup cstate resource peer_node_id

Show the current state of a connection. The connection is identified by the node-id of the peer; see the bsrsetup connect command.

bsrsetup del-minor minor

Remove a replicated device. No lower-level device may be attached; see bsrsetup detach.

bsrsetup del-resource resource

Remove a resource. All volumes and connections must be removed first ( bsrsetup del-minorbsrsetup disconnect). Alternatively, bsrsetup down can be used to remove a resource together with all its volumes and connections.

bsrsetup detach minor

Detach the lower-level device of a replicated device. Available options:

--force Force the detach and return immediately. This puts the lower-level device into failed state until all pending I/O has completed, and then detaches the device. Any I/O not yet submitted to the lower-level device (for example, because I/O on the device was suspended) is assumed to have failed. 

bsrsetup disconnect resource peer_node_id

Remove a connection to a peer host. The connection is identified by the node-id of the peer; see the bsrsetup connect command.

bsrsetup down {resource | all}

Take a resource down by removing all volumes, connections, and the resource itself.

bsrsetup dstate minor

Show the current disk state of a lower-level device.

bsrsetup events2 {resource | all}

Show the current state of all configured bsr objects, followed by all changes to the state. The output format is meant to be human as well as machine readable. The line starts with a word that indicates the kind of event: exists for an existing object; createdestroy, and change if an object is created, destroyed, or changed; or call or response if an event handler is called or it returns. The second word indicates the object the event applies to: resourcedeviceconnectionpeer-devicehelper, or a dash (-) to indicate that the current state has been dumped completely. The remaining words identify the object and describe the state that he object is in. Available options:

bsrsetup get-gi resource peer_node_id volume

Show the data generation identifiers for a device on a particular connection. The device is identified by its volume number. The connection is identified by its endpoints; see the bsrsetup connect command. The output consists of the current UUID, bitmap UUID, and the first two history UUIDS, folowed by a set of flags. The current UUID and history UUIDs are device specific; the bitmap UUID and flags are peer device specific. This command only shows the first two history UUIDs. Internally, bsr maintains one history UUID for each possible peer device.

bsrsetup invalidate minor

Replace the local data of a device with that of a peer. All the local data will be marked out-of-sync, and a resync with the specified peer device will be initialted.

bsrsetup invalidate-remote resource peer_node_id volume

Replace a peer device's data of a resource with the local data. The peer device's data will be marked out-of-sync, and a resync from the local node to the specified peer will be initiated.

bsrsetup new-current-uuid minor

Generate a new current UUID and rotates all other UUID values. This has at least two use cases, namely to skip the initial sync, and to reduce network bandwidth when starting in a single node configuration and then later (re-)integrating a remote site. Available option:

--clear-bitmap Clears the sync bitmap in addition to generating a new current UUID. This can be used to skip the initial sync, if you want to start from scratch. This use-case does only work on "Just Created" meta data. 

bsrsetup new-minor resource minor volume

Create a new replicated device within a resource. The command creates a block device inode for the replicated device (by default, /dev/bsr minor). 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 an existing resource. Available options:

bsrsetup outdate minor

Mark the data on a lower-level device as outdated. This is used for fencing, and prevents the resource the device is part of from becoming primary in the future. See the --fencing disk option.

bsrsetup pause-sync resource peer_node_id volume

Stop resynchronizing between a local and a peer device by setting the local pause flag. The resync can only resume if the pause flags on both sides of a connection are cleared.

bsrsetup primary resource

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

bsrsetup resize minor

Reexamine the size of the lower-level devices of a replicated device on all nodes. This command is called after the lower-level devices on all nodes have been grown to adjust the size of the replicated device. Available options:

bsrsetup resume-io minor

Resume I/O on a replicated device. See the --fencing net option.

bsrsetup resume-sync resource peer_node_id volume

Allow resynchronization to resume by clearing the local sync pause flag.

bsrsetup role resource

Show the current role of a resource.

bsrsetup secondary resource

Change the role of a node in a resource to secondary. This command fails if the replicated device is in use.

bsrsetup show {resource | all}

Show the current configuration of a resource, or of all resources. Available options:

bsrsetup show-gi resource peer_node_id volume

Show the data generation identifiers for a device on a particular connection. In addition, explain the output. The output otherwise is the same as in the bsrsetup get-gi command.

bsrsetup state

This is an alias for bsrsetup role. Deprecated.

bsrsetup status {resource | all}

Show the status of a resource, or of all resources. The output consists of one paragraph for each configured resource. Each paragraph contains one line for each resource, followed by one line for each device, and one line for each connection. The device and connection lines are indented. The connection lines are followed by one line for each peer device; these lines are indented against the connection line. Long lines are wrapped around at terminal width, and indented to indicate how the lines belongs together. Available options:

For example, the non-verbose output for a resource with only one connection and only one volume could look like this: 

bsr0 role:Primary
  disk:UpToDate
  host2.example.com role:Secondary
    disk:UpToDate

With the --verbose option, the same resource could be reported as: 

bsr0 node-id:1 role:Primary suspended:no
  volume:0 minor:1 disk:UpToDate blocked:no
  host2.example.com local:ipv4:192.168.123.4:7788
      peer:ipv4:192.168.123.2:7788 node-id:0 connection:WFReportParams
      role:Secondary congested:no
    volume:0 replication:Connected disk:UpToDate resync-suspended:no

bsrsetup suspend-io minor

Suspend I/O on a replicated device. It is not usually necessary to use this command.

bsrsetup verify resource peer_node_id volume

Start online verification, change which part of the device will be verified, or stop online verification. The command requires the specified peer to be connected. Online verification compares each disk block on the local and peer node. Blocks which differ between the nodes are marked as out-of-sync, but they are not automatically brought back into sync. To bring them into sync, the resource must be disconnected and reconnected. Progress can be monitored 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-* commands waits until a device on a peer is visible. The wait-sync-* commands waits until a device on a peer is up to date. Available options for both commands:

bsrsetup forget-peer resource peer_node_id

The forget-peer command removes all traces of a peer node from the meta-data. It frees a bitmap slot in the meta-data and make it avalable for futher bitmap slot allocation in case a so-far never seen node connects. The connection must be taken down before this command may be used. In case the peer re-connects at a later point a bit-map based resync will be turned into a full-sync.

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 for creating, displaying, and modifying bsr's on-disk metadata. Users usually interact with the bsradm utility, which provides a more high-level interface to bsr than bsrmeta. (See bsradm's --dry-run option to see how bsradm uses bsrmeta.)This utility can only be used on devices which are not currently in use by the kernel.The first argument ( device) specifies the bsr device associated with a volume, or “-” if no device is associated with that volume. If the bsr device is specified, the bsrmeta utility makes sure that the bsr device does not currently have a volume attached to prevent meta-data of an active volume from being destroyed.The second argument specifies the metadata version to use (v06, v07, v08, v09). In most metadata versions, the third argument ( meta_dev) specifies the device which contains the metadata; this argument can be the same as device. The fourth argument ( index) can be one of the keywords internal (for internal metadata), flex-internal (in v07 for variable-sized metadata; v07 otherwise defaults to fixed-size internal metadata), flex-external (for variable-sized external metadata), or a numeric matadata index (for fixed-size external metadata). See the meta-disk parameter in bsr.conf(5).

OPTIONS

--force

Assume yes as the answer to all questions bsrmeta would ask.

--ignore-sanity-checks

Normally, bsrmeta performs some sanity checks before writing to the metadata device: for example, if the device appears to contain a file system, it refuses to destroy the file system by writing into it. Use this option to ignore these checks.

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 the metadata. This is necessary before a bsr resource can be attached. If bsrmeta finds an older version of bsr metadata on the device, it asks if the format should be converted. When bsradm calls bsrmeta's create-md command for a device, it sets the number-of-bitmap-slots argument to the number of peers in the resource. To reserve additional bitmap slots (which allows to add more peers in the future), call bsrmeta directly instead. When a device is used before being connected to its peers the first time, bsr assumes that peers can only handle 4 KiB requests by default. The --peer-max-bio-size option allows to set more optimistic values; use this if the versions of bsr that this device will connect to are known. bsr supports a maximum bio size of 32 KiB since version 8.3.8, of 128 KiB since version 8.3.9, and of 1 MiB since version 8.4.0. If you want to use more than 6433 activity log extents, or live on top of a spriped RAID, you may specify the number of stripes ( --al-stripes, default 1), and the stripe size ( --al-stripe-size-kB, default 32). To just use a larger linear on-disk ring-buffer, leave the number of stripes at 1, and increase the size only: 

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

Show the data generation identifiers for a device on a particular connection. bsr version 9.0.0 and beyond support multiple peers; use the node-id option to define which peer's data generation identifiers to show.

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

Similar to get-gi, but with explanatory information.

dump-md

Dump the metadata of a device in text form, including the bitmap and activity log.

outdate

Mark the data on a lower-level device as outdated. See bsrsetup(8) for details.

dstate

Show the current disk state of a lower-level device.

check-resize

Examine the device size of a lower-level device and its last known device size (saved in /var/lib/bsr/bsr-minor-minor.lkbd by bsrsetup check-resize). For internal metadata, if the size of the lower-level device has changed and the metadata can be found at the previous position, move the metadata to the new position at the end of the block device.

apply-al

Apply the activity log of the specified device. This is necessary before the device can be attached by the kernel again.

EXPERT COMMANDS

The bsrmeta utility can be used to fine tune metdata. Please note that this can lead to destroyed metadata or even silent data corruption; use with great care only.

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

Set the generation identifiers. The gi argument is a generation counter for the v06 and v07 formats, and a set of UUIDs for v08 and beyond. Accepts the same syntax as in the get-gi output. bsr version 9.0.0 and beyond support multiple peers; use the --node-id option to define which peer's data generation identifiers to set.

restore-md dump_file

Replace the metadata on the device 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

COMMANDS

/nodelayedack [ip|guid]


/delayedack_enable [ip|guid]


/m [letter] : mount


/get_log [ProviderName]


/minlog_lv dbg [Level : 0~7]


/write_log [ProviderName] "[LogData]"


/handler_use [0,1]


/bsrfsflt_status


/info


/status