# # AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: 0\n" "POT-Creation-Date: 2010-12-15T23:32:36\n" "PO-Revision-Date: 2010-12-16 00:37+0800\n" "Last-Translator: Charlie Chen \n" "Language-Team: None\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Chinese\n" "X-Poedit-Country: CHINA\n" "X-Poedit-SourceCharset: utf-8\n" #. Tag: title #, no-c-format msgid "Conversion to Active/Active" msgstr "转变为Active/Active" #. Tag: title #, no-c-format msgid "Requirements" msgstr "需求" #. Tag: para #, no-c-format msgid "The primary requirement for an Active/Active cluster is that the data required for your services are available, simultaneously, on both machines. Pacemaker makes no requirement on how this is achieved, you could use a SAN if you had one available, however since DRBD supports multiple Primaries, we can also use that." msgstr "Active/Active集群一个主要的需求就是数据在两台机器上面都是可用并且是同步的。Pacemaker没有要求你怎么实现,你可以用SAN,但是自从DRBD支持多主模式,我们也可以用这个来实现。" #. Tag: para #, no-c-format msgid "The only hitch is that we need to use a cluster-aware filesystem (and the one we used earlier with DRBD, ext4, is not one of those). Both OCFS2 and GFS2 are supported, however here we will use GFS2 which comes with &DISTRO; &DISTRO_VERSION; ." msgstr "唯一的限制是我们要用一个针对集群的文件系统(我们之前用的ext4,它并不是这样一个文件系统)。 OCFS2或者GFS2都是可以的,但是在&DISTRO; &DISTRO_VERSION;上面,我们用GFS2。" #. Tag: title #, no-c-format msgid "Install a Cluster Filesystem - GFS2" msgstr "安装一个集群文件系统 - GFS2" #. Tag: para #, no-c-format msgid "The first thing to do is install gfs2-utils on each machine." msgstr "首先我们在各个节点上面安装GFS2。" #. Tag: screen #, no-c-format msgid "" "\n" "[root@pcmk-1 ~]# yum install -y gfs2-utils gfs-pcmk\n" "Setting up Install Process\n" "Resolving Dependencies\n" "--> Running transaction check\n" "---> Package gfs-pcmk.x86_64 0:3.0.5-2.fc12 set to be updated\n" "--> Processing Dependency: libSaCkpt.so.3(OPENAIS_CKPT_B.01.01)(64bit) for package: gfs-pcmk-3.0.5-2.fc12.x86_64\n" "--> Processing Dependency: dlm-pcmk for package: gfs-pcmk-3.0.5-2.fc12.x86_64\n" "--> Processing Dependency: libccs.so.3()(64bit) for package: gfs-pcmk-3.0.5-2.fc12.x86_64\n" "--> Processing Dependency: libdlmcontrol.so.3()(64bit) for package: gfs-pcmk-3.0.5-2.fc12.x86_64\n" "--> Processing Dependency: liblogthread.so.3()(64bit) for package: gfs-pcmk-3.0.5-2.fc12.x86_64\n" "--> Processing Dependency: libSaCkpt.so.3()(64bit) for package: gfs-pcmk-3.0.5-2.fc12.x86_64\n" "---> Package gfs2-utils.x86_64 0:3.0.5-2.fc12 set to be updated\n" "--> Running transaction check\n" "---> Package clusterlib.x86_64 0:3.0.5-2.fc12 set to be updated\n" "---> Package dlm-pcmk.x86_64 0:3.0.5-2.fc12 set to be updated\n" "---> Package openaislib.x86_64 0:1.1.0-1.fc12 set to be updated\n" "--> Finished Dependency Resolution\n" "\n" "Dependencies Resolved\n" "\n" "===========================================================================================\n" " Package                Arch               Version                   Repository        Size\n" "===========================================================================================\n" "Installing:\n" " gfs-pcmk               x86_64             3.0.5-2.fc12              custom           101 k\n" " gfs2-utils             x86_64             3.0.5-2.fc12              custom           208 k\n" "Installing for dependencies:\n" " clusterlib             x86_64             3.0.5-2.fc12              custom            65 k\n" " dlm-pcmk               x86_64             3.0.5-2.fc12              custom            93 k\n" " openaislib             x86_64             1.1.0-1.fc12              fedora            76 k\n" "\n" "Transaction Summary\n" "===========================================================================================\n" "Install       5 Package(s)\n" "Upgrade       0 Package(s)\n" "\n" "Total download size: 541 k\n" "Downloading Packages:\n" "(1/5): clusterlib-3.0.5-2.fc12.x86_64.rpm                                |  65 kB     00:00\n" "(2/5): dlm-pcmk-3.0.5-2.fc12.x86_64.rpm                                  |  93 kB     00:00\n" "(3/5): gfs-pcmk-3.0.5-2.fc12.x86_64.rpm                                  | 101 kB     00:00\n" "(4/5): gfs2-utils-3.0.5-2.fc12.x86_64.rpm                                | 208 kB     00:00\n" "(5/5): openaislib-1.1.0-1.fc12.x86_64.rpm                                |  76 kB     00:00\n" "-------------------------------------------------------------------------------------------\n" "Total                                                           992 kB/s | 541 kB     00:00\n" "Running rpm_check_debug\n" "Running Transaction Test\n" "Finished Transaction Test\n" "Transaction Test Succeeded\n" "Running Transaction\n" "  Installing     : clusterlib-3.0.5-2.fc12.x86_64                                       1/5 \n" "  Installing     : openaislib-1.1.0-1.fc12.x86_64                                       2/5 \n" "  Installing     : dlm-pcmk-3.0.5-2.fc12.x86_64                                         3/5 \n" "  Installing     : gfs-pcmk-3.0.5-2.fc12.x86_64                                         4/5 \n" "  Installing     : gfs2-utils-3.0.5-2.fc12.x86_64                                       5/5 \n" "\n" "Installed:\n" "  gfs-pcmk.x86_64 0:3.0.5-2.fc12                    gfs2-utils.x86_64 0:3.0.5-2.fc12\n" "\n" "Dependency Installed:\n" "  clusterlib.x86_64 0:3.0.5-2.fc12   dlm-pcmk.x86_64 0:3.0.5-2.fc12 \n" "  openaislib.x86_64 0:1.1.0-1.fc12  \n" "\n" "Complete!\n" "[root@pcmk-1 x86_64]#\n" msgstr "" "\n" "[root@pcmk-1 ~]# yum install -y gfs2-utils gfs-pcmk\n" "Setting up Install Process\n" "Resolving Dependencies\n" "--> Running transaction check\n" "---> Package gfs-pcmk.x86_64 0:3.0.5-2.fc12 set to be updated\n" "--> Processing Dependency: libSaCkpt.so.3(OPENAIS_CKPT_B.01.01)(64bit) for package: gfs-pcmk-3.0.5-2.fc12.x86_64\n" "--> Processing Dependency: dlm-pcmk for package: gfs-pcmk-3.0.5-2.fc12.x86_64\n" "--> Processing Dependency: libccs.so.3()(64bit) for package: gfs-pcmk-3.0.5-2.fc12.x86_64\n" "--> Processing Dependency: libdlmcontrol.so.3()(64bit) for package: gfs-pcmk-3.0.5-2.fc12.x86_64\n" "--> Processing Dependency: liblogthread.so.3()(64bit) for package: gfs-pcmk-3.0.5-2.fc12.x86_64\n" "--> Processing Dependency: libSaCkpt.so.3()(64bit) for package: gfs-pcmk-3.0.5-2.fc12.x86_64\n" "---> Package gfs2-utils.x86_64 0:3.0.5-2.fc12 set to be updated\n" "--> Running transaction check\n" "---> Package clusterlib.x86_64 0:3.0.5-2.fc12 set to be updated\n" "---> Package dlm-pcmk.x86_64 0:3.0.5-2.fc12 set to be updated\n" "---> Package openaislib.x86_64 0:1.1.0-1.fc12 set to be updated\n" "--> Finished Dependency Resolution\n" "\n" "Dependencies Resolved\n" "\n" "===========================================================================================\n" " Package                Arch               Version                   Repository        Size\n" "===========================================================================================\n" "Installing:\n" " gfs-pcmk               x86_64             3.0.5-2.fc12              custom           101 k\n" " gfs2-utils             x86_64             3.0.5-2.fc12              custom           208 k\n" "Installing for dependencies:\n" " clusterlib             x86_64             3.0.5-2.fc12              custom            65 k\n" " dlm-pcmk               x86_64             3.0.5-2.fc12              custom            93 k\n" " openaislib             x86_64             1.1.0-1.fc12              fedora            76 k\n" "\n" "Transaction Summary\n" "===========================================================================================\n" "Install       5 Package(s)\n" "Upgrade       0 Package(s)\n" "\n" "Total download size: 541 k\n" "Downloading Packages:\n" "(1/5): clusterlib-3.0.5-2.fc12.x86_64.rpm                                |  65 kB     00:00\n" "(2/5): dlm-pcmk-3.0.5-2.fc12.x86_64.rpm                                  |  93 kB     00:00\n" "(3/5): gfs-pcmk-3.0.5-2.fc12.x86_64.rpm                                  | 101 kB     00:00\n" "(4/5): gfs2-utils-3.0.5-2.fc12.x86_64.rpm                                | 208 kB     00:00\n" "(5/5): openaislib-1.1.0-1.fc12.x86_64.rpm                                |  76 kB     00:00\n" "-------------------------------------------------------------------------------------------\n" "Total                                                           992 kB/s | 541 kB     00:00\n" "Running rpm_check_debug\n" "Running Transaction Test\n" "Finished Transaction Test\n" "Transaction Test Succeeded\n" "Running Transaction\n" "  Installing     : clusterlib-3.0.5-2.fc12.x86_64                                       1/5 \n" "  Installing     : openaislib-1.1.0-1.fc12.x86_64                                       2/5 \n" "  Installing     : dlm-pcmk-3.0.5-2.fc12.x86_64                                         3/5 \n" "  Installing     : gfs-pcmk-3.0.5-2.fc12.x86_64                                         4/5 \n" "  Installing     : gfs2-utils-3.0.5-2.fc12.x86_64                                       5/5 \n" "\n" "Installed:\n" "  gfs-pcmk.x86_64 0:3.0.5-2.fc12                    gfs2-utils.x86_64 0:3.0.5-2.fc12\n" "\n" "Dependency Installed:\n" "  clusterlib.x86_64 0:3.0.5-2.fc12   dlm-pcmk.x86_64 0:3.0.5-2.fc12 \n" "  openaislib.x86_64 0:1.1.0-1.fc12  \n" "\n" "Complete!\n" "[root@pcmk-1 x86_64]#\n" #. Tag: title #, no-c-format msgid "Setup Pacemaker-GFS2 Integration" msgstr "整合 Pacemaker-GFS2" #. Tag: para #, no-c-format msgid "GFS2 needs two services to be running, the first is the user-space interface to the kernel’s distributed lock manager (DLM). The DLM is used to co-ordinate which node(s) can access a given file (and when) and integrates with Pacemaker to obtain node membership The list of nodes the cluster considers to be available information and fencing capabilities." msgstr "GFS2要求运行两个服务,首先是用户空间访问内核的分布式锁管理(DLM)的接口。 DLM是用来统筹哪个节点可以处理某个特定的文件,并且与Pacemaker集成来得到节点之间的关系 The list of nodes the cluster considers to be available 和隔离能力。" #. Tag: para #, no-c-format msgid "The second service is GFS2’s own control daemon which also integrates with Pacemaker to obtain node membership data." msgstr "另外一个服务是GFS2自身的控制进程,也是与Pacemaker集成来得到节点之间的关系。" #. Tag: title #, no-c-format msgid "Add the DLM service" msgstr "添加 DLM 服务" #. Tag: para #, no-c-format msgid "The DLM control daemon needs to run on all active cluster nodes, so we will use the shells interactive mode to create a cloned resource." msgstr "DLM控制进程需要在所有可用的集群节点上面运行,所以我们用shell交互模式来添加一个cloned类型的资源。" #. Tag: screen #, no-c-format msgid "" "\n" "[root@pcmk-1 ~]# crm\n" "crm(live)# cib new stack-glue\n" "INFO: stack-glue shadow CIB created\n" "crm(stack-glue)# configure primitive dlm ocf:pacemaker:controld op monitor interval=120s\n" "crm(stack-glue)# configure clone dlm-clone dlm meta interleave=true\n" "crm(stack-glue)# configure show xml\n" "crm(stack-glue)# configure show\n" "node pcmk-1\n" "node pcmk-2\n" "primitive WebData ocf:linbit:drbd \\\n" "        params drbd_resource=\"wwwdata\" \\\n" "        op monitor interval=\"60s\"\n" "primitive WebFS ocf:heartbeat:Filesystem \\\n" "        params device=\"/dev/drbd/by-res/wwwdata\" directory=\"/var/www/html\" fstype=\"ext4\"\n" "primitive WebSite ocf:heartbeat:apache \\\n" "        params configfile=\"/etc/httpd/conf/httpd.conf\" \\\n" "        op monitor interval=\"1min\"\n" "primitive ClusterIP ocf:heartbeat:IPaddr2 \\\n" "        params ip=\"192.168.122.101\" cidr_netmask=\"32\" \\\n" "        op monitor interval=\"30s\"\n" "primitive dlm ocf:pacemaker:controld \\\n" " op monitor interval=\"120s\"\n" "ms WebDataClone WebData \\\n" "        meta master-max=\"1\" master-node-max=\"1\" clone-max=\"2\" clone-node-max=\"1\" notify=\"true\"\n" "clone dlm-clone dlm \\\n" " meta interleave=\"true\"\n" "location prefer-pcmk-1 WebSite 50: pcmk-1\n" "colocation WebSite-with-WebFS inf: WebSite WebFS\n" "colocation fs_on_drbd inf: WebFS WebDataClone:Master\n" "colocation website-with-ip inf: WebSite ClusterIP\n" "order WebFS-after-WebData inf: WebDataClone:promote WebFS:start\n" "order WebSite-after-WebFS inf: WebFS WebSite\n" "order apache-after-ip inf: ClusterIP WebSite\n" "property $id=\"cib-bootstrap-options\" \\\n" "        dc-version=\"1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\" \\\n" "        cluster-infrastructure=\"openais\" \\\n" "        expected-quorum-votes=”2” \\\n" "        stonith-enabled=\"false\" \\\n" "        no-quorum-policy=\"ignore\"\n" "rsc_defaults $id=\"rsc-options\" \\\n" "        resource-stickiness=”100”\n" msgstr "" "\n" "[root@pcmk-1 ~]# crm\n" "crm(live)# cib new stack-glue\n" "INFO: stack-glue shadow CIB created\n" "crm(stack-glue)# configure primitive dlm ocf:pacemaker:controld op monitor interval=120s\n" "crm(stack-glue)# configure clone dlm-clone dlm meta interleave=true\n" "crm(stack-glue)# configure show xml\n" "crm(stack-glue)# configure show\n" "node pcmk-1\n" "node pcmk-2\n" "primitive WebData ocf:linbit:drbd \\\n" "        params drbd_resource=\"wwwdata\" \\\n" "        op monitor interval=\"60s\"\n" "primitive WebFS ocf:heartbeat:Filesystem \\\n" "        params device=\"/dev/drbd/by-res/wwwdata\" directory=\"/var/www/html\" fstype=\"ext4\"\n" "primitive WebSite ocf:heartbeat:apache \\\n" "        params configfile=\"/etc/httpd/conf/httpd.conf\" \\\n" "        op monitor interval=\"1min\"\n" "primitive ClusterIP ocf:heartbeat:IPaddr2 \\\n" "        params ip=\"192.168.122.101\" cidr_netmask=\"32\" \\\n" "        op monitor interval=\"30s\"\n" "primitive dlm ocf:pacemaker:controld \\\n" " op monitor interval=\"120s\"\n" "ms WebDataClone WebData \\\n" "        meta master-max=\"1\" master-node-max=\"1\" clone-max=\"2\" clone-node-max=\"1\" notify=\"true\"\n" "clone dlm-clone dlm \\\n" " meta interleave=\"true\"\n" "location prefer-pcmk-1 WebSite 50: pcmk-1\n" "colocation WebSite-with-WebFS inf: WebSite WebFS\n" "colocation fs_on_drbd inf: WebFS WebDataClone:Master\n" "colocation website-with-ip inf: WebSite ClusterIP\n" "order WebFS-after-WebData inf: WebDataClone:promote WebFS:start\n" "order WebSite-after-WebFS inf: WebFS WebSite\n" "order apache-after-ip inf: ClusterIP WebSite\n" "property $id=\"cib-bootstrap-options\" \\\n" "        dc-version=\"1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\" \\\n" "        cluster-infrastructure=\"openais\" \\\n" "        expected-quorum-votes=”2” \\\n" "        stonith-enabled=\"false\" \\\n" "        no-quorum-policy=\"ignore\"\n" "rsc_defaults $id=\"rsc-options\" \\\n" "        resource-stickiness=”100”\n" #. Tag: para #, no-c-format msgid "TODO: Explain the meaning of the interleave option" msgstr "TODO: Explain the meaning of the interleave option" #. Tag: para #, no-c-format msgid "Review the configuration before uploading it to the cluster, quitting the shell and watching the cluster’s response" msgstr "看看配置文件有没有错误,然后退出shell看看集群的反应。" #. Tag: screen #, no-c-format msgid "" "\n" "crm(stack-glue)# cib commit stack-glue\n" "INFO: commited 'stack-glue' shadow CIB to the cluster\n" "crm(stack-glue)# quit\n" "bye\n" "[root@pcmk-1 ~]# crm_mon\n" "============\n" "Last updated: Thu Sep  3 20:49:54 2009\n" "Stack: openais\n" "Current DC: pcmk-2 - partition with quorum\n" "Version: 1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\n" "2 Nodes configured, 2 expected votes\n" "5 Resources configured.\n" "============\n" "\n" "Online: [ pcmk-1 pcmk-2 ]\n" "\n" "WebSite (ocf::heartbeat:apache):        Started pcmk-2\n" "Master/Slave Set: WebDataClone\n" "        Masters: [ pcmk-1 ]\n" "        Slaves: [ pcmk-2 ]\n" "ClusterIP        (ocf::heartbeat:IPaddr):        Started pcmk-2\n" "Clone Set: dlm-clone\n" " Started: [ pcmk-2 pcmk-1 ]\n" "WebFS   (ocf::heartbeat:Filesystem):    Started pcmk-2\n" msgstr "" "\n" "crm(stack-glue)# cib commit stack-glue\n" "INFO: commited 'stack-glue' shadow CIB to the cluster\n" "crm(stack-glue)# quit\n" "bye\n" "[root@pcmk-1 ~]# crm_mon\n" "============\n" "Last updated: Thu Sep  3 20:49:54 2009\n" "Stack: openais\n" "Current DC: pcmk-2 - partition with quorum\n" "Version: 1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\n" "2 Nodes configured, 2 expected votes\n" "5 Resources configured.\n" "============\n" "\n" "Online: [ pcmk-1 pcmk-2 ]\n" "\n" "WebSite (ocf::heartbeat:apache):        Started pcmk-2\n" "Master/Slave Set: WebDataClone\n" "        Masters: [ pcmk-1 ]\n" "        Slaves: [ pcmk-2 ]\n" "ClusterIP        (ocf::heartbeat:IPaddr):        Started pcmk-2\n" "Clone Set: dlm-clone\n" " Started: [ pcmk-2 pcmk-1 ]\n" "WebFS   (ocf::heartbeat:Filesystem):    Started pcmk-2\n" #. Tag: title #, no-c-format msgid "Add the GFS2 service" msgstr "添加 GFS2 服务" #. Tag: para #, no-c-format msgid "Once the DLM is active, we can add the GFS2 control daemon." msgstr "一旦DLM启动了,我们可以加上GFS2的控制进程了。" #. Tag: para #, no-c-format msgid "Use the crm shell to create the gfs-control cluster resource:" msgstr "用crm shell来创建gfs-control这个集群资源:" #. Tag: screen #, no-c-format msgid "" "\n" "[root@pcmk-1 ~]# crm\n" "crm(live)# cib new gfs-glue --force\n" "INFO: gfs-glue shadow CIB created\n" "crm(gfs-glue)# configure primitive gfs-control ocf:pacemaker:controld params daemon=gfs_controld.pcmk args=\"-g 0\" op monitor interval=120s\n" "crm(gfs-glue)# configure clone gfs-clone gfs-control meta interleave=true\n" msgstr "" "\n" "[root@pcmk-1 ~]# crm\n" "crm(live)# cib new gfs-glue --force\n" "INFO: gfs-glue shadow CIB created\n" "crm(gfs-glue)# configure primitive gfs-control ocf:pacemaker:controld params daemon=gfs_controld.pcmk args=\"-g 0\" op monitor interval=120s\n" "crm(gfs-glue)# configure clone gfs-clone gfs-control meta interleave=true\n" #. Tag: para #, no-c-format msgid "Now ensure Pacemaker only starts the gfs-control service on nodes that also have a copy of the dlm service (created above) already running" msgstr "现在确保Pacemaker只在有dlm服务运行的节点上面启动 gfs-control 服务" #. Tag: screen #, no-c-format msgid "" "\n" "crm(gfs-glue)# configure colocation gfs-with-dlm INFINITY: gfs-clone dlm-clone\n" "crm(gfs-glue)# configure order start-gfs-after-dlm mandatory: dlm-clone gfs-clone\n" msgstr "" "\n" "crm(gfs-glue)# configure colocation gfs-with-dlm INFINITY: gfs-clone dlm-clone\n" "crm(gfs-glue)# configure order start-gfs-after-dlm mandatory: dlm-clone gfs-clone\n" #. Tag: screen #, no-c-format msgid "" "\n" "crm(gfs-glue)# configure show\n" "node pcmk-1\n" "node pcmk-2\n" "primitive WebData ocf:linbit:drbd \\\n" "        params drbd_resource=\"wwwdata\" \\\n" "        op monitor interval=\"60s\"\n" "primitive WebFS ocf:heartbeat:Filesystem \\\n" "        params device=\"/dev/drbd/by-res/wwwdata\" directory=\"/var/www/html\" fstype=\"ext4\"\n" "primitive WebSite ocf:heartbeat:apache \\\n" "        params configfile=\"/etc/httpd/conf/httpd.conf\" \\\n" "        op monitor interval=\"1min\"\n" "primitive ClusterIP ocf:heartbeat:IPaddr2 \\\n" "        params ip=\"192.168.122.101\" cidr_netmask=\"32\" \\\n" "        op monitor interval=\"30s\"\n" "primitive dlm ocf:pacemaker:controld \\\n" "        op monitor interval=\"120s\"\n" "primitive gfs-control ocf:pacemaker:controld \\\n" " params daemon=”gfs_controld.pcmk” args=”-g 0” \\\n" " op monitor interval=\"120s\"\n" "ms WebDataClone WebData \\\n" "        meta master-max=\"1\" master-node-max=\"1\" clone-max=\"2\" clone-node-max=\"1\" notify=\"true\"\n" "clone dlm-clone dlm \\\n" "        meta interleave=\"true\"\n" "clone gfs-clone gfs-control \\\n" " meta interleave=\"true\"\n" "location prefer-pcmk-1 WebSite 50: pcmk-1\n" "colocation WebSite-with-WebFS inf: WebSite WebFS\n" "colocation fs_on_drbd inf: WebFS WebDataClone:Master\n" "colocation gfs-with-dlm inf: gfs-clone dlm-clone\n" "colocation website-with-ip inf: WebSite ClusterIP\n" "order WebFS-after-WebData inf: WebDataClone:promote WebFS:start\n" "order WebSite-after-WebFS inf: WebFS WebSite\n" "order apache-after-ip inf: ClusterIP WebSite\n" "order start-gfs-after-dlm inf: dlm-clone gfs-clone\n" "property $id=\"cib-bootstrap-options\" \\\n" "        dc-version=\"1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\" \\\n" "        cluster-infrastructure=\"openais\" \\\n" "        expected-quorum-votes=”2” \\\n" "        stonith-enabled=\"false\" \\\n" "        no-quorum-policy=\"ignore\"\n" "rsc_defaults $id=\"rsc-options\" \\\n" "        resource-stickiness=”100”\n" "crm(gfs-glue)# cib commit gfs-glue\n" "INFO: commited 'gfs-glue' shadow CIB to the cluster\n" "crm(gfs-glue)# quit\n" "bye\n" "[root@pcmk-1 ~]# crm_mon\n" "============\n" "Last updated: Thu Sep  3 20:49:54 2009\n" "Stack: openais\n" "Current DC: pcmk-2 - partition with quorum\n" "Version: 1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\n" "2 Nodes configured, 2 expected votes\n" "6 Resources configured.\n" "============\n" "\n" "Online: [ pcmk-1 pcmk-2 ]\n" "\n" "WebSite (ocf::heartbeat:apache):        Started pcmk-2\n" "Master/Slave Set: WebDataClone\n" "        Masters: [ pcmk-1 ]\n" "        Slaves: [ pcmk-2 ]\n" "ClusterIP        (ocf::heartbeat:IPaddr):        Started pcmk-2\n" "Clone Set: dlm-clone\n" "        Started: [ pcmk-2 pcmk-1 ]\n" "Clone Set: gfs-clone\n" " Started: [ pcmk-2 pcmk-1 ]\n" "WebFS   (ocf::heartbeat:Filesystem):    Started pcmk-1\n" msgstr "" "\n" "crm(gfs-glue)# configure show\n" "node pcmk-1\n" "node pcmk-2\n" "primitive WebData ocf:linbit:drbd \\\n" "        params drbd_resource=\"wwwdata\" \\\n" "        op monitor interval=\"60s\"\n" "primitive WebFS ocf:heartbeat:Filesystem \\\n" "        params device=\"/dev/drbd/by-res/wwwdata\" directory=\"/var/www/html\" fstype=\"ext4\"\n" "primitive WebSite ocf:heartbeat:apache \\\n" "        params configfile=\"/etc/httpd/conf/httpd.conf\" \\\n" "        op monitor interval=\"1min\"\n" "primitive ClusterIP ocf:heartbeat:IPaddr2 \\\n" "        params ip=\"192.168.122.101\" cidr_netmask=\"32\" \\\n" "        op monitor interval=\"30s\"\n" "primitive dlm ocf:pacemaker:controld \\\n" "        op monitor interval=\"120s\"\n" "primitive gfs-control ocf:pacemaker:controld \\\n" " params daemon=”gfs_controld.pcmk” args=”-g 0” \\\n" " op monitor interval=\"120s\"\n" "ms WebDataClone WebData \\\n" "        meta master-max=\"1\" master-node-max=\"1\" clone-max=\"2\" clone-node-max=\"1\" notify=\"true\"\n" "clone dlm-clone dlm \\\n" "        meta interleave=\"true\"\n" "clone gfs-clone gfs-control \\\n" " meta interleave=\"true\"\n" "location prefer-pcmk-1 WebSite 50: pcmk-1\n" "colocation WebSite-with-WebFS inf: WebSite WebFS\n" "colocation fs_on_drbd inf: WebFS WebDataClone:Master\n" "colocation gfs-with-dlm inf: gfs-clone dlm-clone\n" "colocation website-with-ip inf: WebSite ClusterIP\n" "order WebFS-after-WebData inf: WebDataClone:promote WebFS:start\n" "order WebSite-after-WebFS inf: WebFS WebSite\n" "order apache-after-ip inf: ClusterIP WebSite\n" "order start-gfs-after-dlm inf: dlm-clone gfs-clone\n" "property $id=\"cib-bootstrap-options\" \\\n" "        dc-version=\"1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\" \\\n" "        cluster-infrastructure=\"openais\" \\\n" "        expected-quorum-votes=”2” \\\n" "        stonith-enabled=\"false\" \\\n" "        no-quorum-policy=\"ignore\"\n" "rsc_defaults $id=\"rsc-options\" \\\n" "        resource-stickiness=”100”\n" "crm(gfs-glue)# cib commit gfs-glue\n" "INFO: commited 'gfs-glue' shadow CIB to the cluster\n" "crm(gfs-glue)# quit\n" "bye\n" "[root@pcmk-1 ~]# crm_mon\n" "============\n" "Last updated: Thu Sep  3 20:49:54 2009\n" "Stack: openais\n" "Current DC: pcmk-2 - partition with quorum\n" "Version: 1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\n" "2 Nodes configured, 2 expected votes\n" "6 Resources configured.\n" "============\n" "\n" "Online: [ pcmk-1 pcmk-2 ]\n" "\n" "WebSite (ocf::heartbeat:apache):        Started pcmk-2\n" "Master/Slave Set: WebDataClone\n" "        Masters: [ pcmk-1 ]\n" "        Slaves: [ pcmk-2 ]\n" "ClusterIP        (ocf::heartbeat:IPaddr):        Started pcmk-2\n" "Clone Set: dlm-clone\n" "        Started: [ pcmk-2 pcmk-1 ]\n" "Clone Set: gfs-clone\n" " Started: [ pcmk-2 pcmk-1 ]\n" "WebFS   (ocf::heartbeat:Filesystem):    Started pcmk-1\n" #. Tag: title #, no-c-format msgid "Create a GFS2 Filesystem" msgstr "创建一个 GFS2 文件系统" #. Tag: title #, no-c-format msgid "Preparation" msgstr "准备工作" #. Tag: para #, no-c-format msgid "Before we do anything to the existing partition, we need to make sure it is unmounted. We do this by tell the cluster to stop the WebFS resource. This will ensure that other resources (in our case, Apache) using WebFS are not only stopped, but stopped in the correct order." msgstr "在我们对一个已存在的分区做任何操作之前,我们要确保它没有被挂载。我们告诉集群停止WebFS这个资源来确保这一点。这可以确保其他使用WebFS的资源会正确的依次关闭。" #. Tag: screen #, no-c-format msgid "" "\n" "[root@pcmk-1 ~]# crm_resource --resource WebFS --set-parameter target-role --meta --parameter-value Stopped\n" "[root@pcmk-1 ~]# crm_mon\n" "============\n" "Last updated: Thu Sep  3 15:18:06 2009\n" "Stack: openais\n" "Current DC: pcmk-1 - partition with quorum\n" "Version: 1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\n" "2 Nodes configured, 2 expected votes\n" "6 Resources configured.\n" "============\n" "\n" "Online: [ pcmk-1 pcmk-2 ]\n" "\n" "Master/Slave Set: WebDataClone\n" "        Masters: [ pcmk-1 ]\n" "        Slaves: [ pcmk-2 ]\n" "ClusterIP        (ocf::heartbeat:IPaddr):        Started pcmk-1\n" "Clone Set: dlm-clone\n" "        Started: [ pcmk-2 pcmk-1 ]\n" "Clone Set: gfs-clone\n" "        Started: [ pcmk-2 pcmk-1 ]\n" msgstr "" "\n" "[root@pcmk-1 ~]# crm_resource --resource WebFS --set-parameter target-role --meta --parameter-value Stopped\n" "[root@pcmk-1 ~]# crm_mon\n" "============\n" "Last updated: Thu Sep  3 15:18:06 2009\n" "Stack: openais\n" "Current DC: pcmk-1 - partition with quorum\n" "Version: 1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\n" "2 Nodes configured, 2 expected votes\n" "6 Resources configured.\n" "============\n" "\n" "Online: [ pcmk-1 pcmk-2 ]\n" "\n" "Master/Slave Set: WebDataClone\n" "        Masters: [ pcmk-1 ]\n" "        Slaves: [ pcmk-2 ]\n" "ClusterIP        (ocf::heartbeat:IPaddr):        Started pcmk-1\n" "Clone Set: dlm-clone\n" "        Started: [ pcmk-2 pcmk-1 ]\n" "Clone Set: gfs-clone\n" "        Started: [ pcmk-2 pcmk-1 ]\n" #. Tag: para #, no-c-format msgid "Note that both Apache and WebFS have been stopped." msgstr "注意 Apache and WebFS 两者都已经停止了。" #. Tag: title #, no-c-format msgid "Create and Populate an GFS2 Partition" msgstr "创建并迁移数据到 GFS2 分区" #. Tag: para #, no-c-format msgid "Now that the cluster stack and integration pieces are running smoothly, we can create an GFS2 partition." msgstr "现在集群的基层和集成部分都正常运行,我们现在创建一个GFS2分区" #. Tag: para #, no-c-format msgid "This will erase all previous content stored on the DRBD device. Ensure you have a copy of any important data." msgstr "这个操作会清除DRBD分区上面的所有数据,请备份重要的数据。" #. Tag: para #, no-c-format msgid "We need to specify a number of additional parameters when creating a GFS2 partition." msgstr "我们要为GFS2分区指定一系列附加的参数。" #. Tag: para #, no-c-format msgid "First we must use the -p option to specify that we want to use the the Kernel’s DLM. Next we use -j to indicate that it should reserve enough space for two journals (one per node accessing the filesystem)." msgstr "首先我们要用 -p选项来指定我们用的是内核的DLM,然后我们用-j来表示我们为两个日志保留足够的空间(每个操作文件系统的节点各一个)。" #. Tag: para #, no-c-format msgid "Lastly, we use -t to specify the lock table name. The format for this field is clustername:fsname. For the fsname, we just need to pick something unique and descriptive and since we haven’t specified a clustername yet, we will use the default (pcmk)." msgstr "最后,我们用-t来指定lock table的名称。这个字段的格式是 clustername:fsname(集群名称:文件系统名称)。fsname的话,我们只要用一个唯一的并且能描述我们这个集群的名称就好了,我们用默认的pcmk。" #. Tag: para #, no-c-format msgid "To specify an alternate name for the cluster, locate the service section containing “name: pacemaker” in corosync.conf and insert the following line anywhere inside the block:" msgstr "如果要更改集群的名称,找到包含name:pacemaker的配置文件区域,然后添加如下所示的选项即可。" #. Tag: para #, no-c-format msgid "clustername: myname" msgstr "clustername: myname" #. Tag: para #, no-c-format msgid "Do this on each node in the cluster and be sure to restart them before continuing." msgstr "在每个节点都执行以下命令。" #. Tag: screen #, no-c-format msgid "" "\n" "mkfs.gfs2 -p lock_dlm -j 2 -t pcmk:web /dev/drbd1\n" "[root@pcmk-1 ~]# mkfs.gfs2 -t pcmk:web -p lock_dlm -j 2 /dev/vdb \n" "This will destroy any data on /dev/vdb.\n" "It appears to contain: data\n" "\n" "Are you sure you want to proceed? [y/n] y\n" "\n" "Device:                    /dev/vdb\n" "Blocksize:                 4096\n" "Device Size                1.00 GB (131072 blocks)\n" "Filesystem Size:           1.00 GB (131070 blocks)\n" "Journals:                  2\n" "Resource Groups:           2\n" "Locking Protocol:          \"lock_dlm\"\n" "Lock Table:                \"pcmk:web\"\n" "UUID:                      6B776F46-177B-BAF8-2C2B-292C0E078613\n" "\n" "[root@pcmk-1 ~]#\n" msgstr "" "\n" "mkfs.gfs2 -p lock_dlm -j 2 -t pcmk:web /dev/drbd1\n" "[root@pcmk-1 ~]# mkfs.gfs2 -t pcmk:web -p lock_dlm -j 2 /dev/vdb \n" "This will destroy any data on /dev/vdb.\n" "It appears to contain: data\n" "\n" "Are you sure you want to proceed? [y/n] y\n" "\n" "Device:                    /dev/vdb\n" "Blocksize:                 4096\n" "Device Size                1.00 GB (131072 blocks)\n" "Filesystem Size:           1.00 GB (131070 blocks)\n" "Journals:                  2\n" "Resource Groups:           2\n" "Locking Protocol:          \"lock_dlm\"\n" "Lock Table:                \"pcmk:web\"\n" "UUID:                      6B776F46-177B-BAF8-2C2B-292C0E078613\n" "\n" "[root@pcmk-1 ~]#\n" #. Tag: para #, no-c-format msgid "Then (re)populate the new filesystem with data (web pages). For now we’ll create another variation on our home page." msgstr "然后再迁移数据到这个新的文件系统。现在我们创建一个跟上次不一样的主页。" #. Tag: screen #, no-c-format msgid "" "\n" "[root@pcmk-1 ~]# mount /dev/drbd1 /mnt/\n" "[root@pcmk-1 ~]# cat <<-END >/mnt/index.html\n" "<html>\n" "<body>My Test Site - GFS2</body>\n" "</html>\n" "END\n" "[root@pcmk-1 ~]# umount /dev/drbd1\n" "[root@pcmk-1 ~]# drbdadm verify wwwdata\n" "[root@pcmk-1 ~]#\n" msgstr "" "\n" "[root@pcmk-1 ~]# mount /dev/drbd1 /mnt/\n" "[root@pcmk-1 ~]# cat <<-END >/mnt/index.html\n" "<html>\n" "<body>My Test Site - GFS2</body>\n" "</html>\n" "END\n" "[root@pcmk-1 ~]# umount /dev/drbd1\n" "[root@pcmk-1 ~]# drbdadm verify wwwdata\n" "[root@pcmk-1 ~]#\n" #. Tag: title #, no-c-format msgid "Reconfigure the Cluster for GFS2" msgstr "8.5. 重新为集群配置GFS2" #. Tag: screen #, no-c-format msgid "" "\n" "[root@pcmk-1 ~]# crm\n" "crm(live)# cib new GFS2\n" "INFO: GFS2 shadow CIB created\n" "crm(GFS2)# configure delete WebFS\n" "crm(GFS2)# configure primitive WebFS ocf:heartbeat:Filesystem params device=\"/dev/drbd/by-res/wwwdata\" directory=\"/var/www/html\" fstype=”gfs2”\n" msgstr "" "\n" "[root@pcmk-1 ~]# crm\n" "crm(live)# cib new GFS2\n" "INFO: GFS2 shadow CIB created\n" "crm(GFS2)# configure delete WebFS\n" "crm(GFS2)# configure primitive WebFS ocf:heartbeat:Filesystem params device=\"/dev/drbd/by-res/wwwdata\" directory=\"/var/www/html\" fstype=”gfs2”\n" #. Tag: para #, no-c-format msgid "Now that we’ve recreated the resource, we also need to recreate all the constraints that used it. This is because the shell will automatically remove any constraints that referenced WebFS." msgstr "现在我们重新创建这个资源, 我们也要重建跟这个资源相关的约束条件,因为shell会自动删除跟WebFS相关的约束条件。" #. Tag: screen #, no-c-format msgid "" "\n" "crm(GFS2)# configure colocation WebSite-with-WebFS inf: WebSite WebFS\n" "crm(GFS2)# configure colocation fs_on_drbd inf: WebFS WebDataClone:Master\n" "crm(GFS2)# configure order WebFS-after-WebData inf: WebDataClone:promote WebFS:start\n" "crm(GFS2)# configure order WebSite-after-WebFS inf: WebFS WebSite\n" "crm(GFS2)# configure colocation WebFS-with-gfs-control INFINITY: WebFS gfs-clone\n" "crm(GFS2)# configure order start-WebFS-after-gfs-control mandatory: gfs-clone WebFS\n" "crm(GFS2)# configure show\n" "node pcmk-1\n" "node pcmk-2\n" "primitive WebData ocf:linbit:drbd \\\n" "        params drbd_resource=\"wwwdata\" \\\n" "        op monitor interval=\"60s\"\n" "primitive WebFS ocf:heartbeat:Filesystem \\\n" " params device=\"/dev/drbd/by-res/wwwdata\" directory=\"/var/www/html\" fstype=”gfs2”\n" "primitive WebSite ocf:heartbeat:apache \\\n" "        params configfile=\"/etc/httpd/conf/httpd.conf\" \\\n" "        op monitor interval=\"1min\"\n" "primitive ClusterIP ocf:heartbeat:IPaddr2 \\\n" "        params ip=\"192.168.122.101\" cidr_netmask=\"32\" \\\n" "        op monitor interval=\"30s\"\n" "primitive dlm ocf:pacemaker:controld \\\n" "        op monitor interval=\"120s\"\n" "primitive gfs-control ocf:pacemaker:controld \\\n" "   params daemon=”gfs_controld.pcmk” args=”-g 0” \\\n" "        op monitor interval=\"120s\"\n" "ms WebDataClone WebData \\\n" "        meta master-max=\"1\" master-node-max=\"1\" clone-max=\"2\" clone-node-max=\"1\" notify=\"true\"\n" "clone dlm-clone dlm \\\n" "        meta interleave=\"true\"\n" "clone gfs-clone gfs-control \\\n" "        meta interleave=\"true\"\n" "colocation WebFS-with-gfs-control inf: WebFS gfs-clone\n" "colocation WebSite-with-WebFS inf: WebSite WebFS\n" "colocation fs_on_drbd inf: WebFS WebDataClone:Master\n" "colocation gfs-with-dlm inf: gfs-clone dlm-clone\n" "colocation website-with-ip inf: WebSite ClusterIP\n" "order WebFS-after-WebData inf: WebDataClone:promote WebFS:start\n" "order WebSite-after-WebFS inf: WebFS WebSite\n" "order apache-after-ip inf: ClusterIP WebSite\n" "order start-WebFS-after-gfs-control inf: gfs-clone WebFS\n" "order start-gfs-after-dlm inf: dlm-clone gfs-clone\n" "property $id=\"cib-bootstrap-options\" \\\n" "        dc-version=\"1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\" \\\n" "        cluster-infrastructure=\"openais\" \\\n" "        expected-quorum-votes=”2” \\\n" "        stonith-enabled=\"false\" \\\n" "        no-quorum-policy=\"ignore\"\n" "rsc_defaults $id=\"rsc-options\" \\\n" "        resource-stickiness=”100”\n" msgstr "" "\n" "crm(GFS2)# configure colocation WebSite-with-WebFS inf: WebSite WebFS\n" "crm(GFS2)# configure colocation fs_on_drbd inf: WebFS WebDataClone:Master\n" "crm(GFS2)# configure order WebFS-after-WebData inf: WebDataClone:promote WebFS:start\n" "crm(GFS2)# configure order WebSite-after-WebFS inf: WebFS WebSite\n" "crm(GFS2)# configure colocation WebFS-with-gfs-control INFINITY: WebFS gfs-clone\n" "crm(GFS2)# configure order start-WebFS-after-gfs-control mandatory: gfs-clone WebFS\n" "crm(GFS2)# configure show\n" "node pcmk-1\n" "node pcmk-2\n" "primitive WebData ocf:linbit:drbd \\\n" "        params drbd_resource=\"wwwdata\" \\\n" "        op monitor interval=\"60s\"\n" "primitive WebFS ocf:heartbeat:Filesystem \\\n" " params device=\"/dev/drbd/by-res/wwwdata\" directory=\"/var/www/html\" fstype=”gfs2”\n" "primitive WebSite ocf:heartbeat:apache \\\n" "        params configfile=\"/etc/httpd/conf/httpd.conf\" \\\n" "        op monitor interval=\"1min\"\n" "primitive ClusterIP ocf:heartbeat:IPaddr2 \\\n" "        params ip=\"192.168.122.101\" cidr_netmask=\"32\" \\\n" "        op monitor interval=\"30s\"\n" "primitive dlm ocf:pacemaker:controld \\\n" "        op monitor interval=\"120s\"\n" "primitive gfs-control ocf:pacemaker:controld \\\n" "   params daemon=”gfs_controld.pcmk” args=”-g 0” \\\n" "        op monitor interval=\"120s\"\n" "ms WebDataClone WebData \\\n" "        meta master-max=\"1\" master-node-max=\"1\" clone-max=\"2\" clone-node-max=\"1\" notify=\"true\"\n" "clone dlm-clone dlm \\\n" "        meta interleave=\"true\"\n" "clone gfs-clone gfs-control \\\n" "        meta interleave=\"true\"\n" "colocation WebFS-with-gfs-control inf: WebFS gfs-clone\n" "colocation WebSite-with-WebFS inf: WebSite WebFS\n" "colocation fs_on_drbd inf: WebFS WebDataClone:Master\n" "colocation gfs-with-dlm inf: gfs-clone dlm-clone\n" "colocation website-with-ip inf: WebSite ClusterIP\n" "order WebFS-after-WebData inf: WebDataClone:promote WebFS:start\n" "order WebSite-after-WebFS inf: WebFS WebSite\n" "order apache-after-ip inf: ClusterIP WebSite\n" "order start-WebFS-after-gfs-control inf: gfs-clone WebFS\n" "order start-gfs-after-dlm inf: dlm-clone gfs-clone\n" "property $id=\"cib-bootstrap-options\" \\\n" "        dc-version=\"1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\" \\\n" "        cluster-infrastructure=\"openais\" \\\n" "        expected-quorum-votes=”2” \\\n" "        stonith-enabled=\"false\" \\\n" "        no-quorum-policy=\"ignore\"\n" "rsc_defaults $id=\"rsc-options\" \\\n" "        resource-stickiness=”100”\n" #. Tag: screen #, no-c-format msgid "" "\n" "crm(GFS2)# cib commit GFS2\n" "INFO: commited 'GFS2' shadow CIB to the cluster\n" "crm(GFS2)# quit\n" "bye\n" "[root@pcmk-1 ~]# crm_mon\n" "============\n" "Last updated: Thu Sep  3 20:49:54 2009\n" "Stack: openais\n" "Current DC: pcmk-2 - partition with quorum\n" "Version: 1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\n" "2 Nodes configured, 2 expected votes\n" "6 Resources configured.\n" "============\n" "\n" "Online: [ pcmk-1 pcmk-2 ]\n" "\n" "WebSite (ocf::heartbeat:apache):        Started pcmk-2\n" "Master/Slave Set: WebDataClone\n" "        Masters: [ pcmk-1 ]\n" "        Slaves: [ pcmk-2 ]\n" "ClusterIP        (ocf::heartbeat:IPaddr):        Started pcmk-2\n" "Clone Set: dlm-clone\n" "        Started: [ pcmk-2 pcmk-1 ]\n" "Clone Set: gfs-clone\n" "        Started: [ pcmk-2 pcmk-1 ]\n" "WebFS (ocf::heartbeat:Filesystem): Started pcmk-1\n" msgstr "" "\n" "crm(GFS2)# cib commit GFS2\n" "INFO: commited 'GFS2' shadow CIB to the cluster\n" "crm(GFS2)# quit\n" "bye\n" "[root@pcmk-1 ~]# crm_mon\n" "============\n" "Last updated: Thu Sep  3 20:49:54 2009\n" "Stack: openais\n" "Current DC: pcmk-2 - partition with quorum\n" "Version: 1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\n" "2 Nodes configured, 2 expected votes\n" "6 Resources configured.\n" "============\n" "\n" "Online: [ pcmk-1 pcmk-2 ]\n" "\n" "WebSite (ocf::heartbeat:apache):        Started pcmk-2\n" "Master/Slave Set: WebDataClone\n" "        Masters: [ pcmk-1 ]\n" "        Slaves: [ pcmk-2 ]\n" "ClusterIP        (ocf::heartbeat:IPaddr):        Started pcmk-2\n" "Clone Set: dlm-clone\n" "        Started: [ pcmk-2 pcmk-1 ]\n" "Clone Set: gfs-clone\n" "        Started: [ pcmk-2 pcmk-1 ]\n" "WebFS (ocf::heartbeat:Filesystem): Started pcmk-1\n" #. Tag: title #, no-c-format msgid "Reconfigure Pacemaker for Active/Active" msgstr "重新配置 Pacemaker 为 Active/Active" #. Tag: para #, no-c-format msgid "Almost everything is in place. Recent versions of DRBD are capable of operating in Primary/Primary mode and the filesystem we’re using is cluster aware. All we need to do now is reconfigure the cluster to take advantage of this." msgstr "基本上所有的事情都已经准备就绪了。最新的DRBD是支持 Primary/Primary(主/主)模式的,并且我们的文件系统的是针对集群的。所有我们要做的事情就是重新配置我们的集群来使用它们(的先进功能)。" #. Tag: para #, no-c-format msgid "This will involve a number of changes, so we’ll again use interactive mode." msgstr "这次操作会改很多东西,所以我们再次使用交互模式" #. Tag: screen #, no-c-format msgid "" "\n" "[root@pcmk-1 ~]# crm\n" "[root@pcmk-1 ~]# cib new active\n" " " msgstr "" "\n" "[root@pcmk-1 ~]# crm\n" "[root@pcmk-1 ~]# cib new active\n" " " #. Tag: para #, no-c-format msgid "There’s no point making the services active on both locations if we can’t reach them, so lets first clone the IP address. Cloned IPaddr2 resources use an iptables rule to ensure that each request only processed by one of the two clone instances. The additional meta options tell the cluster how many instances of the clone we want (one “request bucket” for each node) and that if all other nodes fail, then the remaining node should hold all of them. Otherwise the requests would be simply discarded." msgstr "如果我们不能访问这些服务,那做成 Active/Active是没有必要的,所以我们要先clone这个IP地址,克隆的IPaddr2资源用的是iptables规则来保证每个请求都只由一个节点来处理。附件的meta选项告诉集群我们要克隆多少个实例(每个节点一个\"请求桶\")。并且如果其他节点挂了,剩下的节点可以处理所有的请求。否则这些请求都会被丢弃。" #. Tag: screen #, no-c-format msgid "" "\n" "[root@pcmk-1 ~]# configure clone WebIP ClusterIP  \\\n" "        meta globally-unique=”true” clone-max=”2” clone-node-max=”2”\n" " " msgstr "" "\n" "[root@pcmk-1 ~]# configure clone WebIP ClusterIP  \\\n" "        meta globally-unique=”true” clone-max=”2” clone-node-max=”2”\n" " " #. Tag: para #, no-c-format msgid "Now we must tell the ClusterIP how to decide which requests are processed by which hosts. To do this we must specify the clusterip_hash parameter." msgstr "现在我们要告诉集群如何决定请求怎样分配给节点。我们要设置 clusterip_hash这个参数来实现它。" #. Tag: para #, no-c-format msgid "Open the ClusterIP resource" msgstr "打开ClusterIP的配置" #. Tag: screen #, no-c-format msgid "[root@pcmk-1 ~]# configure edit  ClusterIP" msgstr "[root@pcmk-1 ~]# configure edit  ClusterIP" #. Tag: para #, no-c-format msgid "And add the following to the params line" msgstr "在参数行添加以下内容:" #. Tag: screen #, no-c-format msgid "clusterip_hash=\"sourceip\"" msgstr "clusterip_hash=\"sourceip\"" #. Tag: para #, no-c-format msgid "So that the complete definition looks like:" msgstr "完整的定义就像下面一样:" #. Tag: screen #, no-c-format msgid "" "\n" "primitive ClusterIP ocf:heartbeat:IPaddr2 \\ \n" "        params ip=\"192.168.122.101\" cidr_netmask=\"32\" clusterip_hash=\"sourceip\" \\\n" "        op monitor interval=\"30s\"\n" " " msgstr "" "\n" "primitive ClusterIP ocf:heartbeat:IPaddr2 \\ \n" "        params ip=\"192.168.122.101\" cidr_netmask=\"32\" clusterip_hash=\"sourceip\" \\\n" "        op monitor interval=\"30s\"\n" " " #. Tag: para #, no-c-format msgid "Here is the full transcript" msgstr "以下是完整的配置" #. Tag: screen #, no-c-format msgid "" "\n" "[root@pcmk-1 ~]# crm \n" "crm(live)# cib new active\n" "INFO: active shadow CIB created\n" "crm(active)# configure clone WebIP ClusterIP  \\\n" "        meta globally-unique=”true” clone-max=”2” clone-node-max=”2”\n" "crm(active)# configure show\n" "node pcmk-1\n" "node pcmk-2\n" "primitive WebData ocf:linbit:drbd \\\n" "        params drbd_resource=\"wwwdata\" \\\n" "        op monitor interval=\"60s\"\n" "primitive WebFS ocf:heartbeat:Filesystem \\\n" "        params device=\"/dev/drbd/by-res/wwwdata\" directory=\"/var/www/html\" fstype=”gfs2”\n" "primitive WebSite ocf:heartbeat:apache \\\n" "        params configfile=\"/etc/httpd/conf/httpd.conf\" \\\n" "        op monitor interval=\"1min\"\n" "primitive ClusterIP ocf:heartbeat:IPaddr2 \\\n" "        params ip=”192.168.122.101” cidr_netmask=”32” clusterip_hash=”sourceip” \\\n" "        op monitor interval=\"30s\"\n" "primitive dlm ocf:pacemaker:controld \\\n" "        op monitor interval=\"120s\"\n" "primitive gfs-control ocf:pacemaker:controld \\\n" "   params daemon=”gfs_controld.pcmk” args=”-g 0” \\\n" "        op monitor interval=\"120s\"\n" "ms WebDataClone WebData \\\n" "        meta master-max=\"1\" master-node-max=\"1\" clone-max=\"2\" clone-node-max=\"1\" notify=\"true\"\n" "clone WebIP ClusterIP \\\n" " meta globally-unique=”true” clone-max=”2” clone-node-max=”2”\n" "clone dlm-clone dlm \\\n" "        meta interleave=\"true\"\n" "clone gfs-clone gfs-control \\\n" "        meta interleave=\"true\"\n" "colocation WebFS-with-gfs-control inf: WebFS gfs-clone\n" "colocation WebSite-with-WebFS inf: WebSite WebFS\n" "colocation fs_on_drbd inf: WebFS WebDataClone:Master\n" "colocation gfs-with-dlm inf: gfs-clone dlm-clone\n" "colocation website-with-ip inf: WebSite WebIP\n" "order WebFS-after-WebData inf: WebDataClone:promote WebFS:start\n" "order WebSite-after-WebFS inf: WebFS WebSite\n" "order apache-after-ip inf: WebIP WebSite\n" "order start-WebFS-after-gfs-control inf: gfs-clone WebFS\n" "order start-gfs-after-dlm inf: dlm-clone gfs-clone\n" "property $id=\"cib-bootstrap-options\" \\\n" "        dc-version=\"1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\" \\\n" "        cluster-infrastructure=\"openais\" \\\n" "        expected-quorum-votes=”2” \\\n" "        stonith-enabled=\"false\" \\\n" "        no-quorum-policy=\"ignore\"\n" "rsc_defaults $id=\"rsc-options\" \\\n" "        resource-stickiness=”100”\n" " " msgstr "" "\n" "[root@pcmk-1 ~]# crm \n" "crm(live)# cib new active\n" "INFO: active shadow CIB created\n" "crm(active)# configure clone WebIP ClusterIP  \\\n" "        meta globally-unique=”true” clone-max=”2” clone-node-max=”2”\n" "crm(active)# configure show\n" "node pcmk-1\n" "node pcmk-2\n" "primitive WebData ocf:linbit:drbd \\\n" "        params drbd_resource=\"wwwdata\" \\\n" "        op monitor interval=\"60s\"\n" "primitive WebFS ocf:heartbeat:Filesystem \\\n" "        params device=\"/dev/drbd/by-res/wwwdata\" directory=\"/var/www/html\" fstype=”gfs2”\n" "primitive WebSite ocf:heartbeat:apache \\\n" "        params configfile=\"/etc/httpd/conf/httpd.conf\" \\\n" "        op monitor interval=\"1min\"\n" "primitive ClusterIP ocf:heartbeat:IPaddr2 \\\n" "        params ip=”192.168.122.101” cidr_netmask=”32” clusterip_hash=”sourceip” \\\n" "        op monitor interval=\"30s\"\n" "primitive dlm ocf:pacemaker:controld \\\n" "        op monitor interval=\"120s\"\n" "primitive gfs-control ocf:pacemaker:controld \\\n" "   params daemon=”gfs_controld.pcmk” args=”-g 0” \\\n" "        op monitor interval=\"120s\"\n" "ms WebDataClone WebData \\\n" "        meta master-max=\"1\" master-node-max=\"1\" clone-max=\"2\" clone-node-max=\"1\" notify=\"true\"\n" "clone WebIP ClusterIP \\\n" " meta globally-unique=”true” clone-max=”2” clone-node-max=”2”\n" "clone dlm-clone dlm \\\n" "        meta interleave=\"true\"\n" "clone gfs-clone gfs-control \\\n" "        meta interleave=\"true\"\n" "colocation WebFS-with-gfs-control inf: WebFS gfs-clone\n" "colocation WebSite-with-WebFS inf: WebSite WebFS\n" "colocation fs_on_drbd inf: WebFS WebDataClone:Master\n" "colocation gfs-with-dlm inf: gfs-clone dlm-clone\n" "colocation website-with-ip inf: WebSite WebIP\n" "order WebFS-after-WebData inf: WebDataClone:promote WebFS:start\n" "order WebSite-after-WebFS inf: WebFS WebSite\n" "order apache-after-ip inf: WebIP WebSite\n" "order start-WebFS-after-gfs-control inf: gfs-clone WebFS\n" "order start-gfs-after-dlm inf: dlm-clone gfs-clone\n" "property $id=\"cib-bootstrap-options\" \\\n" "        dc-version=\"1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\" \\\n" "        cluster-infrastructure=\"openais\" \\\n" "        expected-quorum-votes=”2” \\\n" "        stonith-enabled=\"false\" \\\n" "        no-quorum-policy=\"ignore\"\n" "rsc_defaults $id=\"rsc-options\" \\\n" "        resource-stickiness=”100”\n" " " #. Tag: para #, no-c-format msgid "Notice how any constraints that referenced ClusterIP have been updated to use WebIP instead. This is an additional benefit of using the crm shell." msgstr "请注意所有跟ClusterIP相关的限制都已经被更新到与WebIP相关,这是使用crm shell的另一个好处。" #. Tag: para #, no-c-format msgid "Next we need to convert the filesystem and Apache resources into clones. Again, the shell will automatically update any relevant constraints." msgstr "然后我们要把文件系统和apache资源变成clones。同样的 crm shell会自动更新相关约束。" #. Tag: screen #, no-c-format msgid "" "\n" "crm(active)# configure clone WebFSClone WebFS\n" "crm(active)# configure clone WebSiteClone WebSite\n" " " msgstr "" "\n" "crm(active)# configure clone WebFSClone WebFS\n" "crm(active)# configure clone WebSiteClone WebSite\n" " " #. Tag: para #, no-c-format msgid "The last step is to tell the cluster that it is now allowed to promote both instances to be Primary (aka. Master)." msgstr "最后要告诉集群现在允许把两个节点都提升为 Primary(换句话说 Master)." #. Tag: screen #, no-c-format msgid "" "\n" "crm(active)# configure edit WebDataClone\n" " " msgstr "" "\n" "crm(active)# configure edit WebDataClone\n" " " #. Tag: para #, no-c-format msgid "Change master-max to 2" msgstr "把 master-max 改为 2" #. Tag: screen #, no-c-format msgid "" "\n" "crm(active)# configure show\n" "node pcmk-1\n" "node pcmk-2\n" "primitive WebData ocf:linbit:drbd \\\n" "        params drbd_resource=\"wwwdata\" \\\n" "        op monitor interval=\"60s\"\n" "primitive WebFS ocf:heartbeat:Filesystem \\\n" "        params device=\"/dev/drbd/by-res/wwwdata\" directory=\"/var/www/html\" fstype=”gfs2”\n" "primitive WebSite ocf:heartbeat:apache \\\n" "        params configfile=\"/etc/httpd/conf/httpd.conf\" \\\n" "        op monitor interval=\"1min\"\n" "primitive ClusterIP ocf:heartbeat:IPaddr2 \\\n" "        params ip=”192.168.122.101” cidr_netmask=”32” clusterip_hash=”sourceip” \\\n" "        op monitor interval=\"30s\"\n" "primitive dlm ocf:pacemaker:controld \\\n" "        op monitor interval=\"120s\"\n" "primitive gfs-control ocf:pacemaker:controld \\\n" "   params daemon=”gfs_controld.pcmk” args=”-g 0” \\\n" "        op monitor interval=\"120s\"\n" "ms WebDataClone WebData \\\n" "        meta master-max=\"2\" master-node-max=\"1\" clone-max=\"2\" clone-node-max=\"1\" notify=\"true\"\n" "clone WebFSClone WebFS\n" "clone WebIP ClusterIP  \\\n" "        meta globally-unique=”true” clone-max=”2” clone-node-max=”2”\n" "clone WebSiteClone WebSite\n" "clone dlm-clone dlm \\\n" "        meta interleave=\"true\"\n" "clone gfs-clone gfs-control \\\n" "        meta interleave=\"true\"\n" "colocation WebFS-with-gfs-control inf: WebFSClone gfs-clone\n" "colocation WebSite-with-WebFS inf: WebSiteClone WebFSClone\n" "colocation fs_on_drbd inf: WebFSClone WebDataClone:Master\n" "colocation gfs-with-dlm inf: gfs-clone dlm-clone\n" "colocation website-with-ip inf: WebSiteClone WebIP\n" "order WebFS-after-WebData inf: WebDataClone:promote WebFSClone:start\n" "order WebSite-after-WebFS inf: WebFSClone WebSiteClone\n" "order apache-after-ip inf: WebIP WebSiteClone\n" "order start-WebFS-after-gfs-control inf: gfs-clone WebFSClone\n" "order start-gfs-after-dlm inf: dlm-clone gfs-clone\n" "property $id=\"cib-bootstrap-options\" \\\n" "        dc-version=\"1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\" \\\n" "        cluster-infrastructure=\"openais\" \\\n" "        expected-quorum-votes=”2” \\\n" "        stonith-enabled=\"false\" \\\n" "        no-quorum-policy=\"ignore\"\n" "rsc_defaults $id=\"rsc-options\" \\\n" "        resource-stickiness=”100”\n" " " msgstr "" "\n" "crm(active)# configure show\n" "node pcmk-1\n" "node pcmk-2\n" "primitive WebData ocf:linbit:drbd \\\n" "        params drbd_resource=\"wwwdata\" \\\n" "        op monitor interval=\"60s\"\n" "primitive WebFS ocf:heartbeat:Filesystem \\\n" "        params device=\"/dev/drbd/by-res/wwwdata\" directory=\"/var/www/html\" fstype=”gfs2”\n" "primitive WebSite ocf:heartbeat:apache \\\n" "        params configfile=\"/etc/httpd/conf/httpd.conf\" \\\n" "        op monitor interval=\"1min\"\n" "primitive ClusterIP ocf:heartbeat:IPaddr2 \\\n" "        params ip=”192.168.122.101” cidr_netmask=”32” clusterip_hash=”sourceip” \\\n" "        op monitor interval=\"30s\"\n" "primitive dlm ocf:pacemaker:controld \\\n" "        op monitor interval=\"120s\"\n" "primitive gfs-control ocf:pacemaker:controld \\\n" "   params daemon=”gfs_controld.pcmk” args=”-g 0” \\\n" "        op monitor interval=\"120s\"\n" "ms WebDataClone WebData \\\n" "        meta master-max=\"2\" master-node-max=\"1\" clone-max=\"2\" clone-node-max=\"1\" notify=\"true\"\n" "clone WebFSClone WebFS\n" "clone WebIP ClusterIP  \\\n" "        meta globally-unique=”true” clone-max=”2” clone-node-max=”2”\n" "clone WebSiteClone WebSite\n" "clone dlm-clone dlm \\\n" "        meta interleave=\"true\"\n" "clone gfs-clone gfs-control \\\n" "        meta interleave=\"true\"\n" "colocation WebFS-with-gfs-control inf: WebFSClone gfs-clone\n" "colocation WebSite-with-WebFS inf: WebSiteClone WebFSClone\n" "colocation fs_on_drbd inf: WebFSClone WebDataClone:Master\n" "colocation gfs-with-dlm inf: gfs-clone dlm-clone\n" "colocation website-with-ip inf: WebSiteClone WebIP\n" "order WebFS-after-WebData inf: WebDataClone:promote WebFSClone:start\n" "order WebSite-after-WebFS inf: WebFSClone WebSiteClone\n" "order apache-after-ip inf: WebIP WebSiteClone\n" "order start-WebFS-after-gfs-control inf: gfs-clone WebFSClone\n" "order start-gfs-after-dlm inf: dlm-clone gfs-clone\n" "property $id=\"cib-bootstrap-options\" \\\n" "        dc-version=\"1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\" \\\n" "        cluster-infrastructure=\"openais\" \\\n" "        expected-quorum-votes=”2” \\\n" "        stonith-enabled=\"false\" \\\n" "        no-quorum-policy=\"ignore\"\n" "rsc_defaults $id=\"rsc-options\" \\\n" "        resource-stickiness=”100”\n" " " #. Tag: screen #, no-c-format msgid "" "\n" "crm(active)# cib commit active\n" "INFO: commited 'active' shadow CIB to the cluster\n" "crm(active)# quit\n" "bye\n" "[root@pcmk-1 ~]# crm_mon\n" "============\n" "Last updated: Thu Sep  3 21:37:27 2009\n" "Stack: openais\n" "Current DC: pcmk-2 - partition with quorum\n" "Version: 1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\n" "2 Nodes configured, 2 expected votes\n" "6 Resources configured.\n" "============\n" "\n" "Online: [ pcmk-1 pcmk-2 ]\n" "\n" "Master/Slave Set: WebDataClone\n" "        Masters: [ pcmk-1 pcmk-2 ]\n" "Clone Set: dlm-clone\n" "        Started: [ pcmk-2 pcmk-1 ]\n" "Clone Set: gfs-clone\n" "        Started: [ pcmk-2 pcmk-1 ]\n" "Clone Set: WebIP\n" " Started: [ pcmk-1 pcmk-2 ]\n" "Clone Set: WebFSClone\n" " Started: [ pcmk-1 pcmk-2 ]\n" "Clone Set: WebSiteClone\n" " Started: [ pcmk-1 pcmk-2 ]\n" " " msgstr "" "\n" "crm(active)# cib commit active\n" "INFO: commited 'active' shadow CIB to the cluster\n" "crm(active)# quit\n" "bye\n" "[root@pcmk-1 ~]# crm_mon\n" "============\n" "Last updated: Thu Sep  3 21:37:27 2009\n" "Stack: openais\n" "Current DC: pcmk-2 - partition with quorum\n" "Version: 1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7\n" "2 Nodes configured, 2 expected votes\n" "6 Resources configured.\n" "============\n" "\n" "Online: [ pcmk-1 pcmk-2 ]\n" "\n" "Master/Slave Set: WebDataClone\n" "        Masters: [ pcmk-1 pcmk-2 ]\n" "Clone Set: dlm-clone\n" "        Started: [ pcmk-2 pcmk-1 ]\n" "Clone Set: gfs-clone\n" "        Started: [ pcmk-2 pcmk-1 ]\n" "Clone Set: WebIP\n" " Started: [ pcmk-1 pcmk-2 ]\n" "Clone Set: WebFSClone\n" " Started: [ pcmk-1 pcmk-2 ]\n" "Clone Set: WebSiteClone\n" " Started: [ pcmk-1 pcmk-2 ]\n" " " #. Tag: title #, no-c-format msgid "Testing Recovery" msgstr "恢复测试" #. Tag: para #, no-c-format msgid "TODO: Put one node into standby to demonstrate failover" msgstr "TODO: Put one node into standby to demonstrate failover" #~ msgid "The list of nodes the cluster considers to be available" #~ msgstr "集群认为列表中的节点都是可用的" #~ msgid "information and fencing capabilities." #~ msgstr "信息和隔离功能。"