en to zh translation catalogue (123 entries)

note: type: Title ===
en: Configuring DRBD
zh: 配置DRBD

note: type: Title ====
en: Preparing your lower-level storage
zh: 准备底层存储

note: type: Plain text
en: After you have installed DRBD, you must set aside a roughly identically sized storage area on both cluster nodes. This will become the _lower-level device_ for your DRBD resource. You may use any type of block device found on your system for this purpose. Typical examples include:
zh: 安装完DRBD之后，必须在两个集群节点上留出大致相同大小的存储区域。这将成为DRBD资源的底层设备。为此，您可以使用系统上找到的任何类型的块设备。典型示例包括：

note: type: Plain text
en: A hard drive partition (or a full physical hard drive),
zh: 硬盘分区（或完整的物理硬盘驱动器），

note: type: Plain text
en: a software RAID device,
zh: 一个软件RAID设备，

note: type: Plain text
en: an LVM Logical Volume or any other block device configured by the Linux device-mapper infrastructure,
zh: LVM逻辑卷或由Linux device-mapper配置出的任何其他块设备，

note: type: Plain text
en: any other block device type found on your system.
zh: 在系统上找到的任何其他块设备类型。

note: type: Plain text
en: You may also use _resource stacking_, meaning you can use one DRBD device as a lower-level device for another. Some specific considerations apply to stacked resources; their configuration is covered in detail in <<s-three-nodes>>.
zh: 您也可以使用 _资源堆叠_ ，这意味着您可以将一个DRBD设备用作另一个底层设备。使用堆叠资源有一些特定注意事项；它们的配置在<<s-three-nodes>>中有详细介绍。

note: type: Plain text
en: While it is possible to use loop devices as lower-level devices for DRBD, doing so is not recommended due to deadlock issues.
zh: 虽然可以使用环路设备(loop devices)作为DRBD的底层设备，但由于死锁问题，不建议这样做。

note: type: Plain text
en: It is _not_ necessary for this storage area to be empty before you create a DRBD resource from it. In fact it is a common use case to create a two-node cluster from a previously non-redundant single-server system using DRBD (some caveats apply -- please refer to <<s-metadata>> if you are planning to do this).
zh: 在某个存储区域中创建DRBD资源之前，_不_ 需要将其设置为空。事实上，通常利用DRBD从以前的非冗余单服务器系统中创建出双节点集群。（如果您计划这样做，请参考<<s-metadata>>）。

note: type: Plain text
en: For the purposes of this guide, we assume a very simple setup:
zh: 在本指南中，我们假设一个非常简单的设置：

note: type: Plain text
en: Both hosts have a free (currently unused) partition named `/dev/sda7`.
zh: 两台主机都有一个名为 `/dev/sda7` 的可用（当前未使用）分区。

note: type: Plain text
en: We are using <<s-internal-meta-data,internal meta data>>.
zh: 我们选择使用<<s-internal-meta-data,internal meta data>>。

note: type: Title ====
en: Preparing your network configuration
zh: 准备网络配置

note: type: Plain text
en: It is recommended, though not strictly required, that you run your DRBD replication over a dedicated connection. At the time of this writing, the most reasonable choice for this is a direct, back-to-back, Gigabit Ethernet connection. When DRBD is run over switches, use of redundant components and the _bonding_ driver (in _active-backup_ mode) is recommended.
zh: 虽然不是严格要求，但建议您通过专用连接运行DRBD复制。在撰写本文时，最合理的选择是直接、背对背(back-to-back)、千兆以太网连接。当DRBD在交换机网络上运行时，建议使用冗余组件和 _bonding_ 驱动程序（在 _active-backup_ 模式下）。

note: type: Plain text
en: It is generally not recommended to run DRBD replication via routers, for reasons of fairly obvious performance drawbacks (adversely affecting both throughput and latency).
zh: 通常不建议通过路由器网络运行DRBD复制，因为存在相当明显的性能缺陷（对吞吐量和延迟都有不利影响）。

note: type: Plain text
en: In terms of local firewall considerations, it is important to understand that DRBD (by convention) uses TCP ports from 7788 upwards, with every resource listening on a separate port. DRBD uses _two_ TCP connections for every resource configured. For proper DRBD functionality, it is required that these connections are allowed by your firewall configuration.
zh: 就本地防火墙的考虑而言，重要的是要理解DRBD（按惯例）使用7788以上的TCP端口，每个资源都在一个单独的端口上监听。DRBD对每个配置的资源使用两个TCP连接。为了实现正确的DRBD功能，防火墙配置必须允许这些连接。

note: type: Plain text
en: Security considerations other than firewalling may also apply if a Mandatory Access Control (MAC) scheme such as SELinux or AppArmor is enabled. You may have to adjust your local security policy so it does not keep DRBD from functioning properly.
zh: 如果启用了诸如SELinux或AppArmor之类的强制访问控制（MAC）方案，则除防火墙之外的安全考虑也可能适用。您可能需要调整本地安全策略，使其无法使DRBD正常工作。

note: type: Plain text
en: You must, of course, also ensure that the TCP ports for DRBD are not already used by another application.
zh: 当然，您还必须确保DRBD的TCP端口尚未被其他应用程序使用。

note: type: Plain text
en: It is not (yet) possible to configure a DRBD resource to support more than one TCP connection pair. If you want to provide for DRBD connection load-balancing or redundancy, you can easily do so at the Ethernet level (again, using the _bonding_ driver).
zh: 目前还不能配置DRBD资源来支持多个TCP连接对。如果您想提供DRBD连接负载平衡或冗余，那么您可以在以太网级别（再次提醒，使用 _bonding_ 设备）轻松地做到这一点。

note: type: Plain text
en: Our two DRBD hosts each have a currently unused network interface, `eth1`, with IP addresses `10.1.1.31` and `10.1.1.32` assigned to it, respectively.
zh: 我们的两台DRBD主机都有一个当前未使用的网络接口eth1，其IP地址分别为 `10.1.1.31` 和 `10.1.1.32` 。

note: type: Plain text
en: No other services are using TCP ports 7788 through 7799 on either host.
zh: 无其他服务在任一主机上使用TCP端口7788到7799。

note: type: Plain text
en: The local firewall configuration allows both inbound and outbound TCP connections between the hosts over these ports.
zh: 本地防火墙配置允许主机之间通过这些端口进行入站和出站TCP连接。

note: type: Title ====
en: Configuring your resource
zh: 配置资源

note: type: Plain text
en: All aspects of DRBD are controlled in its configuration file, `/etc/drbd.conf`. Normally, this configuration file is just a skeleton with the following contents:
zh: DRBD的所有选项都在其配置文件 `/etc/DRBD.conf` 中进行控制。通常，此配置文件只是具有以下内容的框架：

note: type: Plain text
en: By convention, `/etc/drbd.d/global_common.conf` contains the <<s-drbdconf-global,`global`>> and <<s-drbdconf-common,`common`>> sections of the DRBD configuration, whereas the `.res` files contain one <<s-drbdconf-resource,`resource`>> section each.
zh: 按照惯例，`/etc/drbd.d/global_common.conf` 包含drbd配置的<<s-drbdconf-global,`global`>>和<<s-drbdconf-common,`common`>>部分，而 `.res` 文件包含每个<<s-drbdconf-resource,`resource`>>部分。

note: type: Plain text
en: It is also possible to use `drbd.conf` as a flat configuration file without any `include` statements at all. Such a configuration, however, quickly becomes cluttered and hard to manage, which is why the multiple-file approach is the preferred one.
zh: 也可以使用 `drbd.conf` 作为一个单一配置文件，而不使用任何 `include` 语句。然而，这样的配置很快就会变得杂乱无章，难以管理，这就是为什么多文件方法是首选的方法。

note: type: Plain text
en: Regardless of which approach you employ, you should always make sure that `drbd.conf`, and any other files it includes, are _exactly identical_ on all participating cluster nodes.
zh: 无论采用哪种方法，都应该始终确保所有参与集群节点上的 `drbd.conf` 及其包含的任何其他文件 _完全相同_ 。

note: type: Plain text
en: The DRBD source tarball contains an example configuration file in the `scripts` subdirectory. Binary installation packages will either install this example configuration directly in `/etc`, or in a package-specific documentation directory such as `/usr/share/doc/packages/drbd`.
zh: DRBD 源码压缩包解压后， 在 `scripts` 子目录中包含一个示例配置文件。二进制安装包将直接在 `/etc` ，或在 `/usr/share/doc/packages/drbd` 等由安装包定义出的文档目录中安装此示例配置。

note: type: Plain text
en: This section describes only those few aspects of the configuration file which are absolutely necessary to understand in order to get DRBD up and running. The configuration file's syntax and contents are documented in great detail in the man page of `drbd.conf`.
zh: 本节仅描述配置文件的几个部分，这些部分对于使DRBD启动和运行是绝对必要的。配置文件的语法和内容在 `drbd.conf` 的手册页中有详细的说明。

note: type: Title =====
en: Example configuration
zh: 示例配置

note: type: Plain text
en: For the purposes of this guide, we assume a minimal setup in line with the examples given in the previous sections:
zh: 在本指南中，我们假设按照前面章节中给出的示例进行最小设置：

note: type: Block title
en: Simple DRBD configuration (`/etc/drbd.d/global_common.conf`)
zh: 简单的DRBD配置（ `/etc/DRBD.d/global_common.conf` ）

note: type: Block title
en: Simple DRBD resource configuration (`/etc/drbd.d/r0.res`)
zh: 简单的DRBD资源配置( `/etc/drbd.d/rc0.res` )

note: type: Plain text
en: This example configures DRBD in the following fashion:
zh: 此示例按以下方式配置DRBD：

note: type: Plain text
en: You "opt in" to be included in DRBD's usage statistics (see <<fp-usage-count>>).
zh: 您 "决定参加" 将包含在DRBD的使用统计信息中 (参见 <<fp-usage-count>>)。

note: type: Plain text
en: Resources are configured to use fully synchronous replication (<<s-replication-protocols,Protocol C>>) unless explicitly specified otherwise.
zh: 除非另有明确规定，否则资源配置为使用完全同步复制（<<s-replication-protocols,Protocol C>>）。

note: type: Plain text
en: Our cluster consists of two nodes, 'alice' and 'bob'.
zh: 我们的集群由两个节点 `alice` 和 `bob` 组成。

note: type: Plain text
en: We have a resource arbitrarily named `r0` which uses `/dev/sda7` as the lower-level device, and is configured with <<s-internal-meta-data,internal meta data>>.
zh: 我们有一个命名为 `r0` 的资源，它使用 `/dev/sda7` 作为低级设备，并配置了<<s-internal-meta-data,internal meta data>>。

note: type: Plain text
en: The resource uses TCP port 7789 for its network connections, and binds to the IP addresses 10.1.1.31 and 10.1.1.32, respectively.  (This implicitly defines the network connections that are used.)
zh: 资源使用TCP端口7789进行网络连接，并分别绑定到IP地址10.1.1.31和10.1.1.32。（这将隐式定义所使用的网络连接。）

note: type: Plain text
en: The configuration above implicitly creates one volume in the resource, numbered zero (`0`). For multiple volumes in one resource, modify the syntax as follows (assuming that the same lower-level storage block devices are used on both nodes):
zh: 上面的配置隐式地在资源中创建一个卷，编号为0（ `0` ）。对于一个资源中的多个卷，请按如下所示修改语法（假设两个节点上使用相同的底层存储块设备）：

note: type: Block title
en: Multi-volume DRBD resource configuration (`/etc/drbd.d/r0.res`)
zh: 多卷DRBD资源配置（ `/etc/drbd.d/rc0.res` )

note: type: Plain text
en: Volumes may also be added to existing resources on the fly. For an example see <<s-lvm-add-pv>>.
zh: 卷也可以动态添加到现有资源中。有关示例，请参见<<s-lvm-add-pv>>。

note: type: Title =====
en: The `global` section
zh:  `global` 部分

note: type: Plain text
en: This section is allowed only once in the configuration. It is normally in the `/etc/drbd.d/global_common.conf` file. In a single-file configuration, it should go to the very top of the configuration file. Of the few options available in this section, only one is of relevance to most users:
zh: 此部分在配置中只允许使用一次。它通常位于 `/etc/drbd.d/global_common.conf` 文件中。在单个文件配置中，它应该位于配置文件的最顶端。在本节提供的少数选项中，只有一个与大多数用户相关：

note: type: Plain text
en: The DRBD project keeps statistics about the usage of various DRBD versions. This is done by contacting an HTTP server every time a new DRBD version is installed on a system. This can be disabled by setting `usage-count no;`.  The default is `usage-count ask;` which will prompt you every time you upgrade DRBD.
zh: DRBD项目保存关于各种DRBD版本使用情况的统计信息。这是通过每次在系统上安装新的DRBD版本时联系官方HTTP服务器来完成的。这可以通过设置 `usage count no；` 禁用。默认值是 `usage count ask；` ，每次升级DRBD时都会提示您。

note: type: Plain text
en: DRBD's usage statistics are, of course, publicly available: see http://usage.drbd.org.
zh: 当然，DRBD的使用统计数据是公开的：参见http://usage.DRBD.org。

note: type: Title =====
en: The `common` section
zh:  `common` 部分

note: type: Plain text
en: This section provides a shorthand method to define configuration settings inherited by every resource. It is normally found in `/etc/drbd.d/global_common.conf`. You may define any option you can also define on a per-resource basis.
zh: 本节提供了一个速记方法来定义每个资源继承的配置设置。它通常位于 `/etc/drbd.d/global_common.conf` 。您可以定义任何选项，也可以基于每个资源定义。

note: type: Plain text
en: Including a `common` section is not strictly required, but strongly recommended if you are using more than one resource. Otherwise, the configuration quickly becomes convoluted by repeatedly-used options.
zh: 严格来说，不需要包含 `common` 部分，但如果您使用多个资源，则强烈建议您这样做。否则，重复使用的选项会使配置很快变得复杂。

note: type: Plain text
en: In the example above, we included `net { protocol C; }` in the `common` section, so every resource configured (including `r0`)  inherits this option unless it has another `protocol` option configured explicitly. For other synchronization protocols available, see <<s-replication-protocols>>.
zh: 在上面的示例中，我们在 `common` 部分中包含了 `net {protocol C; }` ”，因此每个配置的资源（包括 `r0` ）都继承此选项，除非它显式配置了另一个 `protocol` 选项。有关可用的其他同步协议，请参见<<s-replication-protocols>>。

note: type: Title =====
en: The `resource` sections
zh:  `resource` 部分

note: type: Plain text
en: A per-resource configuration file is usually named `/etc/drbd.d/__resource__.res`.  Any DRBD resource you define must be named by specifying a resource name in the configuration. The convention is to use only letters, digits, and the underscore; while it is technically possible to use other characters as well, you won't like the result if you ever happen stumble to need the more specific `__peer__@__resource__/__volume__` syntax.
zh: 每个资源配置文件通常命名为 `/etc/drbd.d/__resource__.res` 您定义的任何DRBD资源都必须通过在配置中指定资源名称来命名。惯例是只使用字母、数字和下划线；虽然在技术上也可以使用其他字符，但如果碰巧例如 `__peer__@__resource__/__volume__` 格式的命名时，可能会让您困惑不已。

note: type: Plain text
en: Every resource configuration must also have at least two `on _host_` sub-sections, one for every cluster node. All other configuration settings are either inherited from the `common` section (if it exists), or derived from DRBD's default settings.
zh: 每个资源配置还必须至少有两个 `on _host_` 子字节，每个群集节点一个。所有其他配置设置要么继承自 `common` 部分（如果存在），要么派生自DRBD的默认设置。

note: type: Plain text
en: In addition, options with equal values on all hosts can be specified directly in the `resource` section. Thus, we can further condense our example configuration as follows:
zh: 此外，可以在 `resource` 部分直接指定在所有主机上具有相同值的选项。因此，我们可以进一步压缩示例配置如下：

note: type: Title ====
en: Defining network connections
zh: 定义网络连接

note: type: Plain text
en: Currently the communication links in DRBD 9 must build a full mesh, i.e. in every resource every node must have a direct connection to every other node (excluding itself, of course).
zh: 目前，DRBD 9中的通信链路必须建立一个完整的网格，即在每个资源中，每个节点都必须与每个其他节点（当然，不包括自身）有直接连接。

note: type: Plain text
en: For the simple case of two hosts `drbdadm` will insert the (single) network connection by itself, for ease of use and backwards compatibility.
zh: 对于两台主机的简单情况， `drbdadm` 将自行插入（单个）网络连接，以便于使用和向后兼容。

note: type: Plain text
en: The net effect of this is a quadratic number of network connections over hosts. For the "traditional" two nodes one connection is needed; for three hosts there are three node pairs; for four, six pairs; 5 hosts: 10 connections, and so on. For (the current)  maximum of 16 nodes there'll be 120 host pairs to connect.
zh: 其净效果是主机上网络连接的二次方数量。对于"传统"的两个节点，需要一个连接；对于三个主机，有三个节点对；对于四个主机, 有六个节点对；对于五个主机，有十个连接，依此类推。对于（当前的）最多16个节点，将有120个主机对需要连接。

note: type: Block title
en: Number of connections for _N_ hosts
zh: _N_ 个主机的连接数

note: type: Plain text
en: An example configuration file for three hosts would be this:
zh: 三台主机的配置文件示例如下：

note: type: Plain text
en: If you have got enough network cards in your servers, you can create direct cross-over links between server pairs.  A single four-port ethernet card allows to have a single management interface, and to connect 3 other servers, to get a full mesh for 4 cluster nodes.
zh: 如果服务器中有足够的网卡，则可以在服务器对之间创建直接交叉链接。一个四端口以太网卡允许有一个单一的管理接口，并连接3个其他服务器，以获得4个群集节点的完整网格。

note: type: Plain text
en: In this case you can specify a different IP address to use the direct link:
zh: 在这种情况下，可以指定其他节点的IP地址以使用直接链接：

note: type: Plain text
en: For easier maintenance and debugging it's recommend to have different ports for each endpoint - looking at a `tcpdump` trace the packets can be associated easily.
zh: 为了便于维护和调试，建议为每个端点使用不同的端口 - 查看 `tcpdump` 跟踪数据包的结果，从而很容易地将其关联起来。

note: type: Plain text
en: The examples below will still be using two servers only; please see <<s-4node-example>> for a four-node example.
zh: 下面的示例仍将仅使用两台服务器；请参见<<s-4node-example>>了解四节点示例。

note: type: Title ====
en: Configuring transport implementations
zh: 配置传输实现

note: type: Plain text
en: DRBD supports multiple network transports. A transport implementation can be configured for each connection of a resource.
zh: DRBD支持多种网络传输。可以为资源的每个连接配置传输实现。

note: type: Title =====
en: TCP/IP
zh: TCP/IP协议

note: type: Plain text
en: `tcp` is the default transport. I.e. each connection that lacks a transport option uses the `tcp` transport.
zh: `tcp` 是默认传输协议。即：每个缺少配置传输选项的连接默认使用 `tcp` 传输。

note: type: Plain text
en: The `tcp` transport can be configured with the net options: `sndbuf-size`, `rcvbuf-size`, `connect-int`, `sock-check-timeo`, `ping-timeo`, `timeout`.
zh: `tcp` 传输可以使用以下网络选项进行配置： `sndbuf size` 、`rcvbuf size` 、`connect int` 、 `sock check timeo` 、`ping timeo` 、`timeout` 。

note: type: Plain text
en: The `rdma` transport can be configured with the net options: `sndbuf-size`, `rcvbuf-size`, `max_buffers`, `connect-int`, `sock-check-timeo`, `ping-timeo`, `timeout`.
zh: `rdma` 传输可以使用以下网络选项配置：`sndbuf size` 、`rcvbuf size` 、`max_buffers` 、`connect int` 、`sock check timeo` 、`ping timeo` 、`timeout` 。

note: type: Plain text
en: The `rdma` transport is a zero-copy-receive transport. One implication of that is that the `max_buffers` configuration options must be set to a value big enough to hold all `rcvbuf-size`.
zh: `rdma` 传输是零拷贝接收传输。这意味着 `max_buffers` 配置选项必须设置为足以容纳所有 `rcvbuf size` 的值。

note: type: Plain text
en: `rcvbuf-size` is configured in bytes, while `max_buffers` is configured in pages. For optimal performance `max_buffers` should be big enough to hold all of `rcvbuf-size` and the amount of data that might be in flight to the backend device at any point in time.
zh: `rcvbuf size` 以字节为单位配置，`max_buffers` 以页为单位配置。为了获得最佳性能，`max_buffers` 应该足够大，可以容纳所有 `rcvbuf size` 和在任何时间点可能传输到后端设备的数据量。

note: type: Plain text
en: In case you are using InfiniBand HCAs with the `rdma` transport, you need to configure IPoIB as well. The IP address is not used for data transfer, but it is used to find the right adapters and ports while establishing the connection.
zh: 如果您将InfiniBand HCAs与 `rdma` 传输一起使用，则还需要配置IPoIB。IP地址不用于数据传输，但用于在建立连接时找到正确的适配器和端口。

note: type: Plain text
en: The configuration options `sndbuf-size`, `rcvbuf-size` are only considered at the time a connection is established. I.e. you can change them while the connection is established. They will take effect in the moment the connection is re-established.
zh: 只有在建立连接时才考虑配置选项 `sndbuf size` 、`rcvbuf size` 。即: 如果你在连接已建立时更改它们。它们将在重新建立连接时生效。

note: type: Title =====
en: Performance considerations for RDMA
zh: RDMA的性能考虑

note: type: Plain text
en: By looking at the pseudo file _/sys/kernel/debug/drbd/<resource>/connections/<peer>/transport_, the counts of available receive descriptors (rx_desc) and transmit descriptors (tx_desc)  can be monitored. In case one of the descriptor kinds becomes depleted you should increase `sndbuf-size` or `rcvbuf-size`.
zh: 通过查看pseudo文件 _/sys/kernel/debug/drbd/<resource>/connections/<peer>/transport_ ，可以监视可用接收描述符（rx_desc）和传输描述符（tx_desc）的计数。如果某个描述符类型耗尽，则应增加 `sndbuf size` ”或  `rcvbuf size` 。

note: type: Title ====
en: Enabling your resource for the first time
zh: 首次启用资源

note: type: Plain text
en: After you have completed initial resource configuration as outlined in the previous sections, you can bring up your resource.
zh: 在您完成了前面章节中概述的初始资源配置之后，您可以启用您定义的资源。

note: type: Plain text
en: Each of the following steps must be completed on both nodes.
zh: 必须在两个节点上完成以下每个步骤。

note: type: Plain text
en: Please note that with our example config snippets (`resource r0 { ... }`), `<resource>` would be `r0`.
zh: 请注意，使用我们的示例配置片段（ `resource r0 { ... }` )时， `<resource>` 将是 `r0` 。

note: type: Block title
en: Create device metadata
zh: 创建设备元数据

note: type: Plain text
en: This step must be completed only on initial device creation. It initializes DRBD's metadata:
zh: 此步骤只能在初始设备创建时完成。它初始化DRBD的元数据：

note: type: Plain text
en: Please note that the number of bitmap slots that are allocated in the meta-data depends on the number of hosts for this resource; per default the hosts in the resource configuration are counted.  If all hosts are specified _before_ creating the meta-data, this will "just work"; adding bitmap slots for further nodes is possible later, but incurs some manual work.
zh: 请注意，元数据中分配的位图插槽(bitmap slots)数量取决于此资源的主机数量；默认情况下，资源配置中的主机将被计算在内。如果在创建元数据 _之前_ 指定了所有主机，这将 "正常工作"；以后可以为更多节点添加位图插槽(bitmap slots)，但需要一些手动操作。

note: type: Block title
en: Enable the resource
zh: 启用资源

note: type: Plain text
en: This step associates the resource with its backing device (or devices, in case of a multi-volume resource), sets replication parameters, and connects the resource to its peer:
zh: 此步骤将资源与其备份设备（如果是多卷资源，则为多个设备）关联，设置复制参数，并将资源连接到其对等方：

note: type: Block title
en: Observe the status via `drbdadm status`
zh: 运行 `drbdadm status` 观察状态变化

note: type: Plain text
en: ``drbdsetup``'s status output should now contain information similar to the following:
zh: ``drbdsetup`` 的状态输出现在应该包含类似于以下内容的信息：

note: type: Plain text
en: The _Inconsistent/Inconsistent_ disk state is expected at this point.
zh: 此时磁盘状态应该是 _Inconsistent/Inconsistent_ 。

note: type: Plain text
en: By now, DRBD has successfully allocated both disk and network resources and is ready for operation. What it does not know yet is which of your nodes should be used as the source of the initial device synchronization.
zh: 到目前为止，DRBD已经成功地分配了磁盘和网络资源，并准备就绪。然而它还不知道应该使用哪个节点作为初始设备同步的源。

note: type: Title ====
en: The initial device synchronization
zh: 初始设备同步

note: type: Plain text
en: There are two more steps required for DRBD to become fully operational:
zh: 要使DRBD完全运行，还需要两个步骤：

note: type: Block title
en: Select an initial sync source
zh: 选择初始同步源

note: type: Plain text
en: If you are dealing with newly-initialized, empty disks, this choice is entirely arbitrary. If one of your nodes already has valuable data that you need to preserve, however, _it is of crucial importance_ that you select that node as your synchronization source.  If you do initial device synchronization in the wrong direction, you will lose that data. Exercise caution.
zh: 如果处理的是新初始化的空磁盘，则此选择完全是任意的。但是，如果您的某个节点已经有需要保留的有价值的数据，则选择该节点作为同步源至关重要。如果在错误的方向上执行初始设备同步，则会丢失该数据。这点要非常小心。

note: type: Block title
en: Start the initial full synchronization
zh: 启动初始化全量同步

note: type: Plain text
en: This step must be performed on only one node, only on initial resource configuration, and only on the node you selected as the synchronization source. To perform this step, issue this command:
zh: 此步骤只能在一个节点上执行，只能在初始资源配置上执行，并且只能在您选择作为同步源的节点上执行。要执行此步骤，请输入以下命令：

note: type: Plain text
en: After issuing this command, the initial full synchronization will commence. You will be able to monitor its progress via `drbdadm status`. It may take some time depending on the size of the device.
zh: 发出此命令后，将启动初始化全量同步。您将能够通过 `drbdadm status` 监视其进度。根据设备的大小，可能需要一些时间。

note: type: Plain text
en: By now, your DRBD device is fully operational, even before the initial synchronization has completed (albeit with slightly reduced performance). If you started with empty disks you may now already create a filesystem on the device, use it as a raw block device, mount it, and perform any other operation you would with an accessible block device.
zh: 现在，您的DRBD设备已经完全运行，甚至在初始化同步完成之前（尽管性能略有降低）。如果从空磁盘开始，现在可能已经在设备上创建了一个文件系统，将其用作原始块设备，挂载它，并对可访问的块设备执行任何其他操作。

note: type: Plain text
en: You will now probably want to continue with <<p-work>>, which describes common administrative tasks to perform on your resource.
zh: 您现在可能需要继续执行<<p-work>>，它描述了要在资源上执行的常见管理任务。

note: type: Title ====
en: Using truck based replication
zh: 使用基于卡车的复制

note: type: Plain text
en: In order to preseed a remote node with data which is then to be kept synchronized, and to skip the initial full device synchronization, follow these steps.
zh: 为了向远程节点预先设定数据，然后保持同步，并跳过初始的全量设备同步，请执行以下步骤。

note: type: Plain text
en: This assumes that your local node has a configured, but disconnected DRBD resource in the _Primary_ role.  That is to say, device configuration is completed, identical `drbd.conf` copies exist on both nodes, and you have issued the commands for <<s-initial-full-sync,initial resource promotion>> on your local node
zh: 这假设您的本地节点在主角色中有一个已配置好的但断开连接的DRBD资源。也就是说，设备配置是已经就绪的，两个节点上都存在相同的 `drbd.conf` 副本，并且您已经在本地节点上发出了用于<<s-initial-full-sync,initial resource promotion>>的命令

note: type: Plain text
en: but the remote node is not connected yet.
zh: 但远程节点尚未连接。

note: type: Plain text
en: On the local node, issue the following command:
zh: 在本地节点上，输入以下命令：

note: type: Plain text
en: or
zh: 或

note: type: Plain text
en: Create a consistent, verbatim copy of the resource's data _and its metadata_. You may do so, for example, by removing a hot-swappable drive from a RAID-1 mirror.  You would, of course, replace it with a fresh drive, and rebuild the RAID set, to ensure continued redundancy. But the removed drive is a verbatim copy that can now be shipped off site.  If your local block device supports snapshot copies (such as when using DRBD on top of LVM), you may also create a bitwise copy of that snapshot using `dd`.
zh: 创建资源数据及其元数据的一致的、逐字的复本。您可以这样做，例如，从RAID-1镜像中删除热插拔驱动器。当然，您可以用新的驱动器替换它，并重建RAID集，以确保持续的冗余。但删除的驱动器是逐字复制的，现在可以运离现场。如果本地块设备支持快照副本（例如在LVM上使用DRBD），也可以使用 `dd` 创建该快照的逐位副本。

note: type: Plain text
en: On the local node, issue:
zh: 在本地节点上，输入：

note: type: Plain text
en: or the matching `drbdsetup` command.
zh: 或者匹配的 `drbdsetup` 命令。

note: type: Plain text
en: Note the absence of the `--clear-bitmap` option in this second invocation.
zh: 注意，在第二次调用中没有 `--clear bitmap` 选项。

note: type: Plain text
en: Physically transport the copies to the remote peer location.
zh: 将副本物理传输到远程对等位置。

note: type: Plain text
en: Add the copies to the remote node. This may again be a matter of plugging a physical disk, or grafting a bitwise copy of your shipped data onto existing storage on the remote node.  Be sure to restore or copy not only your replicated data, but also the associated DRBD metadata. If you fail to do so, the disk shipping process is moot.
zh: 将副本添加到远程节点。这可能再次是插入物理磁盘的问题，或者将已传送数据的按位副本移植到远程节点上的现有存储上。请确保不仅还原或复制了复制的数据副本，而且还原或复制了与之关联的DRBD元数据。如果不这样做，磁盘传送过程就没有意义。

note: type: Plain text
en: On the new node we need to fix the node ID in the meta data, and exchange the peer-node info for the two nodes. Please see the following lines as example for changing node id from 2 to 1 on a resource `r0` volume `0`.
zh: 在新节点上，我们需要修复元数据中的节点ID，并为这两个节点交换对等节点信息。请参阅以下几行，作为将资源 `r0` 卷 `0` 上的节点id从2更改为1的示例。

note: type: Plain text
en: This must be done while the volume is not in use.
zh: 必须在卷未使用时执行此操作。

note: type: Plain text
en: `drbdmeta` before 8.9.7 cannot cope with out-of-order `peer` sections; you'll need to exchange the blocks via an editor.
zh: 8.9.7之前的 `drbdmeta` 无法处理无序的 `peer` 部分；您需要通过编辑器手动更换配置部分。

note: type: Plain text
en: Bring up the resource on the remote node:
zh: 在远程节点上启动该资源：

note: type: Plain text
en: After the two peers connect, they will not initiate a full device synchronization. Instead, the automatic synchronization that now commences only covers those blocks that changed since the invocation of `drbdadm{nbsp}--clear-bitmap{nbsp}new-current-uuid`.
zh: 两个节点连接后，它们将不会启动完整的设备同步。相反，现在开始的自动同步只覆盖自调用 `drbdadm{nbsp}--clear bitmap{nbsp}new-current-uuid` 命令后更改的块。

note: type: Plain text
en: Even if there were _no_ changes whatsoever since then, there may still be a brief synchronization period due to areas covered by the <<s-activity-log,Activity Log>> being rolled back on the new Secondary. This may be mitigated by the use of <<p-checksum-sync,checksum-based synchronization>>.
zh: 即使此后 _没有_ 任何更改，由于在新的副节点上有<<s-activity-log,Activity Log>>中提到的因回滚导致的区域覆盖问题，仍可能有一个短暂的同步周期。这可以通过使用<<p-checksum-sync,checksum-based synchronization>>来降低影响。

note: type: Plain text
en: You may use this same procedure regardless of whether the resource is a regular DRBD resource, or a stacked resource. For stacked resources, simply add the `-S` or `--stacked` option to `drbdadm`.
zh: 无论资源是常规DRBD资源还是堆栈资源，步骤都是相同的。对于堆叠资源，只需将 `-S` 或 `--stacked` 选项添加到 `drbdadm` 。

note: type: Title ====
en: Example configuration for four nodes
zh: 四个节点的示例配置

note: type: Plain text
en: Here is an example for a four-node cluster.
zh: 下面是一个四节点集群的示例。

note: type: Plain text
en: In case you want to see the `connection-mesh` configuration expanded, try `drbdadm dump _<resource>_ -v`.
zh: 如果您想查看 `connection mesh` 配置的扩展，请尝试 `drbdadm dump _<resource>_ -v` 。

note: type: Plain text
en: As another example, if the four nodes have enough interfaces to provide a complete mesh via direct linksfootnote:[i.e. three crossover and at least one outgoing/management interface], you can specify the IP addresses of the interfaces:
zh: 另一个例子是，如果四个节点有足够的接口，可以通过直接链接提供完整的网格。注意：[即，三个交叉点和至少一个传出/管理接口]，可以指定接口的IP地址：

note: type: Plain text
en: Please note the numbering scheme used for the IP addresses and ports. Another resource could use the same IP addresses, but ports `71__xy__`, the next one `72__xy__`, and so on.
zh: 请注意用于IP地址和端口的编号方案。另一个资源可以使用相同的IP地址，但端口需要命名为 `71__xy__` 和下一个端口 `72__xy__` , 等等。
