Translation

(itstool) path: sect2/para
English
On <systemitem>hostb.example.org</systemitem>:
45/460
Context English Chinese (Simplified) (zh_CN) State
The third machine, <systemitem>hostc.example.org</systemitem>, is configured to handle failover from either master. This machine is configured with two <acronym>CARP</acronym> <acronym>VHID</acronym>s, one to handle the virtual <acronym>IP</acronym> address for each of the master hosts. The <acronym>CARP</acronym> advertising skew, <option>advskew</option>, is set to ensure that the backup host advertises later than the master, since <option>advskew</option> controls the order of precedence when there are multiple backup servers. 第三台机器,<systemitem>hostc.examplex.org</systemitem>,配置为处理故障转移。该机器配置了两个<acronym>CARP</acronym> <acronym>VHID</acronym>,其中一个用于处理 master 的虚拟<acronym>IP</acronym>地址。<acronym>CARP</acronym>广告偏移(advertising skew),<option>advskew</option>用于确保备份主机的广告发布时间晚于主站,因为当有多个备份服务器时,<option>advskew</option>决定优先级。
hostname="hostc.example.org"
ifconfig_<replaceable>em0</replaceable>="inet <replaceable>192.168.1.5</replaceable> netmask <replaceable>255.255.255.0</replaceable>"
ifconfig_<replaceable>em0</replaceable>_alias0="inet vhid <replaceable>1</replaceable> advskew <replaceable>100</replaceable> pass <replaceable>testpass</replaceable> alias <replaceable>192.168.1.50</replaceable>/32"
ifconfig_<replaceable>em0</replaceable>_alias1="inet vhid <replaceable>2</replaceable> advskew <replaceable>100</replaceable> pass <replaceable>testpass</replaceable> alias <replaceable>192.168.1.51</replaceable>/32"
hostname="hostc.example.org"
ifconfig_<replaceable>em0</replaceable>="inet <replaceable>192.168.1.5</replaceable> netmask <replaceable>255.255.255.0</replaceable>"
ifconfig_<replaceable>em0</replaceable>_alias0="inet vhid <replaceable>1</replaceable> advskew <replaceable>100</replaceable> pass <replaceable>testpass</replaceable> alias <replaceable>192.168.1.50</replaceable>/32"
ifconfig_<replaceable>em0</replaceable>_alias1="inet vhid <replaceable>2</replaceable> advskew <replaceable>100</replaceable> pass <replaceable>testpass</replaceable> alias <replaceable>192.168.1.51</replaceable>/32"
Having two <acronym>CARP</acronym> <acronym>VHID</acronym>s configured means that <systemitem>hostc.example.org</systemitem> will notice if either of the master servers becomes unavailable. If a master fails to advertise before the backup server, the backup server will pick up the shared <acronym>IP</acronym> address until the master becomes available again. 配置了两个<acronym>CARP</acronym> <acronym>VHID</acronym>,意味着如果其中一个主服务器变得不可用,<systemitem>hostc.example.org</systemitem>就会注意到。如果一个主服务器在备份服务器之前不可用,备份服务器将接收共享的<acronym>IP</acronym>地址,直到主服务器再次变得可用。
If the original master server becomes available again, <systemitem>hostc.example.org</systemitem> will not release the virtual <acronym>IP</acronym> address back to it automatically. For this to happen, preemption has to be enabled. The feature is disabled by default, it is controlled via the <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry> variable <varname>net.inet.carp.preempt</varname>. The administrator can force the backup server to return the <acronym>IP</acronym> address to the master: 如果原始主服务器可以使用,<systemitem>hostc.examplex.org</systemitem>将不会自动释放虚拟<acronym>IP</acronym>地址返回给它。要做到这一点,必须启用预置功能。该功能默认是禁用的,它是通过<citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>的<varname>net.inet.carp.preempt</varname>变量来控制的。管理员可以强制备份服务器将<acronym>IP</acronym>地址返回给主服务器:
<prompt>#</prompt> <userinput>ifconfig em0 vhid 1 state backup</userinput> <prompt>#</prompt> <userinput>ifconfig em0 vhid 1 state backup</userinput>
Once the configuration is complete, either restart networking or reboot each system. High availability is now enabled. 配置完成后,重启网络或操作系统。这样就启动了高可用功能。
<acronym>CARP</acronym> functionality can be controlled via several <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry> variables documented in the <citerefentry><refentrytitle>carp</refentrytitle><manvolnum>4</manvolnum></citerefentry> manual pages. Other actions can be triggered from <acronym>CARP</acronym> events by using <citerefentry><refentrytitle>devd</refentrytitle><manvolnum>8</manvolnum></citerefentry>. <acronym>CARP</acronym>功能可以通过<citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>手册页面中记录的几个<citerefentry><refentrytitle>carp</refentrytitle><manvolnum>4</manvolnum></citerefentry>变量来控制。通过使用<citerefentry><refentrytitle>devd</refentrytitle><manvolnum>8</manvolnum></citerefentry>可以从<acronym>CARP</acronym>事件中触发其他操作。
Using <acronym>CARP</acronym> on FreeBSD 9 and Earlier 在 FreeBSD 9(或更早版本)上使用 <acronym>CARP</acronym>
The configuration for these versions of FreeBSD is similar to the one described in the previous section, except that a <acronym>CARP</acronym> device must first be created and referred to in the configuration. 这些版本的 FreeBSD的 配置与上一节中描述的配置类似,不同之处在于必须首先创建<acronym>CARP</acronym>设备并在配置中引用它。
Enable boot-time support for <acronym>CARP</acronym> by loading the <filename>if_carp.ko</filename> kernel module in <filename>/boot/loader.conf</filename>: 若需在系统启动时加载 CARP 内核支持模块<filename>if_carp.ko</filename>,请将以下内容添加到<filename>/boot/loader.conf</filename>中:
if_carp_load="YES" if_carp_load="YES"
Next, on each host, create a <acronym>CARP</acronym> device: 接下来在每台主机上创建 CARP 设备:
<prompt>#</prompt> <userinput>ifconfig carp0 create</userinput> <prompt>#</prompt> <userinput>ifconfig carp0 create</userinput>
Set the hostname, management <acronym>IP</acronym> address, the shared <acronym>IP</acronym> address, and <acronym>VHID</acronym> by adding the required lines to <filename>/etc/rc.conf</filename>. Since a virtual <acronym>CARP</acronym> device is used instead of an alias, the actual subnet mask of <literal>/24</literal> is used instead of <literal>/32</literal>. Here are the entries for <systemitem>hosta.example.org</systemitem>: 通过在<filename>/etc/rc.conf</filename>中添加所需的行来设置主机名、管理<acronym>IP</acronym>地址、共享<acronym>IP</acronym>地址和<acronym>VHID</acronym>。由于使用的是虚拟的<acronym>CARP</acronym>设备而不是别名,所以实际的子网掩码为<literal>/24</literal>,而不是<literal>/32</literal>。下面是<systemitem>hosta.examplex.org</systemitem>的配置条目:
hostname="<replaceable>hosta.example.org</replaceable>"
ifconfig_<replaceable>fxp0</replaceable>="inet <replaceable>192.168.1.3</replaceable> netmask <replaceable>255.255.255.0</replaceable>"
cloned_interfaces="carp0"
ifconfig_carp0="vhid <replaceable>1</replaceable> pass <replaceable>testpass</replaceable> <replaceable>192.168.1.50/24</replaceable>"
hostname="<replaceable>hosta.example.org</replaceable>"
ifconfig_<replaceable>fxp0</replaceable>="inet <replaceable>192.168.1.3</replaceable> netmask <replaceable>255.255.255.0</replaceable>"
cloned_interfaces="carp0"
ifconfig_carp0="vhid <replaceable>1</replaceable> pass <replaceable>testpass</replaceable> <replaceable>192.168.1.50/24</replaceable>"
On <systemitem>hostb.example.org</systemitem>: 在 <systemitem>hostb.example.org</systemitem>:
hostname="<replaceable>hostb.example.org</replaceable>"
ifconfig_<replaceable>fxp0</replaceable>="inet <replaceable>192.168.1.4</replaceable> netmask <replaceable>255.255.255.0</replaceable>"
cloned_interfaces="carp0"
ifconfig_carp0="vhid <replaceable>2</replaceable> pass <replaceable>testpass</replaceable> <replaceable>192.168.1.51/24</replaceable>"
hostname="<replaceable>hostb.example.org</replaceable>"
ifconfig_<replaceable>fxp0</replaceable>="inet <replaceable>192.168.1.4</replaceable> netmask <replaceable>255.255.255.0</replaceable>"
cloned_interfaces="carp0"
ifconfig_carp0="vhid <replaceable>2</replaceable> pass <replaceable>testpass</replaceable> <replaceable>192.168.1.51/24</replaceable>"
The third machine, <systemitem>hostc.example.org</systemitem>, is configured to handle failover from either of the master hosts: 第三台机器,<systemitem>hostc.example.org</systemitem>,配置为在主机发生故障时处理故障转移的机器:
hostname="<replaceable>hostc.example.org</replaceable>"
ifconfig_<replaceable>fxp0</replaceable>="inet <replaceable>192.168.1.5</replaceable> netmask <replaceable>255.255.255.0</replaceable>"
cloned_interfaces="carp0 carp1"
ifconfig_carp0="vhid <replaceable>1</replaceable> advskew <replaceable>100</replaceable> pass <replaceable>testpass</replaceable> <replaceable>192.168.1.50/24</replaceable>"
ifconfig_carp1="vhid <replaceable>2</replaceable> advskew <replaceable>100</replaceable> pass <replaceable>testpass</replaceable> <replaceable>192.168.1.51/24</replaceable>"
hostname="<replaceable>hostc.example.org</replaceable>"
ifconfig_<replaceable>fxp0</replaceable>="inet <replaceable>192.168.1.5</replaceable> netmask <replaceable>255.255.255.0</replaceable>"
cloned_interfaces="carp0 carp1"
ifconfig_carp0="vhid <replaceable>1</replaceable> advskew <replaceable>100</replaceable> pass <replaceable>testpass</replaceable> <replaceable>192.168.1.50/24</replaceable>"
ifconfig_carp1="vhid <replaceable>2</replaceable> advskew <replaceable>100</replaceable> pass <replaceable>testpass</replaceable> <replaceable>192.168.1.51/24</replaceable>"
Preemption is disabled in the <filename>GENERIC</filename> FreeBSD kernel. If preemption has been enabled with a custom kernel, <systemitem>hostc.example.org</systemitem> may not release the <acronym>IP</acronym> address back to the original content server. The administrator can force the backup server to return the <acronym>IP</acronym> address to the master with the command: FreeBSD <filename> GENERIC </filename> 内核中禁用了抢占。如果在自定义内核启用了抢占,则<systemitem> hostc.example.org </systemitem>可能不会将<acronym> IP </acronym>地址释放回原来的内容服务器。管理员可以使用以下命令强制备用服务器将<acronym> IP </acronym>地址返回给主服务器:
<prompt>#</prompt> <userinput>ifconfig carp0 down &amp;&amp; ifconfig carp0 up</userinput> <prompt>#</prompt> <userinput>ifconfig carp0 down &amp;&amp; ifconfig carp0 up</userinput>
This should be done on the <filename>carp</filename> interface which corresponds to the correct host. 这应该在与正确的主机对应的<filename>carp</filename> 接口上进行。
VLANs VLAN
<primary><acronym>VLANs</acronym></primary> <primary><acronym>VLAN</acronym></primary>
<primary>Virtual LANs</primary> <primary>虚拟 LAN</primary>
<acronym>VLANs</acronym> are a way of virtually dividing up a network into many different subnetworks, also referred to as segmenting. Each segment will have its own broadcast domain and be isolated from other <acronym>VLANs</acronym>. <acronym>VLAN</acronym>是一种虚拟网络划分方法,将一个网络划分成多个虚拟子网。每个子网由自己的广播域,并与其他 VLAN 独立。
On FreeBSD, <acronym>VLANs</acronym> must be supported by the network card driver. To see which drivers support vlans, refer to the <citerefentry><refentrytitle>vlan</refentrytitle><manvolnum>4</manvolnum></citerefentry> manual page. 在 FreeBSD 上,使用 <acronym>VLANs</acronym> 需要网卡驱动支持。欲查看您的网卡是否支持 vlans,请查阅<citerefentry><refentrytitle>vlan</refentrytitle><manvolnum>4</manvolnum></citerefentry> 手册。
When configuring a <acronym>VLAN</acronym>, a couple pieces of information must be known. First, which network interface? Second, what is the <acronym>VLAN</acronym> tag? 设置 VLANs 时需要了一些信息,首先,为哪个网口设置?第二,什么是 VLAN tag?
To configure <acronym>VLANs</acronym> at run time, with a <acronym>NIC</acronym> of <literal>em0</literal> and a <acronym>VLAN</acronym> tag of <systemitem>5</systemitem> the command would look like this: 在运行时配置VLAN,NIC 为 em0 VLAN tag 为 5,命令如下:
<prompt>#</prompt> <userinput>ifconfig <replaceable>em0.5</replaceable> create vlan <replaceable>5</replaceable> vlandev <replaceable>em0</replaceable> inet 192.168.20.20/24</userinput> <prompt>#</prompt> <userinput>ifconfig <replaceable>em0.5</replaceable> create vlan <replaceable>5</replaceable> vlandev <replaceable>em0</replaceable> inet 192.168.20.20/24</userinput>
See how the interface name includes the <acronym>NIC</acronym> driver name and the <acronym>VLAN</acronym> tag, separated by a period? This is a best practice to make maintaining the <acronym>VLAN</acronym> configuration easy when many <acronym>VLANs</acronym> are present on a machine. 接口名称包括<acronym>NIC</acronym>驱动名称和<acronym>VLAN</acronym>标签,并以句号分隔。这是一个最佳实践,当一台机器上有许多<acronym>VLAN</acronym>时,可以轻松维护<acronym>VLAN</acronym>配置。

Loading…

On <systemitem>hostb.example.org</systemitem>:
在 <systemitem>hostb.example.org</systemitem>:
9 months ago
Browse all component changes

Glossary

English Chinese (Simplified) (zh_CN)
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect2/para
Source string location
book.translate.xml:65535
String age
a year ago
Source string age
a year ago
Translation file
books/zh_CN/handbook.po, string 11304