en to zh translation catalogue (436 entries)

note: type: Title ==
en: Common administrative tasks
zh: 常见管理任务

note: type: Plain text
en: This chapter outlines typical administrative tasks encountered during day-to-day operations. It does not cover troubleshooting tasks, these are covered in detail in <<ch-troubleshooting>>.
zh: 本章概述了日常运营中遇到的典型管理任务。它不包括故障排除任务，故障排除任务在<<ch-troubleshooting>>中有详细介绍。

note: type: Title ===
en: Checking DRBD status
zh: 检查DRBD状态

note: type: Title ====
en: Retrieving status with drbdmon
zh: 使用drbdmon检索状态

note: type: Plain text
en: One convenient way to look at DRBD's status is the `drbdmon` utility. It updates the state of DRBD resources in realtime.
zh: 查看DRBD状态的一种方便方法是 `drbdmon` 组件。它实时更新DRBD资源的状态。

note: type: Title ====
en: Retrieving status and interacting with DRBD via drbdtop
zh: 通过drbdtop检索状态并与DRBD交互

note: type: Plain text
en: As its name suggests, `drbdtop` shares similarities with tools like `htop`. On one hand it allows monitoring of DRBD resources as well as interacting (e.g., switching them to _Primary_, or even resolving split-brains).  A complete overview can be found here[https://linbit.github.io/drbdtop/].
zh: 顾名思义，`drbdtop` 与 `htop` 等工具有相似之处。一方面，它允许监控DRBD资源以及交互（例如，将它们切换到 _Primary_ ，甚至解决裂脑问题）。完整的概述可以在这里找到[https://linbit.github.io/drbdtop/]。

note: type: Title ====
en: Status information in `/proc/drbd`
zh: `/proc/drbd中的状态信息`

note: type: Plain text
en: `/proc/drbd` is deprecated. While it won't be removed in the 8.4 series, we recommend to switch to other means, like <<s-drbdadm-status>>; or, for monitoring even more convenient, <<s-drbdsetup-events2>>.
zh: `/proc/drbd` 已弃用。虽然它不会在8.4系列中删除，但我们建议切换到其他方式，如<<s-drbdadm-status>>；或者，为了更方便地监视:<<s-drbdsetup-events2>>。

note: type: Plain text
en: indexterm:[/proc/drbd]`/proc/drbd` is a virtual file displaying basic information about the DRBD module.  It was used extensively up to DRBD 8.4, but couldn't keep up with the amount of information provided by DRBD 9.
zh: indexterm:[/proc/drbd]`/proc/drbd` 是一个虚拟文件，显示有关drbd模块的基本信息。在DRBD 8.4之前，它被广泛使用，但无法跟上DRBD 9提供的信息量。

note: type: Plain text
en: The first line, prefixed with `version:`, shows the DRBD version used on your system. The second line contains information about this specific build.
zh: 第一行以 `version:` 为前缀，显示系统上使用的DRBD版本。第二行包含有关此特定生成的信息。

note: type: Title ====
en: Status information via `drbdadm`
zh: 通过 `drbdadm` 获取状态信息

note: type: Plain text
en: indexterm:[drbdadm, status]In its simplest invocation, we just ask for the status of a single resource.
zh: indexterm:[drbdadm, status]在其最简单的调用中，我们只需请求单个资源的状态。

note: type: Plain text
en: This here just says that the resource _home_ is locally, on 'nina', and on 'nino' _UpToDate_ and _Secondary_; so the three nodes have the same data on their storage devices, and nobody is using the device currently.
zh: 这里表明资源_home_是本地的，在 `nina` 上以及在 `nino` 上，是 _UpToDate_ 的和 _Secondary_ 的，所以这三个节点在他们的存储设备上有相同的数据，并且目前没有人在使用这个设备。

note: type: Plain text
en: The node 'nono' is not connected, its state is reported as _Connecting_; please see <<s-connection-states>> below for more details.
zh: 节点 `nono` 是未连接的，其状态报告为  Connecting_ ；有关详细信息，请参见下面的<<s-connection-states>>。

note: type: Plain text
en: You can get more information by passing the `--verbose` and/or `--statistics` arguments to `drbdsetup` (lines broken for readability):
zh: 您可以通过将 `--verbose` 和/或 `--statistics` 参数传递给 `drbdsetup` 来获得更多信息（为了可读性，行输出将被打断）：

note: type: Plain text
en: Every few lines in this example form a block that is repeated for every node used in this resource, with small format exceptions for the local node - see below for more details.
zh: 此示例中的每几行组成一个块，对于此资源中使用的每个节点重复此块，对于本地节点则有小的格式例外 - 有关详细信息，请参见下面的内容。

note: type: Plain text
en: The first line in each block shows the `node-id` (for the current resource; a host can have different ``node-id``s in different resources).  Furthermore the `role` (see <<s-roles>>) is shown.
zh: 每个块中的第一行显示 `node id`（对于当前资源；主机在不同资源中可以有不同的 `node id` ）。此外，还显示了 `role` （请参见<<s-roles>>）。

note: type: Plain text
en: The next important line begins with the `volume` specification; normally these are numbered starting by zero, but the configuration may specify other IDs as well. This line shows the indexterm:[connection state] connection state in the `replication` item (see <<s-connection-states>> for details) and the remote indexterm:[disk state] disk state in `disk` (see <<s-disk-states>>).  Then there's a line for this volume giving a bit of statistics - data `received`, `sent`, `out-of-sync`, etc; please see <<s-performance-indicators>> and <<s-conn-info>> for more information.
zh: 下一个重要的行以 `volume` 规范开始；这些规范通常以零开始编号，但配置也可能指定其他id。此行显示 `replication` 项中的 indexterm:[connection state] 连接状态。（有关详细信息，请参见<<s-connection-states>>）和 `disk` 磁盘中的远程 indexterm:[disk state] 磁盘状态（请参见<<s-disk-states>>）。还有一行是这个卷的，它提供了一些统计信息 - 数据 `已接收` 、`已发送`  、`未同步` 等；有关详细信息，请参见<<s-performance-indicators>>和<<s-conn-info>>。

note: type: Plain text
en: For the local node the first line shows the resource name, _home_, in our example. As the first block always describes the local node, there is no _Connection_ or address information.
zh: 对于本地节点，在我们的示例中，第一行显示资源名 `home` 。由于第一个块始终描述本地节点，因此没有连接或地址信息。

note: type: Plain text
en: please see the `drbd.conf` manual page for more information.
zh: 有关详细信息，请参阅 `drbd.conf` 手册页。

note: type: Plain text
en: The other four lines in this example form a block that is repeated for every DRBD device configured, prefixed by the device minor number. In this case, this is `0`, corresponding to the device `/dev/drbd0`.
zh: 本例中的其他四行组成一个块，对每个配置的DRBD设备重复该块，前缀为设备次要编号。在本例中，这是 `0` ，对应于设备 `/dev/drbd0` 。

note: type: Plain text
en: The resource-specific output contains various pieces of information about the resource:
zh: 特定于资源的输出包含有关资源的各种信息：

note: //FIXME .Replication protocol The Replication protocol used by the resource. Either `A`, `B`, or `C`. See <<s-replication-protocols>> for details. type: Title ====
en: One-shot or realtime monitoring via `drbdsetup events2`
zh: 通过 `drbdsetup events2` 进行单次或实时监视`

note: and 8.4.6 type: Plain text
en: This is available only with userspace versions 8.9.3 and up.
zh: 这仅适用于8.9.3及更高版本的用户空间。

note: type: Plain text
en: This is a low-level mechanism to get information out of DRBD, suitable for use in automated tools, like monitoring.
zh: 这是一种从DRBD中获取信息的底层机制，适用于自动化工具，如监视。

note: type: Plain text
en: In its simplest invocation, showing only the current status, the output looks like this (but, when running on a terminal, will include colors):
zh: 在最简单的调用中，仅显示当前状态，输出如下所示（但是，在终端上运行时，将包括颜色）：

note: type: Plain text
en: Without the ''--now'', the process will keep running, and send continuous updates like this:
zh: 如果没有 ''--now'' ，进程将继续运行，并发送连续更新，如下所示：

note: type: Plain text
en: Then, for monitoring purposes, there's another argument ''--statistics'', that will produce some performance counters and other facts:
zh: 然后，出于监控的目的，还有另一个参数 ''--statistics''，它将生成一些性能计数器和其他指标：

note: type: Plain text
en: 'drbdsetup' **verbose output** (lines broken for readability):
zh: `drbdsetup` **verbose output**（为可读性而换行输出）：

note: type: Plain text
en: You might also like the ''--timestamp'' parameter.
zh: 您可能还喜欢 ''--timestamp''  参数。

note: type: Title ====
en: Connection states
zh: 连接状态

note: type: Plain text
en: indexterm:[drbdadm, cstate]indexterm:[connection state, via drbdadm]A resource's connection state can be observed either by issuing the `drbdadm cstate` command:
zh: indexterm:[drbdadm, cstate]indexterm:[connection state, via drbdadm]可以通过调用 `drbdadm cstate` 命令来观察资源的连接状态：

note: type: Plain text
en: If you are interested in only a single connection of a resource, specify the connection name, too:
zh: 如果只对资源的单个连接感兴趣，请指定连接名称：

note: type: Plain text
en: The default is the peer's hostname as given in the configuration file.
zh: 默认值是配置文件中给定的节点主机名。

note: type: Plain text
en: A resource may have one of the following connection states:
zh: 资源可能具有以下连接状态之一：

note: type: Plain text
en: indexterm:[connection state, StandAlone]No network configuration available. The resource has not yet been connected, or has been administratively disconnected (using `drbdadm disconnect`), or has dropped its connection due to failed authentication or split brain.
zh: indexterm:[connection state, StandAlone]没有可用的网络配置。资源尚未连接，或者已被管理性断开（使用 `drbdadm disconnect` ），或者由于身份验证失败或脑裂而断开其连接。

note: type: Plain text
en: indexterm:[connection state, Disconnecting]Temporary state during disconnection. The next state is _StandAlone_.
zh: indexterm:[connection state, Disconnecting]断开连接期间的临时状态。下一个状态是 _StandAlone_。

note: type: Plain text
en: indexterm:[connection state, Unconnected]Temporary state, prior to a connection attempt. Possible next states: _Connecting_.
zh: indexterm:[connection state, Unconnected]临时状态，在尝试连接之前。可能的下一个状态： _Connecting_。

note: type: Plain text
en: indexterm:[connection state, Timeout]Temporary state following a timeout in the communication with the peer. Next state: _Unconnected_.
zh: indexterm:[connection state, Timeout]与对等方通信超时后的临时状态。下一个状态：_Unconnected_。

note: type: Plain text
en: indexterm:[connection state, BrokenPipe]Temporary state after the connection to the peer was lost. Next state: _Unconnected_.
zh: indexterm:[connection state, BrokenPipe]与对等方的连接丢失后的临时状态。下一个状态： _Unconnected_ 。

note: type: Plain text
en: indexterm:[connection state, NetworkFailure]Temporary state after the connection to the partner was lost. Next state: _Unconnected_.
zh: indexterm:[connection, state, NetworkFailure]与伙伴的连接丢失后的临时状态。下一个状态： _Unconnected_。

note: type: Plain text
en: indexterm:[connection state, ProtocolError]Temporary state after the connection to the partner was lost. Next state: _Unconnected_.
zh: indexterm:[connection state, ProtocolError]与伙伴的连接丢失后的临时状态。下一个状态：_Unconnected_。

note: type: Plain text
en: indexterm:[connection state, TearDown]Temporary state. The peer is closing the connection. Next state: _Unconnected_.
zh: indexterm:[connection state, TearDown]临时状态。对等方正在关闭连接。下一个状态： _Unconnected_。

note: type: Plain text
en: indexterm:[connection state, Connecting]This node is waiting until the peer node becomes visible on the network.
zh: indexterm:[connection state, Connecting]此节点正在等待，直到对等节点在网络上变为可见。

note: type: Plain text
en: indexterm:[connection state, Connected]A DRBD connection has been established, data mirroring is now active. This is the normal state.
zh: indexterm:[connection state, Connected]已建立DRBD连接，数据镜像现在处于活动状态。这是正常状态。

note: type: Title ====
en: Replication states
zh: 复制状态

note: type: Plain text
en: Each volume has over each connection a replication state. The possible replication states are:
zh: 每个卷在每个连接上都有一个复制状态。可能的复制状态是：

note: type: Plain text
en: indexterm:[replication state, Off]The volume is not replicated over this connection, since the connection is not _Connected_.
zh: indexterm:[replication state, Off]由于连接未连接，因此卷未通过此连接进行复制。

note: type: Plain text
en: indexterm:[replication state, Established]All writes to that volume are replicated online. This is the normal state.
zh: indexterm:[replication state, Established]对该卷的所有写入都将在线复制。这是正常状态。

note: type: Plain text
en: indexterm:[replication state, StartingSyncS]Full synchronization, initiated by the administrator, is just starting. The next possible states are: _SyncSource_ or _PausedSyncS_.
zh: indexterm:[replication state, StartingSyncS]由管理员启动的完全同步正在启动。下一个可能的状态是： _SyncSource_ 或 _PausedSyncS_ 。

note: type: Plain text
en: indexterm:[replication state, StartingSyncT]Full synchronization, initiated by the administrator, is just starting. Next state: _WFSyncUUID_.
zh: indexterm:[replication state, StartingSyncT]由管理员启动的完全同步正在启动。下一个状态：_WFSyncUUID_。

note: type: Plain text
en: indexterm:[replication state, WFBitMapS]Partial synchronization is just starting. Next possible states: _SyncSource_ or _PausedSyncS_.
zh: indexterm:[replication state, WFBitMapS]部分同步刚刚开始。下一个可能的状态：_SyncSource_或_PausedSyncS_。

note: type: Plain text
en: indexterm:[replication state, WFBitMapT]Partial synchronization is just starting. Next possible state: _WFSyncUUID_.
zh: indexterm:[replication state, WFBitMapT]部分同步刚刚开始。下一个可能的状态：_WFSyncUUID_。

note: type: Plain text
en: indexterm:[replication state, WFSyncUUID]Synchronization is about to begin. Next possible states: _SyncTarget_ or _PausedSyncT_.
zh: indexterm:[replication state, WFSyncUUID]同步即将开始。下一个可能的状态：_SyncTarget_或_PausedSyncT_。

note: type: Plain text
en: indexterm:[replication state, SyncSource]Synchronization is currently running, with the local node being the source of synchronization.
zh: indexterm:[replication state, SyncSource]同步当前正在运行，本地节点是同步源。

note: type: Plain text
en: indexterm:[replication state, SyncTarget]Synchronization is currently running, with the local node being the target of synchronization.
zh: indexterm:[replication state, SyncTarget]同步当前正在运行，本地节点是同步的目标。

note: type: Plain text
en: indexterm:[replication state, PausedSyncS]The local node is the source of an ongoing synchronization, but synchronization is currently paused. This may be due to a dependency on the completion of another synchronization process, or due to synchronization having been manually interrupted by `drbdadm pause-sync`.
zh: indexterm:[replication, state, PausedSyncS]本地节点是正在进行的同步的源，但同步当前已暂停。这可能是由于依赖于另一个同步进程的完成，或者是由于同步已被 `drbdadm pause sync` 手动中断。

note: type: Plain text
en: indexterm:[replication state, PausedSyncT]The local node is the target of an ongoing synchronization, but synchronization is currently paused. This may be due to a dependency on the completion of another synchronization process, or due to synchronization having been manually interrupted by `drbdadm pause-sync`.
zh: indexterm:[replication state, PausedSyncT]本地节点是正在进行的同步的目标，但同步当前已暂停。这可能是由于依赖于另一个同步进程的完成，或者是由于同步已被 `drbdadm pause sync` 手动中断。

note: type: Plain text
en: indexterm:[replication state, VerifyS]On-line device verification is currently running, with the local node being the source of verification.
zh: indexterm:[replication state, VerifyS]联机设备验证当前正在运行，本地节点是验证源。

note: type: Plain text
en: indexterm:[replication state, VerifyT]On-line device verification is currently running, with the local node being the target of verification.
zh: indexterm:[replicateion state, VerifyT]联机设备验证当前正在运行，本地节点是验证的目标。

note: type: Plain text
en: indexterm:[replication state, Ahead]Data replication was suspended, since the link can not cope with the load. This state is enabled by the configuration `on-congestion` optione (see <<s-configure-congestion-policy>>).
zh: indexterm:[replication state, Ahead]数据复制被挂起，因为链接无法处理负载。此状态因节点上的配置 `on-congestion` 选项启用 (参考 <<s-configure-congestion-policy>>).

note: type: Plain text
en: indexterm:[replication state, Behind]Data replication was suspended by the peer, since the link can not cope with the load. This state is enabled by the configuration `on-congestion` option on the peer node (see <<s-configure-congestion-policy>>).
zh: indexterm:[replication state, Behind]数据复制被对等方挂起，因为链接无法处理负载。此状态由对等节点上的配置 `on-congestion` 选项启用（请参见<<s-configure-congestion-policy>>）。

note: type: Title ====
en: Resource roles
zh: 资源角色

note: type: Plain text
en: indexterm:[resource]A resource's role can be observed by issuing the indexterm:[drbdadm, role]`drbdadm role` command:
zh: indexterm:[resource]可以通过调用indexterm:[drbdadm, role] `drbdadm role` 命令来观察资源的角色：

note: type: Plain text
en: You may see one of the following resource roles:
zh: 您可以看到以下资源角色之一：

note: type: Plain text
en: indexterm:[role, Primary]The resource is currently in the primary role, and may be read from and written to. This role only occurs on one of the two nodes, unless <<s-dual-primary-mode,dual-primary mode>> is enabled.
zh: indexterm:[role, Primary]资源当前处于主角色中，可以读取和写入。此角色仅在两个节点中的一个节点上发生，除非启用了<<s-dual-primary-mode,dual-primary mode>>。

note: type: Plain text
en: indexterm:[role, Secondary]The resource is currently in the secondary role. It normally receives updates from its peer (unless running in disconnected mode), but may neither be read from nor written to. This role may occur on one or both nodes.
zh: indexterm:[role, Secondary]资源当前处于辅助角色中。它通常从其对等方接收更新（除非在断开连接模式下运行），但既不能读取也不能写入。此角色可能出现在一个或两个节点上。

note: type: Plain text
en: indexterm:[role, Unknown]The resource's role is currently unknown. The local resource role never has this status. It is only displayed for the peer's resource role, and only in disconnected mode.
zh: indexterm:[role, Unknown]资源的角色当前未知。本地资源角色从未具有此状态。它仅为对等方的资源角色显示，并且仅在断开连接模式下显示。

note: type: Title ====
en: Disk states
zh: 磁盘状态

note: type: Plain text
en: A resource's disk state can be observed either by issuing the `drbdadm dstate` command:
zh: 可以通过调用 `drbdadm dstate` 命令来观察资源的磁盘状态：

note: type: Plain text
en: The disk state may be one of the following:
zh: 磁盘状态可以是以下之一：

note: type: Plain text
en: indexterm:[disk state, Diskless]No local block device has been assigned to the DRBD driver. This may mean that the resource has never attached to its backing device, that it has been manually detached using `drbdadm detach`, or that it automatically detached after a lower-level I/O error.
zh: indexterm:[disk state, Diskless]没有为DRBD驱动程序分配本地块设备。这可能意味着资源从未连接到其备份设备，它已使用 `drbdadm detach` 手动分离，或者在发生较低级别的I/O错误后自动分离。

note: type: Plain text
en: indexterm:[disk state, Attaching]Transient state while reading meta data.
zh: indexterm:[disk state, Attaching]读取元数据时的临时状态。

note: type: Plain text
en: indexterm:[disk state, Detaching]Transient state while detaching and waiting for ongoing IOs to complete.
zh: indexterm:[disk state, Detaching]在分离并等待正在进行的IOs完成时的临时状态。

note: type: Plain text
en: indexterm:[disk state, Failed]Transient state following an I/O failure report by the local block device. Next state: _Diskless_.
zh: indexterm:[disk state, Failed]本地块设备报告I/O失败后的瞬态。下一个状态：_Diskless_。

note: type: Plain text
en: indexterm:[disk state, Negotiating]Transient state when an _Attach_ is carried out on an already-__Connected__ DRBD device.
zh: indexterm:[disk state, Negotiating]在 已经__Connected__ 的DRBD设备上执行附加操作时的瞬态。

note: type: Plain text
en: indexterm:[disk state, Inconsistent]The data is inconsistent. This status occurs immediately upon creation of a new resource, on both nodes (before the initial full sync). Also, this status is found in one node (the synchronization target) during synchronization.
zh: indexterm:[disk state, Inconsistent]数据不一致。在两个节点上（在初始完全同步之前）创建新资源时立即出现此状态。此外，在同步期间，在一个节点（同步目标）中可以找到此状态。

note: type: Plain text
en: indexterm:[disk state, Outdated]Resource data is consistent, but <<s-outdate,outdated>>.
zh: indexterm:[disk state, Outdated]资源数据一致，但<<s-outdate,outdated>>。

note: type: Plain text
en: indexterm:[disk state, DUnknown]This state is used for the peer disk if no network connection is available.
zh: indexterm:[disk state, DUnknown]如果没有可用的网络连接，则此状态用于对等磁盘。

note: type: Plain text
en: indexterm:[disk state, Consistent]Consistent data of a node without connection. When the connection is established, it is decided whether the data is _UpToDate_ or _Outdated_.
zh: indexterm:[disk state, Consistent]没有连接的节点的一致数据。建立连接后，决定数据是 _UpToDate_ 还是 _Outdated_。

note: type: Plain text
en: indexterm:[disk state, UpToDate]Consistent, up-to-date state of the data. This is the normal state.
zh: indexterm:[disk state, UpToDate_]数据的一致、最新状态。这是正常状态。

note: type: Title ====
en: Connection information data
zh: 连接信息数据

note: type: Plain text
en: Shows the network family, the local address and port that is used to accept connections from the peer.
zh: 显示网络协议栈、用于接受来自对等方的连接的本地地址和端口。

note: type: Plain text
en: Shows the network family, the peer address and port that is used to connect.
zh: 显示网络协议栈、对等方节点地址和用于连接的端口。

note: type: Plain text
en: This flag tells whether the TCP send buffer of the data connection is more than 80% filled.
zh: 此标志指示数据连接的TCP发送缓冲区是否已填充80%以上。

note: type: Title ====
en: Performance indicators
zh: 性能指标

note: type: Plain text
en: indexterm:[performance indicators] One line of ``drbdadm status``-output includes the following counters and gauges:
zh: indexterm:[performance indicators]一行 `drbdadm status` - 输出包括以下计数器和仪表：

note: type: Plain text
en: Volume of net data sent to the partner via the network connection; in Kibyte.
zh: 通过网络连接发送给伙伴的网络数据量；单位为千字节。

note: type: Plain text
en: Volume of net data received by the partner via the network connection; in Kibyte.
zh: 伙伴通过网络连接接收的网络数据量；单位为千字节。

note: type: Plain text
en: Net data written on local hard disk; in Kibyte.
zh: 写在本地硬盘上的网络数据；以千字节为单位。

note: type: Plain text
en: Net data read from local hard disk; in Kibyte.
zh: 从本地硬盘读取的网络数据；单位为千字节。

note: type: Plain text
en: Number of updates of the activity log area of the meta data.
zh: 元数据活动日志区域的更新次数。

note: type: Plain text
en: Number of updates of the bitmap area of the meta data.
zh: 元数据位图区域的更新次数。

note: type: Plain text
en: Number of open requests to the local I/O sub-system issued by DRBD.
zh: DRBD向本地I/O子系统发出的打开请求数。

note: type: Plain text
en: Number of requests sent to the partner, but that have not yet been answered by the latter.
zh: 发送给合作伙伴但尚未由后者应答的请求数。

note: type: Plain text
en: Number of requests received by the partner via the network connection, but that have not yet been answered.
zh: 伙伴通过网络连接接收但尚未应答的请求数。

note: type: Plain text
en: Number of block I/O requests forwarded to DRBD, but not yet answered by DRBD.
zh: 转发给DRBD但尚未由DRBD应答的块I/O请求数。

note: type: Plain text
en: Currently used write ordering method: __b__(barrier), __f__(flush), __d__(drain) or __n__(none).
zh: 当前使用的写排序方法__b__(barrier), __f__(flush), __d__(drain) 或者 __n__(none).

note: type: Plain text
en: indexterm:[out-of-sync]indexterm:[oos]Amount of storage currently out of sync; in Kibibytes.
zh: indexterm:[out-of-sync]indexterm:[oos]当前不同步的存储量；单位为千字节。

note: type: Plain text
en: Whether the resynchronization is currently suspended or not. Possible values are _no_, _user_, _peer_, _dependency_.
zh: 重新同步是否当前挂起。可能的值是: _no_, _user_, _peer_, _dependency_.

note: type: Plain text
en: indexterm:[blocked]Shows local I/O congestion.
zh: indexterm:[blocked]显示本地I/O拥塞。

note: type: Plain text
en: _upper_: I/O _above_ the DRBD device is blocked, i.e. to the filesystem. Typical causes are
zh: _上面的_ I/O设备被阻塞，即文件系统。典型的原因是

note: type: Plain text
en: I/O suspension by the administrator, see the `suspend-io` command in `drbdadm`.
zh: 由管理员暂停I/O，请参阅 `drbdadm` 中的 `suspend-io` 命令。

note: type: Plain text
en: buffers depleted, see <<p-performance>>
zh: 缓冲区耗尽，请参见<<p-performance>>

note: type: Plain text
en: It's possible to see a value of _upper,lower_, too.
zh: 也有可能看到一个值 _upper，lower_。

note: type: Title ===
en: Enabling and disabling resources
zh: 启用和禁用资源

note: type: Title ====
en: Enabling resources
zh: 使能资源

note: type: Plain text
en: indexterm:[resource]Normally, all configured DRBD resources are automatically enabled
zh: indexterm:[resource]通常，所有配置的DRBD资源都会自动启用

note: type: Plain text
en: by a cluster resource management application at its discretion, based on your cluster configuration, or
zh: 由群集资源管理应用程序根据您的群集配置自行决定，或

note: type: Plain text
en: by the `/etc/init.d/drbd` init script on system startup.
zh: 在系统启动时通过 `/etc/init.d/drbd` init脚本。

note: type: Plain text
en: If, however, you need to enable resources manually for any reason, you may do so by issuing the command
zh: 但是，如果出于任何原因需要手动启用资源，可以通过调用命令

note: type: Plain text
en: As always, you may use the keyword `all` instead of a specific resource name if you want to enable all resources configured in `/etc/drbd.conf` at once.
zh: 与往常一样，如果要同时启用在 `/etc/drbd.conf` 中配置的所有资源，可以使用关键字 `all` 而不是特定的资源名。

note: type: Title ====
en: Disabling resources
zh: 禁用资源

note: type: Plain text
en: indexterm:[resource]You may temporarily disable specific resources by issuing the command
zh: indexterm:[resource]您可以通过调用命令暂时禁用特定资源

note: type: Plain text
en: Here, too, you may use the keyword `all` in place of a resource name if you wish to temporarily disable all resources listed in `/etc/drbd.conf` at once.
zh: 在这里，如果您希望一次临时禁用 `/etc/drbd.conf` 中列出的所有资源，也可以使用关键字 `all` 代替资源名。

note: type: Title ===
en: Reconfiguring resources
zh: 重新配置资源

note: type: Plain text
en: indexterm:[resource]DRBD allows you to reconfigure resources while they are operational. To that end,
zh: indexterm:[resource]DRBD允许您在资源运行时重新配置它们。包括,

note: type: Plain text
en: make any necessary changes to the resource configuration in `/etc/drbd.conf`,
zh: 对 `/etc/drbd.conf` 中的资源配置需要进行任何必要的更改,

note: type: Plain text
en: synchronize your `/etc/drbd.conf` file between both nodes,
zh: 在两个节点之间同步 `/etc/drbd.conf` 文件,

note: type: Plain text
en: issue the indexterm:[drbdadm, adjust]`drbdadm adjust <resource>` command on both nodes.
zh: 在两个节点上发出indexterm:[drbdadm，adjust] `drbdadm adjust<resource>` 命令。

note: type: Plain text
en: `drbdadm adjust` then hands off to `drbdsetup` to make the necessary adjustments to the configuration. As always, you are able to review the pending `drbdsetup` invocations by running `drbdadm` with the `-d` (dry-run) option.
zh: `drbdadm adjust` 然后切换到 `drbdsetup` 对配置进行必要的调整。与往常一样，您可以通过使用 `-d` （dry-run）选项运行 `drbdadm` 来查看挂起的 `drbdsetup` 调用。

note: type: Plain text
en: When making changes to the `common` section in `/etc/drbd.conf`, you can adjust the configuration for all resources in one run, by issuing `drbdadm adjust all`.
zh: 对 `/etc/drbd.conf` 中的 `common` 部分进行更改时，可以通过发出 `drbdadm adjust all` 来调整一次运行中所有资源的配置。

note: type: Title ===
en: Promoting and demoting resources
zh: 提升和降级资源

note: type: Plain text
en: indexterm:[resource]Manually switching a <<s-resource-roles,resource's role>> from secondary to primary (promotion) or vice versa (demotion)  is done using one of the following commands:
zh: indexterm:[resource]使用以下命令之一手动将a<<s-resource-roles,resource's role>>从次要角色切换到主要角色（提升）或反之亦然（降级）：

note: type: Plain text
en: In <<s-single-primary-mode,single-primary mode>> (DRBD's default), any resource can be in the primary role on only one node at any given time while the <<s-connection-states,connection state>> is _Connected_. Thus, issuing `drbdadm primary <resource>` on one node while the specified resource is still in the primary role on another node will result in an error.
zh: 在<<s-single-primary-mode,single-primary mode>>（DRBD的默认设置）中，任何资源在任何给定时间只能在一个节点上处于主要角色，而<<s-connection-states,connection state>>是连接的。因此，在一个节点上发出 `drbdadm primary<resource>` ，而该指定的资源是在另一个节点上的primary角色, 将导致错误。

note: type: Plain text
en: A resource configured to allow <<s-dual-primary-mode,dual-primary mode>> can be switched to the primary role on two nodes; this is e.g. needed for online migration of virtual machines.
zh: 配置为允许<<s-dual-primary-mode,dual-primary mode>>的资源可以切换到两个节点上的主要角色；这是虚拟机在线迁移所必需的。

note: type: Title ===
en: Basic Manual Fail-over
zh: 基本手动故障切换

note: type: Plain text
en: If not using Pacemaker and looking to handle fail-overs manually in a passive/active configuration, the process is as follows.
zh: 如果不使用Pacemaker并希望在被动/主动配置中手动处理故障转移，则过程如下。

note: type: Plain text
en: On the current primary node stop any applications or services using the DRBD device, unmount the DRBD device, and demote the resource to secondary.
zh: 在当前主节点上，停止使用DRBD设备的任何应用程序或服务，卸载DRBD设备，并将资源降级为次要资源。

note: type: Plain text
en: Now on the node we wish to make primary promote the resource and mount the device.
zh: 现在登录到想提升为primary的节点上，升级资源并装载设备。

note: type: Plain text
en: If you're using the `auto-promote` feature, you don't need to change the roles (_Primary_/_Secondary_) manually; only stopping of the services and umounting, respectively mounting, is necessary.
zh: 如果您使用的是 `自动升级` 功能，则不需要手动更改角色（ _Primary_/_Secondary_ ）；只需要停止服务和及调用mounting/umounting。

note: type: Title ===
en: Upgrading DRBD
zh: 升级DRBD

note: type: Plain text
en: Upgrading DRBD is a fairly simple process. This section will cover the process of upgrading from 8.4.x to 9.0.x in great detail; for within-9 upgrades it gets to be much easier, see the short version <<s-upgrade-within-9,below>>.
zh: 升级DRBD是一个相当简单的过程。本节将详细介绍从8.4.x升级到9.0.x的过程；对于9版本内升级，它变得更加容易，请参见下面的简短版本<<s-upgrade-within-9>>。

note: type: Title ====
en: General overview
zh: 概述

note: type: Plain text
en: The general process for upgrading 8.4 to 9.0 is as follows:
zh: 将8.4升级到9.0的一般过程如下：

note: type: Plain text
en: Configure the <<s-updating-your-repo,new repositories>> (if using packages from LINBIT)
zh: 配置<<s-updating-your-repo,新仓库>>（如果使用来自LINBIT的包）

note: type: Plain text
en: Make sure that the current situation <<s-upgrade-check,is okay>>
zh: 确保当前情况<<s-upgrade-check, 检查良好>>

note: type: Plain text
en: <<s-upgrade-pausing-the-cluster,Pause>> any cluster manager
zh: <<s-upgrade-pausing-the-cluster,Pause>>任何群集管理器

note: type: Plain text
en: Get <<s-Upgrading-the-packages,new versions>> installed
zh: 安装<<s-Upgrading-the-packages,新版本>>

note: type: Plain text
en: If wanting to move to more than 2 nodes, then you'll need to resize the lower-level storage to provide room for the additional meta-data; this topic is discussed in the <<ch-lvm,LVM Chapter>>.
zh: 如果要移动到2个以上的节点，则需要调整较低级别的存储空间，以便为其他元数据提供空间；本主题将在<<ch-lvm,LVM Chapter>>中讨论。

note: type: Plain text
en: Deconfigure resources, unload DRBD 8.4, and <<s-upgrade-reload-kernel-mod,load the v9 kernel module>>
zh: 取消配置资源，卸载DRBD 8.4，然后<<s-upgrade-reload-kernel-mod,load the v9 kernel module>>

note: type: Plain text
en: <<s-upgrade-convert,Convert DRBD meta-data>> to format `v09`, perhaps changing the number of bitmaps in the same step
zh: <<s-upgrade-convert,Convert DRBD meta-data>>格式为 `v09` ，可能在同一步骤中需要更改位图的数量

note: type: Plain text
en: Take the DRBD <<s-upgrade-start-drbd,resources up>>, and be happy
zh: 启动新版本DRBD<<s-upgrade-start-drbd,resources up>>

note: type: Title ====
en: Updating your repository
zh: 更新仓库

note: type: Plain text
en: Due to the number of changes between the 8.4 and 9.0 branches we have created separate repositories for each. Perform this repository update on both servers.
zh: 由于8.4和9.0分支之间的更改众多，我们为每个分支创建了单独的仓库。在两台服务器上执行此仓库更新。

note: type: Title =====
en: RHEL/CentOS systems
zh: RHEL/CentOS系统

note: type: Plain text
en: Edit your `/etc/yum.repos.d/linbit.repo` file to reflect the following changes.
zh: 编辑 `/etc/yum.repos.d/linbit.repo` 文件。

note: type: Plain text
en: You will have to populate the <hash> and <arch> variables. The <hash> is provided by LINBIT support services.
zh: 必须填充<hash>和<arch>变量。<hash>由LINBIT支持服务提供。

note: type: Title =====
en: Debian/Ubuntu systems
zh: Debian/Ubuntu系统

note: type: Plain text
en: Edit `/etc/apt/sources.list` (or a file in `/etc/apt/sources.d/`) to reflect the following changes.
zh: 编辑 `/etc/apt/sources.list` （或 `/etc/apt/sources.d/` 中的文件）加入以下更改。

note: type: Plain text
en: In case you're not using the `stretch` release, but some other, you'll need to change that line.
zh: 如果您不使用 `stretch` 版本，而是使用其他版本，则需要更改到对应的版本名称。

note: type: Plain text
en: You will have to populate the `<hash>` variable. The `<hash>` is provided by LINBIT support services.
zh: 您必须填充 `<hash>` 变量。`<hash>` 由LINBIT支持服务提供。

note: type: Plain text
en: Next you will want to add the DRBD signing key to your trusted keys.
zh: 接下来，您需要将DRBD签名密钥添加到您的受信任密钥中。

note: type: Plain text
en: Lastly perform an `apt update` so Debian recognizes the updated repository.
zh: 最后执行 `apt update` ，以便Debian识别更新的存储库。

note: type: Title ====
en: Checking the DRBD state
zh: 检查DRBD状态

note: type: Plain text
en: Before you begin make sure your resources are in sync. The output of `cat /proc/drbd` (which is only available _before_ 9.0) should show _UpToDate/UpToDate_.
zh: 在开始之前，请确保资源同步。`cat/proc/drbd` 的输出（仅在9.0之前可用）应显示  _UpToDate/UpToDate_ 。

note: type: Title ====
en: Pausing the cluster
zh: 暂停群集

note: type: Plain text
en: Now that you know the resources are in sync, start by upgrading the secondary node. This can be done manually or if you're using Pacemaker put the node in standby mode. Both processes are covered below.  If you're running Pacemaker do not use the manual method.
zh: 既然您知道资源是同步的，就从升级辅助节点开始。这可以手动完成，或者如果您正在使用Pacemaker，请将节点置于待机模式。下面将介绍这两个过程。如果你正在运行Pacemaker，不要使用手动方法。

note: type: Plain text
en: Manual Method
zh: 手动方法

note: type: Plain text
en: Put the secondary node into standby mode. In this example 'bob' is secondary.
zh: 将辅助节点置于待机模式。在本例中，`bob` 是辅助节点。

note: type: Plain text
en: You can watch the status of your cluster using `crm_mon -rf` or watch `cat /proc/drbd` until it shows _Unconfigured_ for your resources.
zh: 您可以使用 `crm-mon-rf` 或 `cat/proc/drbd` 监视群集的状态，直到它显示您的资源为 `未配置` 。

note: type: Title ====
en: Upgrading the packages
zh: 升级包

note: type: Plain text
en: Now update your packages with either yum or apt.
zh: 现在用yum或apt更新包。

note: type: Plain text
en: Once the upgrade is finished will now have the latest DRBD 9.0 kernel module and drbd-utils installed on your secondary node, 'bob'.
zh: 升级完成后，将在次节点 `bob` 上安装最新的DRBD 9.0内核模块和DRBD实用程序。

note: type: Plain text
en: But the kernel module is not active yet.
zh: 但是内核模块还没有激活。

note: type: Title ====
en: Loading the new Kernel module
zh: 加载新的内核模块

note: type: Plain text
en: By now the DRBD module should not be in use anymore, so we unload it via
zh: 现在旧的DRBD内核模块不应该再使用了，所以我们通过

note: type: Plain text
en: If there's a message like `ERROR: Module drbd is in use`, then not all resources have been correctly stopped yet. + Retry <<s-upgrading-drbd>>, and/or run the command `drbdadm down all` to find out which resources are still active.
zh: 如果出现类似 `ERROR:Module drbd is in use` （错误：模块drbd正在使用）的消息，则并非所有资源都已正确停止。+ 重试<<s-upgrading-drbd>>，和/或运行命令 `drbdadm down all` 以确定哪些资源仍处于活动状态。

note: type: Plain text
en: Typical issues that might prevent unloading are these:
zh: 可能阻止卸载的典型问题有：

note: type: Plain text
en: NFS export on a DRBD-backed filesystem (see `exportfs -v` output)
zh: 在DRBD支持的文件系统上有导出NFS的操作（参见 `exportfs -v` 输出）

note: type: Plain text
en: Filesystem still mounted - check `grep drbd /proc/mounts`
zh: 文件系统仍在安装-检查 `grep drbd/proc/mounts`

note: type: Plain text
en: Loopback device active (`losetup -l`)
zh: Loopback 设备仍然处于活动状态（ `losetup -l` ）

note: type: Plain text
en: Device mapper using DRBD, directly or indirectly (`dmsetup ls --tree`)
zh: 直接或间接使用DRBD的device mapper（ `dmsetup ls --tree` ）

note: type: Plain text
en: LVM with a DRBD-PV (`pvs`)
zh: 有带DRBD-PV的LVM（`pvs`）

note: type: Plain text
en: Please note that this list isn't complete - these are just the most common examples.
zh: 请注意，这个列表并不完整 - 这些只是最常见的例子。

note: type: Plain text
en: Now we can load the new DRBD module:
zh: 现在我们可以加载新的DRBD内核模块：

note: type: Plain text
en: Now you should check the contents of `/proc/drbd` and verify that the correct (new) version is loaded; if the installed packages is for the wrong kernel version, the `modprobe` would be successful, but you'd be left with the old version being active again.
zh: 现在您应该检查 `/proc/drbd` 的内容，并验证是否加载了正确的（新的）版本；如果安装的软件包的内核版本不正确，`modprobe` 也会成功，但旧版本将再次处于活动状态。

note: type: Plain text
en: The output of `cat /proc/drbd` should now show 9.0.x and look similar to this.
zh: `cat /proc/drbd` 的输出现在应该显示为9.0.x，看起来与此类似。

note: type: Plain text
en: On the primary node, alice, 'cat /proc/drbd' will still show the prior version, until you upgrade it.
zh: 在主节点，alice上, `cat /proc/drbd` 将仍然显示先前的版本，直到您升级它。

note: At this point the cluster is running two different versions of DRBD. While this is not recommended to be used for longer time spans, it is inevitable for the (short) upgrade period. Stop any service using DRBD and then DRBD on the primary node, alice, and promote 'bob'. Again this can be done either
en: Migrating your configuration files
zh: 迁移配置文件

note: type: Plain text
en: DRBD 9.0 is backward compatible with the 8.4 configuration files; however, some syntax has changed. See <<s-recent-changes-config>> for a full list of changes. In the meantime you can port your old configs fairly easily by using 'drbdadm dump all' command. This will output both a new global config followed by the new resource config files. Take this output and make changes accordingly.
zh: DRBD 9.0与8.4配置文件向后兼容；但是，某些语法已更改。有关更改的完整列表，请参见<<s-recent-changes-config>>。同时，您可以使用`drbdadm dump all` 命令轻松移植旧配置。这将输出一个新的全局配置和一个新的资源配置文件。获取此输出并相应地进行更改。

note: type: Title ====
en: Changing the meta-data
zh: 更改元数据

note: type: Plain text
en: Now you need to convert the on-disk metadata to the new version; this is really easy, it's just running one command and acknowledging two questions.
zh: 现在您需要将磁盘上的元数据转换为新版本；这非常简单，只需运行一个命令并确认两个问题。

note: type: Plain text
en: If you want to change the number of nodes, you should already have increased the size of the lower level device, so that there is enough space to store the additional bitmaps; in that case, you'd run the command below with an additional argument `--max-peers=__<N>__`. When determining the number of (possible) peers please take setups like the <<s-drbd-client>> into account.
zh: 如果要更改节点数，您应该已经增加了底层设备的大小，以便有足够的空间存储增加的位图；在这种情况下，您将使用附加参数 `--max peers=__<N>__` 。当需要确定(可能的)节点个数时，请参考 <<s-drbd-client> 做相应的配置。

note: type: Plain text
en: Upgrading the DRBD metadata is as easy as running one command, and acknowledging the two questions:
zh: 升级DRBD元数据只需运行一个命令并确认两个问题：

note: type: Plain text
en: Of course, you can pass `all` for the resource names, too; and if you feel really lucky, you can avoid the questions via a commandline like this here, too. (Yes, the order is important.)
zh: 当然，您也可以传递 `all` 作为资源名；如果您感到自己是个幸运儿，也可以通过如下这样的命令行来避免在运行过程中回答问题。（注意，顺序很重要。）

note: type: Title ====
en: Starting DRBD again
zh: 重新启动DRBD

note: type: Plain text
en: Now, the only thing left to do is to get the DRBD devices up and running again - a simple `drbdadm up all` should do the trick.
zh: 现在，唯一要做的就是让DRBD设备重新启动并再次运行- 一个简单的命令 `drbdadm up all` 应该能做到这一点。

note: type: Plain text
en: Now, depending on whether you've got a cluster manager or keep track of your resources manually, there are two different ways again.
zh: 现在，根据您是否有集群管理器或手动跟踪资源，又有两种不同的方法。

note: type: Plain text
en: Manually
zh: 手动

note: type: Plain text
en: This should make DRBD connect to the other node, and the resynchronization process will start.
zh: 这将使DRBD连接到另一个节点，并且重新同步过程将启动。

note: type: Plain text
en: When the two nodes are _UpToDate_ on all resources again, you can move your applications to the already upgraded node (here 'bob'), and then follow the same steps on the cluster node still running 8.4.
zh: 当所有资源上的两个节点都是 _UpToDate_ 时，您可以将应用程序移动到已升级的节点（此处为 `bob` ），然后在仍在运行8.4的群集节点上执行相同的步骤。

note: type: Title ====
en: From DRBD 9 to DRBD 9
zh: 从DRBD 9到DRBD 9

note: type: Plain text
en: If you are already running 9.0, it is sufficient to <<s-Upgrading-the-packages,install new package versions>>, make the cluster node <<s-upgrade-pausing-the-cluster,_standby_>>, <<s-upgrade-reload-kernel-mod,unload/reload>> the kernel module, <<s-upgrade-start-drbd,start the resources>>, and make the cluster node _online_ againfootnote:[At least that's the state at the time of writing - that's how it has been in the past, and we want to keep it that easy. But who knows? Who can tell? ;)].
zh: 如果您已经在运行9.0，则只需<<s-Upgrading-the-packages,install new package versions>>，使群集节点<<s-upgrade-pausing-the-cluster,_standby_>>，<<s-upgrade-reload-kernel-mod,unload/reload>>内核模块，<<s-upgrade-start-drbd,start the resources>>，并使集群节点重新联机footnote:[至少这是编写时的状态-这是过去的情况，我们希望保持它的简单性。但谁知道呢？谁能讲明白呢？;)].

note: type: Plain text
en: These individual steps have been detailed above, so we won't repeat them here.
zh: 上面已经详细介绍了这些步骤，因此我们在这里不再重复。

note: type: Title ===
en: Enabling dual-primary mode
zh: 启用双主模式

note: type: Plain text
en: Dual-primary mode allows a resource to assume the primary role simultaneously on more than one node. Doing so is possible on either a permanent or a temporary basis.
zh: 双主模式允许资源在多个节点上同时承担主角色。这样做可以是永久性的，也可以是暂时性的。

note: type: delimited block =
en: Dual-primary mode requires that the resource is configured to replicate synchronously (protocol C). Because of this it is latency sensitive, and ill suited for WAN environments.
zh: 双主模式要求将资源配置为同步复制（protocol C）。因此，它对延迟敏感，不适合广域网环境。

note: type: delimited block =
en: Additionally, as both resources are always primary, any interruption in the network between nodes will result in a split-brain.
zh: 另外，由于这两种资源都是主要的，节点之间网络的任何中断都会导致脑裂。

note: type: Plain text
en: In DRBD 9.0.x Dual-Primary mode is limited to exactly 2 Primaries for the use in live migration.
zh: 在DRBD 9.0.x中，双主模式仅限于2个主节点，通常用于实时迁移。

note: type: Title ====
en: Permanent dual-primary mode
zh: 永久双主模式

note: type: Plain text
en: indexterm:[multiple primaries]indexterm:[dual-primary mode]To enable dual-primary mode, set the `allow-two-primaries` option to `yes` in the `net` section of your resource configuration:
zh: indexterm:[multiple primaries]indexterm:[dual primary mode]要启用双主模式，请在资源配置的 `net` 部分将 `allow two primaries` 选项设置为 `yes` ：

note: type: Plain text
en: After that, do not forget to synchronize the configuration between nodes. Run `drbdadm adjust _<resource>_` on both nodes.
zh: 之后，不要忘记同步节点之间的配置。在两个节点上都运行 `drbdadm adjust` 。

note: type: Plain text
en: You can now change both nodes to role primary at the same time with `drbdadm primary _<resource>_`.
zh: 现在可以使用 `drbdadm primary` 将两个节点同时更改为role primary。

note: type: Plain text
en: You should always implement suitable fencing policies.  Using 'allow-two-primaries' without fencing is a very bad idea, even worse than using single-primary without fencing.
zh: 您应该始终执行适当的围栏策略。使用 `allow-two-primaries` 而没有围栏策略是个坏主意，比在无围栏使用单主节点更糟糕。

note: type: Title ====
en: Temporary dual-primary mode
zh: 临时双主模式

note: type: Plain text
en: To temporarily enable dual-primary mode for a resource normally running in a single-primary configuration, issue the following command:
zh: 要临时为通常在单个主配置中运行的资源启用双主模式，请使用以下命令：

note: type: Plain text
en: To end temporary dual-primary mode, run the same command as above but with `--allow-two-primaries=no` (and your desired replication protocol, if applicable).
zh: 要结束临时双主模式，请运行与上面相同的命令，但使用 `--allow two primaries=no` （以及所需的复制协议，如果适用）。

note: type: Title ===
en: Using on-line device verification
zh: 使用在线设备验证

note: type: Title ====
en: Enabling on-line verification
zh: 启用在线验证

note: type: Plain text
en: indexterm:[on-line device verification]<<s-online-verify,On-line device verification>> for resources is not enabled by default. To enable it, add the following lines to your resource configuration in `/etc/drbd.conf`:
zh: indexterm:[on-line device verification]默认情况下，资源的<<s-online-verify,On-line device verification>>未启用。要启用它，请将以下行添加到 `/etc/drbd.conf` 中的资源配置中：

note: type: Plain text
en: _<algorithm>_ may be any message digest algorithm supported by the kernel crypto API in your system's kernel configuration. Normally, you should be able to choose at least from `sha1`, `md5`, and `crc32c`.
zh: _<algorithm>_ 可能是系统内核配置中内核加密API支持的任何消息摘要算法。通常，您至少可以从 `sha1` , `md5`  和 `crc32c` 中进行选择。

note: type: Plain text
en: If you make this change to an existing resource, as always, synchronize your `drbd.conf` to the peer, and run `drbdadm adjust _<resource>_` on both nodes.
zh: 如果对现有资源进行此更改，请一如既往地将 `drbd.conf` 同步到对等节点，并在两个节点上运行 `drbdadm adjust _<resource>_` 。

note: type: Title ====
en: Invoking on-line verification
zh: 调用联机验证

note: type: Plain text
en: indexterm:[on-line device verification]After you have enabled on-line verification, you will be able to initiate a verification run using the following command:
zh: indexterm:[on-line device verification]启用联机验证后，可以使用以下命令启动验证运行：

note: type: Plain text
en: When you do so, DRBD starts an online verification run for _<resource>_, and if it detects any blocks that are not in sync, will mark those blocks as such and write a message to the kernel log. Any applications using the device at that time can continue to do so unimpeded, and you may also <<s-switch-resource-roles,switch resource roles>> at will.
zh: 输入上述命令后，DRBD将针对 _<resource>_ 启动联机验证运行，如果它检测到任何不同步的块，则会将这些块标记为此类并向内核日志中写入一条消息。所有使用该设备的应用程序那时可以继续不受阻碍地执行此操作， 并且您也根据<<s-switch-resource-roles，switch resource roles>>进行定制化。

note: type: Plain text
en: If out-of-sync blocks were detected during the verification run, you may resynchronize them using the following commands after verification has completed:
zh: 如果在验证运行期间检测到不同步块，则可以在验证完成后使用以下命令重新同步它们：

note: type: Title ====
en: Automating on-line verification
zh: 自动在线验证

note: type: Plain text
en: indexterm:[on-line device verification]Most users will want to automate on-line device verification. This can be easily accomplished. Create a file with the following contents, named `/etc/cron.d/drbd-verify` on *one* of your nodes:
zh: indexterm:[on-line device verification]大多数用户都希望自动化联机设备验证。这很容易实现。在任一节点上创建一个包含以下内容的文件，名为 `/etc/cron.d/drbd-verify` :

note: type: Plain text
en: This will have `cron` invoke a device verification every Sunday at 42 minutes past midnight; so, if you come into the office on Monday morning, a quick look at the resource's status would show the result. If your devices are very big, and the \~32 hours were not enough, then you'll notice _VerifyS_ or _VerifyT_ as connection state, meaning that the `verify` is still in progress.
zh: 这将使 `cron` 在每周日午夜后42分钟调用一个设备验证；因此，假设您在周一上午进入办公室，快速查看资源的状态将显示结果。如果您的设备很大，而且32小时还不够，那么您将注意到 _VerifyS_ 或 _VerifyT_ 作为连接状态，这意味着 `verify` 仍在进行中。

note: type: Plain text
en: If you have enabled on-line verification for all your resources (for example, by adding `verify-alg _<algorithm>_` to the `common` section in `/etc/drbd.d/global_common.conf`), you may also use:
zh: 如果您已经为所有资源启用了联机验证（例如，通过在 `/etc/drbd.d/global_common.conf` 中的 `common` 部分添加 `verify-alg _<algorithm>_`，您就可以使用：

note: type: Title ===
en: Configuring the rate of synchronization
zh: 配置同步速率

note: type: Plain text
en: indexterm:[synchronization]Normally, one tries to ensure that background synchronization (which makes the data on the synchronization target temporarily inconsistent) completes as quickly as possible. However, it is also necessary to keep background synchronization from hogging all bandwidth otherwise available for foreground replication, which would be detrimental to application performance. Thus, you must configure the synchronization bandwidth to match your hardware -- which you may do in a permanent fashion or on-the-fly.
zh: indexterm:[synchronization]通常，会尝试确保后台同步（这会使同步目标上的数据暂时不一致）尽快完成。但是，还必须防止后台同步占用前台复制所需的所有带宽，这将对应用程序性能造成损害。因此，您必须配置同步带宽以匹配您的硬件 - 您可以永久地或动态地这样做。

note: type: Plain text
en: It does not make sense to set a synchronization rate that is higher than the maximum write throughput on your secondary node. You must not expect your secondary node to miraculously be able to write faster than its I/O subsystem allows, just because it happens to be the target of an ongoing device synchronization.
zh: 设置高于辅助节点上最大写入吞吐量的同步速率是没有意义的。您不能期望辅助节点奇迹般地能够比其I/O子系统所允许的写入速度快，因为它恰好是正在进行的设备同步的目标。

note: type: Plain text
en: Likewise, and for the same reasons, it does not make sense to set a synchronization rate that is higher than the bandwidth available on the replication network.
zh: 同样，出于同样的原因，设置高于复制网络上可用带宽的同步速率是没有意义的。

note: type: Title ====
en: Estimating a synchronization speed
zh: 估计同步速度

note: type: Plain text
en: A good rule of thumb for this value is to use about 30% of the available replication bandwidth. Thus, if you had an I/O subsystem capable of sustaining write throughput of 400MB/s, and a Gigabit Ethernet network capable of sustaining 110 MB/s network throughput (the network being the bottleneck), you would calculate:
zh: 对于这个值，一个很好的经验法则是使用大约30%的可用复制带宽。因此，如果有一个I/O子系统能够维持400MB/s的写吞吐量，而一个千兆以太网网络能够维持110MB/s的网络吞吐量（网络是瓶颈），您可以如下计算：

note: type: Block title
en: Syncer rate example, 110MB/s effective available bandwidth
zh: 同步速率示例，110MB/s有效可用带宽

note: type: Plain text
en: Thus, the recommended value for the `rate` option would be `33M`.
zh: 因此，`rate` 选项的建议值为 `33M` 。

note: type: Plain text
en: By contrast, if you had an I/O subsystem with a maximum throughput of 80MB/s and a Gigabit Ethernet connection (the I/O subsystem being the bottleneck), you would calculate:
zh: 相比之下，如果您有一个最大吞吐量为80MB/s的I/O子系统和一个千兆以太网连接（I/O子系统是瓶颈），您将计算：

note: type: Block title
en: Syncer rate example, 80MB/s effective available bandwidth
zh: 同步速率示例，80MB/s有效可用带宽

note: type: Plain text
en: In this case, the recommended value for the `rate` option would be `24M`.
zh: 在这种情况下，`rate` 选项的建议值为 `24M` 。

note: type: Plain text
en: Similarly, for a storage speed of 800MB/s and a 10Gbe network connection, you would shoot for \~240MB/s synchronization rate.
zh: 类似地，对于800MB/s的存储速度和10Gbe的网络连接，您将获得大约\~240MB/s的同步速率。

note: type: Title ====
en: Variable sync rate configuration
zh: 可变同步速率配置

note: type: Plain text
en: When multiple DRBD resources share a single replication/synchronization network, synchronization with a fixed rate may not be an optimal approach. So, in DRBD 8.4.0 the variable-rate synchronization was enabled by default. In this mode, DRBD uses an automated control loop algorithm to determine, and adjust, the synchronization rate. This algorithm ensures that there is always sufficient bandwidth available for foreground replication, greatly mitigating the impact that background synchronization has on foreground I/O.
zh: 当多个DRBD资源共享一个复制/同步网络时，以固定速率同步可能不是最佳方法。因此，在DRBD 8.4.0中，默认情况下启用了可变速率同步。在这种模式下，DRBD使用自动控制环路算法来确定和调整同步速率。该算法保证了前台复制始终有足够的带宽，大大减轻了后台同步对前台I/O的影响。

note: type: Plain text
en: The optimal configuration for variable-rate synchronization may vary greatly depending on the available network bandwidth, application I/O pattern and link congestion. Ideal configuration settings also depend on whether <<s-drbd-proxy,DRBD Proxy>> is in use or not. It may be wise to engage professional consultancy in order to optimally configure this DRBD feature. An _example_ configuration (which assumes a deployment in conjunction with DRBD Proxy) is provided below:
zh: 可变速率同步的最佳配置可能因可用的网络带宽、应用程序I/O模式和链路拥塞而有很大差异。理想的配置设置还取决于<<s-drbd-proxy,DRBD Proxy>>是否正在使用。为了优化配置这个DRBD特性，最好聘请专业顾问。下面提供了一个配置示例（假设与DRBD代理一起部署）：

note: type: Plain text
en: A good starting value for `c-fill-target` is _BDP * 2_, where _BDP_ is your bandwidth-delay-product on the replication link.
zh: `c-fill-target` 的一个很好的初始值是 _BDP * 2_, 其中 _BDP_ 是复制链接上的带宽延迟产品。

note: type: Plain text
en: For example, when using a 1GBit/s crossover connection, you'll end up with about 200µs latencyfootnote:[The rule-of-thumb is using the time reported by `ping`.]. + 1GBit/s means about 120MB/s; times 200*10^-6^ seconds gives 24000 Byte. Just round that value up to the next MB, and you're good to go.
zh: 例如，当使用1GBit/s交叉连接时，您将得到大约200微秒的延迟footnote:[经验法则是使用 `ping` 报告的时间]。 + 1GBit/s意味着大约120MB/s；乘以200*10^-6^秒得到24000字节。把这个值四舍五入到下一个MB，你就得到了值。

note: type: Plain text
en: Another example: a 100MBit WAN connection with 200ms latency means 12MB/s times 0.2s, or about 2.5MB "on the wire". Here a good starting value for `c-fill-target` would be 3MB.
zh: 另一个例子：一个100兆位的广域网连接，200毫秒的延迟意味着12兆字节/秒乘以0.2秒，或者说大约2.5兆字节 "on the wire""在线"。在这里， `c-fill-target` 的初始值可预设为是3MB。

note: type: Plain text
en: Please see the `drbd.conf` manual page for more details on the other configuration items.
zh: 有关其他配置项的详细信息，请参见 `drbd.conf` 手册页。

note: type: Title ====
en: Permanent fixed sync rate configuration
zh: 永久固定同步速率配置

note: type: Plain text
en: In a few, very restricted situationsfootnote:[Like benchmarking.], it might make sense to just use some fixed synchronization rate. In this case, first of all you need to turn the dynamic sync rate controller off, by using `c-plan-ahead 0;`.
zh: 在一些非常受限的情况下，footnote:[就像基准测试一样]，使用一些固定的同步速率可能是有意义的。在这种情况下，首先需要使用 `c-plan-ahead 0；` 关闭动态同步速率控制器。

note: type: Plain text
en: Then, the maximum bandwidth a resource uses for background re-synchronization is determined by the `resync-rate` option for a resource. This must be included in the resource's `disk` section in `/etc/drbd.conf`:
zh: 然后，资源用于后台重新同步的最大带宽由资源的 `resync-rate` 选项确定。这必须包含在 `/etc/drbd.conf` 的资源定义的 `disk` 条目中:

note: type: Plain text
en: Note that the rate setting is given in _bytes_, not _bits_ per second; the default unit is _Kibibyte_, so a value of `4096` would be interpreted as `4MiB`.
zh: 请注意，速率设置以字节为单位，而不是以比特/秒为单位；默认单位是字节，因此值 `4096` 将被解释为 `4MiB` 。

note: type: Plain text
en: This just defines a rate that DRBD tries to achieve. If there is a bottleneck with lower throughput (network, storage speed), the defined speed (aka the "wished-for" performance ;) won't be reached.
zh: 这只是定义了DRBD试图达到的速率。如果存在吞吐量较低的瓶颈（网络、存储速度），则无法达到定义的速度（也称为"期望"性能；）。

note: type: Title ====
en: Some more hints about synchronization
zh: 关于同步的更多提示

note: type: Plain text
en: When some amount of the to-be-synchronized data isn't really in use anymore (e.g. because files got deleted while one node wasn't connected), you might benefit from the <<s-trim-discard>>.
zh: 当一些要同步的数据不再实际使用时（例如，因为文件在一个节点未连接时被删除），您可能会从<<s-trim-discard>>中受益。

note: type: Plain text
en: Furthermore, `c-min-rate` is easy to misunderstand - it doesn't define a *minimum* synchronization speed, but rather a limit below which DRBD will not slow down further *on purpose*. + Whether you manage to *reach* that synchronization rate depends on your network and storage speed, network latency (which might be highly variable for shared links), and application IO (which not might be able to do anything about).
zh: 此外， `c-min-rate` 很容易被误解 - 它没有定义*最小*同步速度，而是一个限制，低于这个限制，DRBD就不会进一步 *故意* 减速。 + 您是否能够达到同步速率取决于您的网络和存储速度、网络延迟（对于共享链接来说，这可能是高度可变的）和应用程序IO（对此可能无能为力）。

note: type: Title ===
en: Configuring checksum-based synchronization
zh: 配置基于校验和的同步

note: type: Plain text
en: indexterm:[checksum-based synchronization]<<p-checksum-sync,Checksum-based synchronization>> is not enabled for resources by default. To enable it, add the following lines to your resource configuration in `/etc/drbd.conf`:
zh: indexterm:[checksum-based synchronization]<<p-checksum-sync,Checksum-based synchronization>>默认情况下不为资源启用。要启用它，请将以下行添加到 `/etc/drbd.conf` 中的资源配置中：

note: type: Title ===
en: Configuring congestion policies and suspended replication
zh: 配置拥塞策略和挂起复制

note: type: Plain text
en: In an environment where the replication bandwidth is highly variable (as would be typical in WAN replication setups), the replication link may occasionally become congested. In a default configuration, this would cause I/O on the primary node to block, which is sometimes undesirable.
zh: 在复制带宽高度可变的环境中（这在广域网复制设置中是典型的），复制链路有时可能会变得拥挤。在默认配置中，这将导致主节点上的I/O阻塞，这有时是不可取的。

note: type: Plain text
en: Instead, you may configure DRBD to _suspend_ the ongoing replication in this case, causing the Primary's data set to _pull ahead_ of the Secondary. In this mode, DRBD keeps the replication channel open -- it never switches to disconnected mode -- but does not actually replicate until sufficient bandwidth becomes available again.
zh: 相反，在这种情况下，您可以将DRBD配置为挂起正在进行的复制，从而使主数据集位于次数据集的 _前拉_ _pull ahead_ 位置。在这种模式下，DRBD保持复制通道打开 - 它从不切换到断开连接的模式 - 但直到有足够的带宽再次可用时才真正进行复制。

note: type: Plain text
en: The following example is for a DRBD Proxy configuration:
zh: 以下示例适用于DRBD代理配置：

note: type: Plain text
en: It is usually wise to set both `congestion-fill` and `congestion-extents` together with the `pull-ahead` option.
zh: 通常明智的做法是将 `congestion-fill` 和 `congestion-extents` 与 `pull-ahead` 选项一起设置。

note: type: Plain text
en: A good value for `congestion-fill` is 90%
zh: `congestion-fill` 的理想值是90%

note: type: Plain text
en: of the allocated DRBD proxy buffer memory, when replicating over DRBD Proxy, or
zh: 当通过DRBD proxy进行复制时，分配的DRBD proxy缓冲存储器，或

note: type: Plain text
en: of the TCP network send buffer, in non-DRBD Proxy setups.
zh: 在非DRBD代理设置中的TCP网络发送缓冲区。

note: type: Plain text
en: A good value for `congestion-extents` is 90% of your configured `al-extents` for the affected resources.
zh: `congestion-extents` 的理想值是受影响资源配置的 `al-extents` 的90%。

note: type: Title ===
en: Configuring I/O error handling strategies
zh: 配置I/O错误处理策略

note: type: Plain text
en: indexterm:[I/O errors]indexterm:[drbd.conf]DRBD's <<s-handling-disk-errors,strategy for handling lower-level I/O errors>> is determined by the `on-io-error` option, included in the resource `disk` configuration in `/etc/drbd.conf`:
zh: indexterm:[I/O error s]indexterm:[drbd.conf]DRBD的<<s-handling-disk-errors,strategy for handling lower-level I/O errors>>由 `/etc/drbd.conf` 文件中resource下的 `disk` 配置中的 `on-io-error` 选项确定:

note: type: Plain text
en: You may, of course, set this in the `common` section too, if you want to define a global I/O error handling policy for all resources.
zh: 当然，如果要为所有资源定义全局I/O错误处理策略，也可以在 `common` 部分中设置此值。

note: type: Plain text
en: _<strategy>_ may be one of the following options:
zh: _<strategy>_ 可能是以下选项之一：

note: type: Plain text
en: This is the default and recommended option. On the occurrence of a lower-level I/O error, the node drops its backing device, and continues in diskless mode.
zh: 这是默认和推荐的选项。在发生较低级别的I/O错误时，节点将丢弃其备份设备，并继续以无盘模式运行。

note: type: Plain text
en: This causes DRBD to report the I/O error to the upper layers. On the primary node, it is reported to the mounted file system. On the secondary node, it is ignored (because the secondary has no upper layer to report to).
zh: 这导致DRBD向上层报告I/O错误。在主节点上，它将报告给已装入的文件系统。在次节点上，它被忽略（因为次节点没有要报告的上层）。

note: type: Plain text
en: Invokes the command defined as the local I/O error handler. This requires that a corresponding `local-io-error` command invocation is defined in the resource's `handlers` section. It is entirely left to the administrator's discretion to implement I/O error handling using the command (or script) invoked by `local-io-error`.
zh: 调用定义为本地I/O错误处理程序的命令。这要求在资源的 `handlers` 部分中定义相应的 `local-io-error` 命令调用。完全由管理员自行决定使用 `local-io-error` 调用的命令（或脚本）来实现I/O错误处理。

note: type: Plain text
en: Early DRBD versions (prior to 8.0) included another option, `panic`, which would forcibly remove the node from the cluster by way of a kernel panic, whenever a local I/O error occurred. While that option is no longer available, the same behavior may be mimicked via the `local-io-error`/`call-local-io-error` interface. You should do so only if you fully understand the implications of such behavior.
zh: 早期的DRBD版本（8.0之前）包含另一个选项 `panic` ，每当发生本地I/O错误时，该选项将通过内核panic从集群中强制删除节点。虽然该选项不再可用，但可以通过 `local-io-error` / `call-local-io-error` 接口来模拟相同的行为。只有当你完全理解这种行为的含义时，你才应该这样做。

note: type: Plain text
en: You may reconfigure a running resource's I/O error handling strategy by following this process:
zh: 您可以按照此过程重新配置正在运行的资源的I/O错误处理策略：

note: type: Plain text
en: Edit the resource configuration in `/etc/drbd.d/__<resource>__.res`.
zh: 在 `/etc/drbd.d/__<resource>__.res` 中编辑资源配置。

note: type: Plain text
en: Copy the configuration to the peer node.
zh: 将配置复制到对等节点。

note: type: Plain text
en: Issue `drbdadm adjust _<resource>_` on both nodes.
zh: 在两个节点上都运行 `drbdadm adjust` 命令。

note: type: Title ===
en: Configuring replication traffic integrity checking
zh: 配置复制通信完整性检查

note: type: Plain text
en: indexterm:[replication traffic integrity checking]<<s-integrity-check,Replication traffic integrity checking>> is not enabled for resources by default. To enable it, add the following lines to your resource configuration in `/etc/drbd.conf`:
zh: indexterm:[replication traffic integrity checking]<<s-integrity-check,Replication traffic integrity checking>>默认情况下不为资源启用。要启用它，请将以下行添加到 `/etc/drbd.conf` 中的资源配置中：

note: type: Plain text
en: This feature is not intended for production use. Enable only if you need to diagnose data corruption problems, and want to see whether the transport path (network hardware, drivers, switches) might be at fault!
zh: 此功能不用于生产用途。仅当需要诊断数据损坏问题并希望查看传输路径（网络硬件、驱动程序、交换机）是否有故障时才启用！

note: type: Title ===
en: Resizing resources
zh: 调整资源大小

note: type: Title ====
en: Growing on-line
zh: 在线扩容

note: type: Plain text
en: indexterm:[resource]If the backing block devices can be grown while in operation (online), it is also possible to increase the size of a DRBD device based on these devices during operation. To do so, two criteria must be fulfilled:
zh: indexterm:[resource]如果支持块设备可以在操作（联机）时增长，那么也可以在操作期间基于这些设备增加DRBD设备的大小。为此，必须满足两个标准：

note: type: Plain text
en: The affected resource's backing device must be one managed by a logical volume management subsystem, such as LVM.
zh: 受影响资源的备份设备必须由逻辑卷管理子系统（如LVM）管理。

note: type: Plain text
en: The resource must currently be in the _Connected_ connection state.
zh: 资源当前必须处于连接状态。

note: type: Plain text
en: Having grown the backing block devices on all nodes, ensure that only one node is in primary state. Then enter on one node:
zh: 在所有节点上增加了备份块设备后，请确保只有一个节点处于主状态。然后在一个节点上输入：

note: type: Plain text
en: This triggers a synchronization of the new section. The synchronization is done from the primary node to the secondary node.
zh: 这将触发新增部分的同步。同步是以从主节点到辅助节点的顺序完成的。

note: type: Plain text
en: If the space you're adding is clean, you can skip syncing the additional space by using the --assume-clean option.
zh: 如果要添加的空间是干净的，可以使用--assume clean选项跳过同步新增的空间。

note: type: Title ====
en: Growing off-line
zh: 离线扩容

note: type: Plain text
en: indexterm:[resource]When the backing block devices on both nodes are grown while DRBD is inactive, and the DRBD resource is using <<s-external-meta-data,external meta data>>, then the new size is recognized automatically. No administrative intervention is necessary. The DRBD device will have the new size after the next activation of DRBD on both nodes and a successful establishment of a network connection.
zh: indexterm:[resource]当两个节点上的备份块设备在DRBD处于非活动状态时增长，并且DRBD资源正在使用<<s-external-meta-data,external meta data>>，则自动识别新大小。不需要人为干预。下次在两个节点上激活DRBD并成功建立网络连接后，DRBD设备将具有新的大小。

note: type: Plain text
en: If however the DRBD resource is configured to use <<s-internal-meta-data,internal meta data>>, then this meta data must be moved to the end of the grown device before the new size becomes available. To do so, complete the following steps:
zh: 然而，如果DRBD资源被配置为使用<<s-internal-meta-data,internal meta data>>，则在新的扩容空间可用之前，必须将该元数据移动到所生长设备的末端。为此，请完成以下步骤：

note: type: Plain text
en: This is an advanced procedure. Use at your own discretion.
zh: 这是一个高级功能。请自己斟酌使用。

note: type: Plain text
en: Unconfigure your DRBD resource:
zh: 取消配置您的DRBD资源：

note: type: Plain text
en: Save the meta data in a text file prior to resizing:
zh: 在调整大小之前，请将元数据保存在文本文件中：

note: type: Plain text
en: You must do this on both nodes, using a separate dump file for every node. *Do not* dump the meta data on one node, and simply copy the dump file to the peer. *This. will. not. work.*
zh: 必须在两个节点上执行此操作，对每个节点使用单独的转储文件。 *不要* 在一个节点上转储元数据，只需将转储文件复制到对等节点。*这. 行. 不. 通.*

note: type: Plain text
en: Grow the backing block device on both nodes.
zh: 在两个节点上扩展备份块设备。

note: type: Plain text
en: Adjust the size information (`la-size-sect`) in the file `/tmp/metadata` accordingly, on both nodes. Remember that `la-size-sect` must be specified in sectors.
zh: 在两个节点上相应地调整文件 `/tmp/metadata` 中的大小信息（ `la-size-sect` ）。请记住，必须在扇区中指定 `la-size-sect`。

note: type: Plain text
en: Re-initialize the metadata area:
zh: 重新初始化元数据区域：

note: type: Plain text
en: Re-import the corrected meta data, on both nodes:
zh: 在两个节点上重新导入更正的元数据：

note: type: Plain text
en: This example uses `bash` parameter substitution. It may or may not work in other shells. Check your `SHELL` environment variable if you are unsure which shell you are currently using.
zh: 此示例使用 `bash` 参数替换。它可能在其他SHELL中工作，也可能不工作。如果不确定当前使用的是哪个SHELL，请检查您的 `SHELL` 环境变量。

note: type: Plain text
en: Re-enable your DRBD resource:
zh: 重新启用DRBD资源：

note: type: Plain text
en: On one node, promote the DRBD resource:
zh: 在一个节点上，升级DRBD资源：

note: type: Plain text
en: Finally, grow the file system so it fills the extended size of the DRBD device.
zh: 最后，扩展文件系统，使其填充DRBD设备的扩展大小。

note: type: Title ====
en: Shrinking on-line
zh: 在线缩容

note: type: Plain text
en: Online shrinking is only supported with external metadata.
zh: 仅外部元数据支持在线缩容。

note: type: Plain text
en: indexterm:[resource]Before shrinking a DRBD device, you _must_ shrink the layers above DRBD, i.e. usually the file system. Since DRBD cannot ask the file system how much space it actually uses, you have to be careful in order not to cause data loss.
zh: indexterm:[resource]在缩容DRBD设备之前，_必须_ 收缩DRBD上面的层，通常是文件系统。由于DRBD无法询问文件系统实际使用了多少空间，因此必须小心操作，以免造成数据丢失。

note: type: Plain text
en: Whether or not the _filesystem_ can be shrunk on-line depends on the filesystem being used. Most filesystems do not support on-line shrinking. XFS does not support shrinking at all.
zh: _文件系统_是否可以在线缩容取决于所使用的文件系统。大多数文件系统不支持在线缩容。XFS完全不支持缩容。

note: type: Plain text
en: To shrink DRBD on-line, issue the following command _after_ you have shrunk the file system residing on top of it:
zh: 要在线缩小DRBD，请先缩小位于其上的文件系统,  _之后_ , 输入以下命令：

note: type: Plain text
en: You may use the usual multiplier suffixes for _<new-size>_ (K, M, G etc.). After you have shrunk DRBD, you may also shrink the containing block device (if it supports shrinking).
zh: 您可以使用常用的单位来表示 _<new-size>_ （K、M、G等）。收缩DRBD后，还可以收缩其包含的块设备（如果它支持收缩）。

note: type: Plain text
en: It might be a good idea to issue `drbdadm resize _<resource>_` after resizing the lower level device, so that the DRBD metadata *really* gets written into the expected space at the end of the volume.
zh: 在调整底层设备的大小后，最好输入 `drbdadm resize _<resource>_` 命令，以便将DRBD元数据*真正*写入卷末尾的预期空间。

note: type: Title ====
en: Shrinking off-line
zh: 离线缩容

note: type: Plain text
en: indexterm:[resource]If you were to shrink a backing block device while DRBD is inactive, DRBD would refuse to attach to this block device during the next attach attempt, since it is now too small (in case external meta data is used), or it would be unable to find its meta data (in case internal meta data is used). To work around these issues, use this procedure (if you cannot use <<s-shrinking-online,on-line shrinking>>):
zh: indexterm:[resource]如果在DRBD处于非活动状态时收缩备份块设备，DRBD将在下次尝试连接时拒绝连接到此块设备，因为它现在太小（如果使用外部元数据），或者找不到它的元数据（如果使用内部元数据）。要解决这些问题，请使用以下步骤（如果无法使用<<s-shrinking-online,on-line shrinking>>）：

note: type: Plain text
en: Shrink the file system from one node, while DRBD is still configured.
zh: 在DRBD仍然配置的情况下，从一个节点缩容文件系统。

note: type: Plain text
en: Save the meta data in a text file prior to shrinking:
zh: 在缩容之前将元数据保存在文本文件中：

note: type: Plain text
en: Shrink the backing block device on both nodes.
zh: 缩容两个节点上的备份块设备。

note: type: Plain text
en: *Only if you are using internal metadata* (which at this time have
    probably been lost due to the shrinking process), re-initialize the
    metadata area:
zh: *仅当您使用内部元数据时* (此时可能由于收缩过程而丢失），才需要重新初始化元数据区域

note: type: Title ===
en: Disabling backing device flushes
zh: 禁用备份设备刷新

note: type: Plain text
en: You should only disable device flushes when running DRBD on devices with a battery-backed write cache (BBWC). Most storage controllers allow to automatically disable the write cache when the battery is depleted, switching to write-through mode when the battery dies. It is strongly recommended to enable such a feature.
zh: 在使用电池备份写缓存（BBWC）的设备上运行DRBD时，应禁用设备刷新。大多数存储控制器允许在电池耗尽时自动禁用写缓存，在电池耗尽时切换到直写模式。强烈建议启用此功能。

note: type: Plain text
en: Disabling DRBD's flushes when running without BBWC, or on BBWC with a depleted battery, is _likely to cause data loss_ and should not be attempted.
zh: 在没有BBWC的情况下运行或在电池耗尽的BBWC上运行时，禁用DRBD的刷新 _可能会导致数据丢失_ ，不应尝试。

note: type: Plain text
en: DRBD allows you to enable and disable <<s-disk-flush-support,backing device flushes>> separately for the replicated data set and DRBD's own meta data. Both of these options are enabled by default. If you wish to disable either (or both), you would set this in the `disk` section for the DRBD configuration file, `/etc/drbd.conf`.
zh: DRBD允许对复制的数据集和DRBD自己的元数据分别启用和禁用<<s-disk-flush-support,backing device flushes>>。默认情况下，这两个选项都已启用。如果您希望禁用其中一个（或两个），您可以在DRBD配置文件 `/etc/DRBD.conf` 的 `disk` 部分中设置它。

note: type: Plain text
en: To disable disk flushes for the replicated data set, include the following line in your configuration:
zh: 要禁用复制数据集的磁盘刷新，请在配置中包含以下行：

note: type: Plain text
en: To disable disk flushes on DRBD's meta data, include the following line:
zh: 要禁用DRBD元数据上的磁盘刷新，请包括以下行：

note: type: Plain text
en: After you have modified your resource configuration (and synchronized your `/etc/drbd.conf` between nodes, of course), you may enable these settings by issuing this command on both nodes:
zh: 在修改了资源配置（当然，在节点之间同步了 `/etc/drbd.conf` ）之后，可以通过在两个节点上输入以下命令来启用这些设置：

note: type: Plain text
en: In case only one of the serves has a BBWCfootnote:[For example, in the DR site you might be using different hardware, right?], you should move the setting into a host section, like this:
zh: 如果只有一个服务有BBWCfootnote:[例如，在DR站点中，您可能使用不同的硬件，对吗？]，应将设置移动到主机部分，如下所示：

note: type: Title ===
en: Configuring split brain behavior
zh: 配置裂脑行为

note: type: Title ====
en: Split brain notification
zh: 裂脑通知

note: type: Plain text
en: DRBD invokes the `split-brain` handler, if configured, at any time split brain is _detected_. To configure this handler, add the following item to your resource configuration:
zh: DRBD调用 `split brain` 处理程序（如果已配置），随时检测到split brain。要配置此处理程序，请将以下项添加到资源配置中：

note: type: Plain text
en: _<handler>_ may be any executable present on the system.
zh: _<handler>_ 可以是系统中存在的任何可执行文件。

note: type: Plain text
en: The DRBD distribution contains a split brain handler script that installs as `/usr/lib/drbd/notify-split-brain.sh`. It simply sends a notification e-mail message to a specified address. To configure the handler to send a message to `root@localhost` (which is expected to be an email address that forwards the notification to a real system administrator), configure the `split-brain handler` as follows:
zh: DRBD发行版包含一个split brain handler脚本，安装为 `/usr/lib/DRBD/notify-split-brain.sh` 。它会将通知电子邮件发送到指定的地址。要将处理程序配置为将消息发送到 `root@localhost` （预期是将通知转发给实际系统管理员的电子邮件地址），请按如下所示配置 `split-brain handler` :

note: type: Plain text
en: After you have made this modification on a running resource (and synchronized the configuration file between nodes), no additional intervention is needed to enable the handler. DRBD will simply invoke the newly-configured handler on the next occurrence of split brain.
zh: 对正在运行的资源进行此修改（并在节点之间同步配置文件）后，无需进行其他干预即可启用处理程序。DRBD只需在下一次出现split brain时调用新配置的处理程序。

note: type: Title ====
en: Automatic split brain recovery policies
zh: 自动裂脑恢复策略

note: type: Plain text
en: Configuring DRBD to automatically resolve data divergence siutaions resulting from split-brain (or other) scenarios is configuring for potential *automatic data loss*.  Understand the implications, and don't do it if you don't mean to.
zh: 将DRBD配置为自动解决由于裂脑（或其他）情况导致的数据分歧问题，是在配置潜在的*自动数据丢失*。请认真理解其中的含义，如果非必要情况请不要这么做。

note: type: Plain text
en: You rather want to look into fencing policies, quorum settings, cluster manager integration, and redundant cluster manager communication links to *avoid* data divergence in the first place.
zh: 您应该花更多时间研究围栏策略、仲裁设置、群集管理器集成和冗余群集管理器通信链接，以便在第一时间*避免*数据差异。

note: type: Plain text
en: In order to be able to enable and configure DRBD's automatic split brain recovery policies, you must understand that DRBD offers several configuration options for this purpose. DRBD applies its split brain recovery procedures based on the number of nodes in the Primary role at the time the split brain is detected. To that end, DRBD examines the following keywords, all found in the resource's `net` configuration section:
zh: 为了能够启用和配置DRBD的自动裂脑恢复策略，您必须了解DRBD为此提供了几个配置选项。DRBD根据检测到裂脑时主要角色的节点数应用其裂脑恢复程序。为此，DRBD检查以下关键字，这些关键字都可以在资源的 `net` 配置部分找到：

note: type: Plain text
en: Split brain has just been detected, but at this time the resource is not in the Primary role on any host. For this option, DRBD understands the following keywords:
zh: 裂脑被检测到，但此时资源在任何主机上都不是主要角色。对于这个选项，DRBD理解以下关键字：

note: type: Plain text
en: `disconnect`: Do not recover automatically, simply invoke the `split-brain` handler script (if configured), drop the connection and continue in disconnected mode.
zh: `disconnect` ：不要自动恢复，只需调用 `split brain` 处理程序脚本（如果已配置），断开连接并以断开模式继续。

note: type: Plain text
en: `discard-younger-primary`: Discard and roll back the modifications made on the host which assumed the Primary role last.
zh: `discard-younger-primary` ：放弃并回滚对最后担任主服务器角色的主机所做的修改。

note: type: Plain text
en: `discard-least-changes`: Discard and roll back the modifications on the host where fewer changes occurred.
zh: `discard-least-changes`：丢弃并回滚发生较少更改的主机上的更改。

note: type: Plain text
en: `discard-zero-changes`: If there is any host on which no changes occurred at all, simply apply all modifications made on the other and continue.
zh: `discard-zero-changes`：如果有任何主机根本没有发生任何更改，只需在另一个主机上应用所做的所有修改并继续。

note: type: Plain text
en: Split brain has just been detected, and at this time the resource is in the Primary role on one host. For this option, DRBD understands the following keywords:
zh: 裂脑被检测到，此时资源在一个主机上扮演主要角色。对于这个选项，DRBD理解以下关键字：

note: type: Plain text
en: `disconnect`: As with `after-sb-0pri`, simply invoke the `split-brain` handler script (if configured), drop the connection and continue in disconnected mode.
zh: `disconnect`：与 `after-sb-0pri` 一样，只需调用 `split brain` 处理程序脚本（如果已配置），断开连接并以断开模式继续。

note: type: Plain text
en: `consensus`: Apply the same recovery policies as specified in `after-sb-0pri`. If a split brain victim can be selected after applying these policies, automatically resolve. Otherwise, behave exactly as if `disconnect` were specified.
zh: `consensus`：应用 `after-sb-0pri` 中指定的相同恢复策略。如果在应用这些策略后可以选择裂脑受害者，则自动解决。否则，行为就像指定了 `disconnect` 一样。

note: type: Plain text
en: `call-pri-lost-after-sb`: Apply the recovery policies as specified in `after-sb-0pri`. If a split brain victim can be selected after applying these policies, invoke the `pri-lost-after-sb` handler on the victim node. This handler must be configured in the `handlers` section and is expected to forcibly remove the node from the cluster.
zh: `call-pri-lost-after-sb`：应用 `after-sb-0pri` 中指定的恢复策略。如果在应用这些策略后可以选择裂脑受害者，请调用受害者节点上的 `pri-lost-after-sb` 处理程序。必须在 `handlers` 部分中配置此处理程序，并要求将节点从集群中强制删除。

note: type: Plain text
en: `discard-secondary`: Whichever host is currently in the Secondary role, make that host the split brain victim.
zh: `discard-secondary`：无论哪个主机当前处于第二个角色，使该主机成为裂脑受害者。

note: type: Plain text
en: Split brain has just been detected, and at this time the resource is in the Primary role on both hosts. This option accepts the same keywords as `after-sb-1pri` except `discard-secondary` and `consensus`.
zh: 裂脑被检测到，此时资源在两个主机上都处于主要角色。此选项接受与 `after-sb-1pri` 相同的关键字，但 `discard-secondary` 和 `consensus` 除外。

note: type: Plain text
en: DRBD understands additional keywords for these three options, which have been omitted here because they are very rarely used. Refer to the man page of `drbd.conf` for details on split brain recovery keywords not discussed here.
zh: DRBD理解这三个选项的附加关键字，这里省略了这些关键字，因为它们很少使用。请参阅 `drbd.conf` 的手册页，以了解此处未讨论的脑分裂恢复关键字的详细信息。

note: type: Plain text
en: For example, a resource which serves as the block device for a GFS or OCFS2 file system in dual-Primary mode may have its recovery policy defined as follows:
zh: 例如，在双主模式下用作GFS或OCFS2文件系统的块设备的资源的恢复策略定义如下：

note: type: Title ===
en: Creating a stacked three-node setup
zh: 创建堆叠的三节点设置

note: type: Plain text
en: A three-node setup involves one DRBD device _stacked_ atop another.
zh: 三个节点的设置包括一个堆叠在另一个设备上的DRBD设备。

note: type: Plain text
en: Stacking is deprecated in DRBD version 9.x, as more nodes can be implemented on a single level. See <<s-drbdconf-conns>> for details.
zh: 在DRBD版本9.x中，堆叠是不推荐使用的，因为可以在单个级别上实现更多节点。有关详细信息，请参见<<s-drbdconf-conns>>。

note: type: Title ====
en: Device stacking considerations
zh: 设备堆叠注意事项

note: type: Plain text
en: The following considerations apply to this type of setup:
zh: 以下注意事项适用于此类型的设置：

note: type: Plain text
en: The stacked device is the active one. Assume you have configured one DRBD device `/dev/drbd0`, and the stacked device atop it is `/dev/drbd10`, then `/dev/drbd10` will be the device that you mount and use.
zh: 堆叠的设备是活动的。假设您已经配置了一个DRBD设备 `/dev/drbd0` ，并且上面的堆叠设备是 `/dev/drbd10` ，那么 `/dev/drbd10` 将是您装载和使用的设备。

note: type: Plain text
en: Device meta data will be stored twice, on the underlying DRBD device _and_ the stacked DRBD device. On the stacked device, you must always use <<s-internal-meta-data,internal meta data>>. This means that the effectively available storage area on a stacked device is slightly smaller, compared to an unstacked device.
zh: 设备元数据将存储两次，分别存储在底层DRBD设备 _和_ 堆叠的DRBD设备上。在堆叠设备上，必须始终使用<<s-internal-meta-data,internal meta data>>。这意味着，与未堆叠的设备相比，堆叠设备上的有效可用存储区域稍微小一些。

note: type: Plain text
en: To get the stacked upper level device running, the underlying device must be in the primary role.
zh: 要使堆叠的上层设备运行，底层设备必须处于primary角色。

note: type: Plain text
en: To be able to synchronize the backup node, the stacked device on the active node must be up and in the primary role.
zh: 要同步备份节点，活动节点上的堆叠设备必须处于启动状态并且处于主要角色。

note: type: Title ====
en: Configuring a stacked resource
zh: 配置堆叠资源

note: type: Plain text
en: In the following example, nodes are named 'alice', 'bob', and 'charlie', with 'alice' and 'bob' forming a two-node cluster, and 'charlie' being the backup node.
zh: 在下面的示例中，节点名为 `alice` 、`bob` 和 `charlie` ，其中 `alice` 和 `bob` 组成一个两节点集群， `charlie` 是备份节点。

note: type: Plain text
en: As with any `drbd.conf` configuration file, this must be distributed across all nodes in the cluster -- in this case, three nodes. Notice the following extra keyword not found in an unstacked resource configuration:
zh: 与任何 `drbd.conf` 配置文件一样，它必须分布在集群中的所有节点上 - 在本例中是三个节点。请注意，在未备份的资源配置中未找到以下额外关键字：

note: type: Plain text
en: This option informs DRBD that the resource which contains it is a stacked resource. It replaces one of the `on` sections normally found in any resource configuration. Do not use `stacked-on-top-of` in an lower-level resource.
zh: 此选项通知DRBD包含它的资源是堆叠资源。它替换了通常在任何资源配置中找到的 `on` 部分之一。不要在较低级别的资源中使用 `stacked-on-top-of` 。

note: type: Plain text
en: It is not a requirement to use <<fp-protocol-a,Protocol A>> for stacked resources. You may select any of DRBD's replication protocols depending on your application.
zh: 对于堆叠资源，不需要使用<<fp-protocol-a,Protocol A>>。您可以根据您的应用程序选择任何DRBD的复制协议。

note: type: Block title
en: Single stacked setup
zh: 单堆叠设置

note: type: Title ====
en: Enabling stacked resources
zh: 启用堆叠资源

note: type: Plain text
en: To enable a stacked resource, you first enable its lower-level resource and promote it:
zh: 如果要启用堆叠资源，请先启用底层级别的资源后, 并将其提升：

note: type: Plain text
en: As with unstacked resources, you must create DRBD meta data on the stacked resources. This is done using the following command:
zh: 与未堆叠的资源一样，必须在堆叠的资源上创建DRBD元数据。使用以下命令完成此操作：

note: type: Plain text
en: Then, you may enable the stacked resource:
zh: 然后，可以启用堆叠资源：

note: type: Plain text
en: After this, you may bring up the resource on the backup node, enabling three-node replication:
zh: 之后，您可以在备份节点上调出资源，启用三节点复制：

note: type: Plain text
en: In order to automate stacked resource management, you may integrate stacked resources in your cluster manager configuration. See <<s-pacemaker-stacked-resources>> for information on doing this in a cluster managed by the Pacemaker cluster management framework.
zh: 为了自动化堆叠资源管理，可以在群集管理器配置中集成堆叠资源。有关在Pacemaker群集管理框架管理的群集中执行此操作的信息，请参见<<s-pacemaker-stacked-resources>>。

note: type: Title ===
en: Permanently diskless nodes
zh: 永久无盘节点

note: type: Plain text
en: A node might be permanently diskless in DRBD. Here is a configuration example showing a resource with 3 diskful nodes (servers) and one permanently diskless node (client).
zh: 在DRBD中，节点可能是永久无盘的。下面是一个配置示例，显示一个具有3个diskful节点（服务器）和一个永久无磁盘节点（客户端）的资源。

note: type: Plain text
en: For permanently diskless nodes no bitmap slot gets allocated. For such nodes the diskless status is displayed in green color since it is not an error or unexpected state.
zh: 对于永久无盘节点，不分配位图插槽。对于此类节点，无盘状态显示为绿色，因为它不是错误或意外状态。

note: type: delimited block =
en: This _DRBD client_ is an easy way to get data over the wire, but it doesn't have any of the advanced iSCSI features like _Persistent Reservations_. + If your setup has only basic I/O needs, like _read_, _write_, _trim_/_discard_ and perhaps _resize_ (e.g. for a virtual machine), you should be fine.
zh: 这个 _DRBD cliet_ 是一种通过网络获取数据的简单方法，但它没有任何高级的iSCSI功能，比如 _Persistent Reservations_。 + 如果您的设置只需要基本的I/O需求，比如 _read_, _write_, _trim_/_discard_  又或是 _resize_ (比如虚拟机），它应该会运转正常并满足基本的工作需求。

note: type: Title ===
en: Data rebalancing
zh: 数据再平衡

note: type: Plain text
en: indexterm:[rebalance]Given the (example) policy that data needs to be available on 3 nodes, you need at least 3 servers for your setup.
zh: indexterm:[rebalance]考虑到（示例）策略，即数据需要在3个节点上可用，您的设置至少需要3个服务器。

note: type: Plain text
en: Now, as your storage demands grow, you will encounter the need for additional servers. Rather than having to buy 3 more servers at the same time, you can _rebalance_ your data across a single additional node.
zh: 现在，随着存储需求的增长，您将需要更多的服务器。不必同时购买3台以上的服务器，您可以在一个额外的节点上重新平衡数据。

note: type: Block title
en: DRBD data rebalancing
zh: DRBD数据再平衡

note: type: Plain text
en: In the figure above you can see the _before_ and _after_ states: from 3 nodes with three 25TiB volumes each (for a net 75TiB), to 4 nodes, with net 100TiB.
zh: 在上图中，您可以看到 _before_ 和 _after_ 状态：从3个节点（每个节点有3个25TiB卷）（净容量 75TiB）到4个节点（净容量 100TiB）。

note: type: Plain text
en: To redistribute the data across your cluster you have to choose a _new_ node, and one where you want to remove this DRBD resource. + Please note that removing the resource from a currently _active_ node (i.e.  where DRBD is _Primary_) will involve either migrating the service or running this resource on this node as a <<s-drbd-client,DRBD client>>; it's easier to choose a node in _Secondary_ role. (Of course, that might not always be possible.)
zh: 要在集群中重新分配数据，必须选择一个 _新_ 的节点，以及一个要删除此DRBD资源的节点。+ 请注意，从当前 _活动_ 节点（即DRBD中 _主节点_ ）中删除资源将涉及迁移服务或作为<<s-drbd-client,DRBD client>>在此节点上运行此资源；更容易选择处于 _次要角色_ 的节点。（当然，这并不总是可能的。）

note: type: Title ====
en: Prepare a bitmap slot
zh: 准备位图插槽

note: type: Plain text
en: You will need to have a free <<s-quick-sync-bitmap,bitmap slot>> for temporary use, on each of the nodes that have the resource that is to be moved.
zh: 您需要在每个具有要移动的资源的节点上有一个空闲的<<s-quick-sync-bitmap,bitmap slot>>供临时使用。

note: type: Plain text
en: You can allocate one more at <<s-first-time-up,`drbdadm create-md` time>>, or simply put a placeholder in your configuration, so that `drbdadm` sees that it should reserve one more slot:
zh: 您可以使用<<s-first-time-up,`drbdadm create-md` time>>再分配一个，或者只需在您的配置中放置一个占位符，这样 `drbdadm` 看到后就会再保留一个插槽：

note: type: delimited block =
en: If you need to make that slot available during live use, you will have to
zh: 如果您需要在实时使用期间提供该插槽，则必须

note: type: delimited block =
en: dump the metadata,
zh: 转储元数据,

note: type: delimited block =
en: enlarge the metadata space,
zh: 扩大元数据空间,

note: type: delimited block =
en: edit the dumpfile,
zh: 编辑转储文件,

note: type: delimited block =
en: load the changed metadata.
zh: 加载更改后的元数据。

note: type: delimited block =
en: In a future version `drbdadm` will have a shortcut for you; most probably you'll be able to say `drbdadm resize --peers _N_` and have the kernel rewrite the metadata for you.
zh: 在未来的版本中，`drbdadm` 将为您提供一个快捷方式；很可能您可以通过使用 `drbdadm resize--peers _N_` ，并让内核为您重写元数据。

note: type: Title ====
en: Preparing and activating the new node
zh: 准备和激活新节点

note: type: Plain text
en: First of all you have to create the underlying storage volume on the new node (using e.g. `lvcreate`).  Then the placeholder in the configuration can be filled with the correct host name, address, and storage path. Now copy the resource configuration to all relevant nodes.
zh: 首先，您必须在新节点上创建基础存储卷（使用例如 `lvcreate` ）。然后，可以用正确的主机名、地址和存储路径填充配置中的占位符。现在将资源配置复制到所有相关节点。

note: type: Plain text
en: On the new node initialize the meta-data (once) by doing
zh: 在新节点上，通过执行以下操作初始化元数据（一次）

note: type: Title ====
en: Starting the initial sync
zh: 开始初始同步

note: type: Plain text
en: Now the new node needs to get the data.
zh: 现在新节点需要获取数据。

note: type: Plain text
en: This is done by defining the network connection on the existing nodes via
zh: 通过定义现有节点上的网络连接来完成操作

note: type: Plain text
en: and starting the DRBD device on the new node via
zh: 然后启动新节点上的DRBD设备

note: type: Title ====
en: Check connectivity
zh: 检查连接

note: type: Plain text
en: At this time please do a
zh: 现在运行

note: type: Plain text
en: on the new node, and check that _all_ other nodes are connected.
zh: 在新节点上，检查是否连接了所有其他节点。

note: type: Title ====
en: After the initial sync
zh: 初始同步后

note: type: Plain text
en: As soon as the new host is _UpToDate_, one of the other nodes in the configuration can be renamed to `for-later-rebalancing`, and kept for another migration.
zh: 只要新主机是 _UpToDate_ 的，配置中的其他节点之一就可以重命名为 `for-later-rebalancing` ，并保留以进行另一次迁移。

note: type: Plain text
en: Perhaps you want to comment the section; although that has the risk that doing a `drbdadm create-md` for a new node has too few bitmap slots for the next rebalancing. + It might be easier to use a reserved (unused) IP address and host name.
zh: 也许您想对该节进行注释；尽管这样做的风险是，为新节点执行 `drbdadm create md` 时，下次重新平衡的位图插槽太少。+ 使用保留（未使用）的IP地址和主机名可能更容易。

note: type: Plain text
en: Copy the changed configuration around again, and use it by running
zh: 再次复制更改的配置，并运行如下命令

note: type: Plain text
en: on all nodes.
zh: 在所有节点上。

note: type: Title ====
en: Cleaning up
zh: 清理

note: type: Plain text
en: On the one node that had the data up to now, but isn't used anymore for this resource, you can now take the DRBD device down by starting
zh: 在目前拥有数据但不再用于此资源的一个节点上，现在可以通过启动

note: type: Plain text
en: Now the lower level storage device isn't used anymore, and can either be re-used for other purposes or, if it is a logical volume, its space can be returned to the volume group via `lvremove`.
zh: 现在，较低级别的存储设备不再使用，可以重新用于其他目的，或者，如果它是逻辑卷，则可以通过 `lvremove` 将其空间返回给卷组。

note: type: Title ====
en: Conclusion and further steps
zh: 结论和进一步步骤

note: type: Plain text
en: One of the resources has been migrated to the new node. The same could be done for one or more other resources, to free space on two or three nodes in the existing cluster.
zh: 其中一个资源已迁移到新节点。对于一个或多个其他资源也可以这样做，以释放现有集群中两个或三个节点上的空间。

note: type: Plain text
en: Then new resources can be configured, as there're enough nodes with free space to achieve 3-way redundancy again.
zh: 然后可以配置新的资源，因为有足够的空闲空间节点可以再次实现3路冗余。

note: type: Plain text
en: Still, you might want to compare the steps above with the procedure when using DRBD Manage: <<s-dm-rebalance>>...
zh: 不过，在使用DRBD Manage时，您可能需要将上述步骤与过程进行比较： <<s-dm-rebalance>>...

note: type: Title ===
en: Configuring quorum
zh: 配置仲裁

note: type: Plain text
en: In order to avoid split brain or diverging data of replicas one has to configure fencing. All the options for fencing rely on redundant communication in the end.  That might be in the form of a management network that connects the nodes to the IPMI network interfaces of the peer machines. In case of the crm-fence-peer script it is necessary that Pacemakers communication stays available when DRBD's network link breaks.
zh: 为了避免复制品的裂脑或数据分散，必须配置围栏。所有的围栏策略最终都依赖于冗余通信。这可能是一个管理网络的形式，它将节点连接到对等机的IPMI网络接口。在crm-fence-peer脚本的情况下，当DRBD的网络链路断开时，Pacemakers通信必须保持可用。

note: type: Plain text
en: The quorum mechanism on the other hand takes a completely difference approach. The basic idea is that a cluster partition may only modify the replicated data set if the number of nodes that can communicate is greater then the half of the overall number of nodes. A node of such a partition _has quorum_.  On the other hand a node does not have quorum needs to guarantee that the replicated data set it not touched, that it does not create a diverging data set.
zh: 另一方面，仲裁机制则采取了完全不同的做法。基本思想是，如果可以通信的节点数大于总节点数的一半，那么集群分区只能修改复制的数据集。具备这样一个分区的节点 _具有仲裁_。另一方面，一个没有仲裁权的节点需要保证它没有接触到复制的数据集，它不会创建一个发散的数据集。

note: type: Plain text
en: The quorum implementation in DRBD gets enabled by setting the `quorum` resource option to `majority`, `all` or a numeric value. Where `majority` selects the behavior that was described in the previous paragraph.
zh: 通过将 `quorum` 资源选项设置为 `majority` 、`all` 或某个数值，可以启用DRBD中的仲裁实现。其中 `majority` 就是上一段中描述的行为。

note: type: Title ====
en: Guaranteed minimal redundancy
zh: 保证最小冗余

note: type: Plain text
en: By default every node with a disk gets a vote in the quorum election. In other words only diskless nodes do not count. So a partition with two _Inconsistent_ disks gets quorum, while a partition with one _UpToDate_ node will have quorum in a 3 node cluster. By configuring `quorum-minimum-redundancy` this behavior can be changed so that only nodes that are `UpToDate` have a vote in the quorum election. The option takes the same arguments as the `quorum` option.
zh: 默认情况下，具有磁盘的每个节点都可以在仲裁选举中获得投票权。换句话说，只有无盘节点不计算在内。因此，具有两个 _不一致磁盘_ 的分区将获得仲裁，而具有一个 _UpToDate_ 分区的节点将在3节点群集中具有仲裁。通过配置  `quorum minimum redundancy` ，可以更改此行为，以便使得只有 `UpToDate` 节点在quorum选举中有投票权。该选项采用与 `quorum` 选项相同的参数。

note: type: Plain text
en: With this option you express that you rather want to wait until eventually necessary resync operations finish before any services start. So in a way you prefer that the minimal redundancy of your data is guaranteed over the availability of your service. Financial data and services is an example that comes to mind.
zh: 使用此选项，表示您更希望等到最终必要的重新同步操作完成后再启动任何服务。因此，在某种程度上，您希望数据的最小冗余比服务的可用性得到保证。金融数据和服务就是一个浮现在脑海中的例子。

note: type: Plain text
en: Consider following example for a 5 node cluster. It requires a partitions to have at least 3 nodes, and two of them must be `UpToDate`:
zh: 考虑以下5节点集群的示例。它要求一个分区至少有3个节点，其中两个必须是 `UpToDate`：

note: type: Title ====
en: Actions on loss of quorum
zh: 丧失仲裁后的动作

note: type: Plain text
en: When a node that is running the service loses quorum it needs to cease write-operations on the data set immediately. That means that IO immediately starts to complete all IO requests with errors. Usually that means that a graceful shutdown is not possible, since that would require more modifications to the data set. The IO errors propagate from the block level to the file system and from the file system to the user space application(s).
zh: 当运行服务的节点失去仲裁时，它需要立即停止对数据集的写操作。这意味着IO会立即开始完成所有有错误的IO请求。通常这意味着不可能正常关闭，因为这需要对数据集进行更多修改。IO错误从块级别传播到文件系统，从文件系统传播到用户空间应用程序。

note: type: Plain text
en: Ideally the application simply terminates in case of IO errors. This allows then Pacemaker to unmount the filesystem and to demote the DRBD resource to secondary role.  If that is true you should set the `on-no-quorum` resource option to `io-error`.  Here is an example:
zh: 理想情况下，应用程序会在IO错误时终止。这允许Pacemaker卸载文件系统并将DRBD资源降级为次要角色。如果是这样，则应将 `on-no-quorum`  资源选项设置为 `io-error` 。下面是一个例子：

note: type: Plain text
en: If you application does not terminate on the first IO error, you can choose to freeze IO instead and to reboot the node. Here is a configuration example:
zh: 如果应用程序未在第一个IO错误时终止，则可以选择冻结IO并重新启动节点。下面是一个配置示例：

note: type: Title ====
en: Using a diskless node as a tiebreaker
zh: 使用无盘节点作为分层断路器

note: type: Plain text
en: A diskless node with connections to all nodes in a cluster can be utilized to break ties in the quorum negotiation process.
zh: 在仲裁协商过程中，可以使用连接到群集中所有节点的无盘节点来断开连接。

note: type: Plain text
en: Consider the following two-node cluster, where node A is the primary and node B is a secondary:
zh: 考虑以下两个节点群集，其中节点A是主节点，节点B是次节点：

note: type: Plain text
en: As soon as the connection between the two nodes is interrupted, they lose quorum and the application on top of the cluster cannot write data anymore.
zh: 一旦两个节点之间的连接中断，它们就会失去仲裁，并且集群顶部的应用程序无法再写入数据。

note: type: Plain text
en: Now if we add a third node, C, to the cluster and configure it as diskless, we can take advantage of the tiebreaker mechanism.
zh: 现在，如果我们将第三个节点C添加到集群并将其配置为无磁盘节点，我们就可以利用tiebraker机制。

note: type: Plain text
en: In this case, when the primary and secondary nodes lose connection, they can still "see" the diskless tiebreaker. Because of this, the primary can continue working, while the secondary demotes its disk to Outdated and the service can therefore not be migrated there.
zh: 在这种情况下，当主节点和辅助节点失去连接时，它们仍然可以 "看到" 无盘分层断路器。因此，主磁盘可以继续工作，而次磁盘将其磁盘降级为过期磁盘，因此无法在那里迁移服务。

note: type: Plain text
en: There are a few special cases in case two connections fail. Consider the following scenario:
zh: 有一些特殊情况，以防两个连接失败。考虑以下场景：

note: type: Plain text
en: In this case, the tiebreaker node forms a partition with the primary node. The primary therefore keeps quorum, while the secondary becomes outdated. Note that the secondarys disk state will be "UpToDate", but regardless it cannot be promoted to primary because it lacks quorum.
zh: 在这种情况下，tiebreaker节点与主节点形成一个分区。因此，主服务器保留仲裁，而次服务器过时。请注意，secondarys磁盘状态将为 "UpToDate"，但无论如何都不能将其提升为primary，因为它缺少仲裁。

note: type: Plain text
en: Let's consider the possibility of the primary losing connection to the tiebreaker:
zh: 让我们考虑一下主断路器断开连接的可能性：

note: type: Plain text
en: In this case, the primary becomes unusable and goes into a "quorum suspended" state. This effectively results in the application on top of DRBD receiving I/O errors. A cluster manager could then promote node B to primary and keep the service running there instead.
zh: 在这种情况下，主服务器将变得不可用，并进入 "quorum suspended" 状态。这有效地导致应用程序在DRBD之上接收I/O错误。然后，集群管理器可以将节点B提升为主节点，并使服务在那里运行。

note: type: Plain text
en: In case the diskless tiebreaker "switches sides", we need to avoid data divergence. Consider this scenario:
zh: 如果无盘分层断路器 "切换侧"，则需要避免数据发散。考虑这个场景：

note: type: Plain text
en: The connection between the primary and secondary has failed, and the application is continuing to run on the primary, when the primary suddenly loses its connection to the diskless node.
zh: 主节点和辅助节点之间的连接失败，应用程序继续在主节点上运行，此时主节点突然失去与无盘节点的连接。

note: type: Plain text
en: In this case, no node can be promoted to primary and the cluster cannot continue to operate.
zh: 在这种情况下，无法将任何节点升级到主节点，并且群集无法继续运行。

note: type: delimited block =
en: Protecting from data divergence always takes priority over ensuring service availability.
zh: 防止数据差异始终优先于确保服务可用性。

note: type: Plain text
en: Let's look at another scenario:
zh: 让我们看看另一个场景：

note: type: Plain text
en: Here, the application is running on the primary, while the secondary is unavailable. Then, the tiebreaker first loses connection to the primary, and then reconnects to the secondary.  It is important to note here that *a node that has lost quorum cannot regain quorum by connecting to a diskless node*. Thus, in this case, no node has quorum and the cluster halts.
zh: 在这里，应用程序在主服务器上运行，而辅助服务器不可用。然后，tiebraker首先断开与主节点的连接，然后重新连接到辅助节点。这里需要注意的是， *失去仲裁的节点无法通过连接到无盘节点* 来重新获得仲裁。因此，在这种情况下，没有节点具有仲裁，集群将停止。

note: type: Title ====
en: Last man standing
zh: 最后站着的人

note: type: Plain text
en: It needs to be mentioned that nodes that leave a cluster gracefully are counted different than failed nodes. In this context _leaving gracefully_ means that the leaving node marked it's data as Outdated, and that it was able to tell the remaining nodes that it's data is Outdated.
zh: 需要指出的是，优雅地离开集群的节点与失败节点的计数不同。在此上下文中， _优雅地离开_ 意味着离开节点将其数据标记为过时，并且它能够告诉其余节点其数据已过时。

note: type: Plain text
en: In a group of nodes where all disks are Outdated no one in that group can promote to Primary footnote:[The exception is a manual promotion with the --force flag. We assume that one that uses the --force knows what he is doing.].
zh: 在所有磁盘都已过期的节点组中，该组中的任何人都无法升级到主角色 footnote:[例外情况是使用--force标志进行手动升级。我们假设使用--force的人知道他在做什么]。

note: type: Plain text
en: An implication is that, if a cluster is left by all but one node, it can keep quorum as long as all the others left in a graceful way. If a single node leaves ungraceful, it has to assume that all away nodes form a patition and have access to up-to-date data. If the other partition might (potentially) be larger than my own partition it looses quorum.
zh: 这意味着，如果一个集群只剩下一个节点，那么只要其他所有节点都以优雅的方式离开，它就可以保留仲裁。如果一个节点没有运行，它必须假设所有离开的节点都形成一个patition并可以访问最新的数据。如果另一个分区可能（潜在地）比其自身的分区大，那么它将释放仲裁。
