From owner-p4-projects@FreeBSD.ORG Sun Mar 6 21:19:15 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E225E1065674; Sun, 6 Mar 2011 21:19:14 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A412C1065670 for ; Sun, 6 Mar 2011 21:19:14 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 8ED278FC15 for ; Sun, 6 Mar 2011 21:19:14 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p26LJEaZ021462 for ; Sun, 6 Mar 2011 21:19:14 GMT (envelope-from rene@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p26LJE1b021459 for perforce@freebsd.org; Sun, 6 Mar 2011 21:19:14 GMT (envelope-from rene@FreeBSD.org) Date: Sun, 6 Mar 2011 21:19:14 GMT Message-Id: <201103062119.p26LJE1b021459@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to rene@FreeBSD.org using -f From: Rene Ladan To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 189626 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 21:19:15 -0000 http://p4web.freebsd.org/@@189626?ac=10 Change 189626 by rene@rene_acer on 2011/03/06 21:18:12 IFC Affected files ... .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml#86 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/freebsd-update-server/Makefile#2 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/freebsd-update-server/article.sgml#2 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/mailing-list-faq/article.sgml#3 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/portbuild/article.sgml#31 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/desktop/chapter.sgml#18 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/disks/chapter.sgml#18 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/multimedia/chapter.sgml#12 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/network-servers/chapter.sgml#24 integrate .. //depot/projects/docproj_nl/share/sgml/freebsd.ent#20 integrate .. //depot/projects/docproj_nl/share/sgml/mirrors.xml#24 integrate .. //depot/projects/docproj_nl/www/en/cgi/man.cgi#22 integrate .. //depot/projects/docproj_nl/www/en/gnome/index.xsl#8 integrate .. //depot/projects/docproj_nl/www/en/releases/7.4R/Makefile#2 integrate .. //depot/projects/docproj_nl/www/en/releases/7.4R/announce.sgml#1 branch .. //depot/projects/docproj_nl/www/en/releases/7.4R/errata.html#1 branch .. //depot/projects/docproj_nl/www/en/releases/7.4R/hardware.html#1 branch .. //depot/projects/docproj_nl/www/en/releases/7.4R/readme.html#1 branch .. //depot/projects/docproj_nl/www/en/releases/7.4R/relnotes.html#1 branch .. //depot/projects/docproj_nl/www/en/releases/8.2R/Makefile#2 integrate .. //depot/projects/docproj_nl/www/en/releases/8.2R/announce.sgml#1 branch .. //depot/projects/docproj_nl/www/en/releases/8.2R/errata.html#1 branch .. //depot/projects/docproj_nl/www/en/releases/8.2R/hardware.html#1 branch .. //depot/projects/docproj_nl/www/en/releases/8.2R/readme.html#1 branch .. //depot/projects/docproj_nl/www/en/releases/8.2R/relnotes-detailed.html#1 branch .. //depot/projects/docproj_nl/www/en/releases/8.2R/relnotes.sgml#1 branch .. //depot/projects/docproj_nl/www/en/releases/index.sgml#13 integrate .. //depot/projects/docproj_nl/www/en/releng/index.sgml#40 integrate .. //depot/projects/docproj_nl/www/en/search/web.atoz#5 integrate .. //depot/projects/docproj_nl/www/en/security/security.sgml#19 integrate .. //depot/projects/docproj_nl/www/share/sgml/commercial.isp.xml#23 integrate .. //depot/projects/docproj_nl/www/share/sgml/news.xml#102 integrate .. //depot/projects/docproj_nl/www/share/sgml/release.ent#34 integrate Differences ... ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml#86 (text+ko) ==== @@ -1,4 +1,4 @@ - + + - $FreeBSD: doc/en_US.ISO8859-1/articles/mailing-list-faq/article.sgml,v 1.8 2009/11/14 22:20:12 manolis Exp $ + $FreeBSD: doc/en_US.ISO8859-1/articles/mailing-list-faq/article.sgml,v 1.9 2011/02/27 03:54:21 dougb Exp $ 2004 @@ -484,22 +484,19 @@ some questions recur more often than others, sometimes as followups where the subject line no longer accurately reflects the new content. Nevertheless, the burden is on you, the poster, to do your homework - to help avoid these recurring topics, and especially the dreaded - bikesheds. + to help avoid these recurring topics. What Is A "Bikeshed"? Literally, a bikeshed is a small outdoor shelter into which one may store one's two-wheeled form of - transportation. However, in &os; parlance, the word is a - derogatory term that refers to any oft-recurring discussion - about a particular subject; in particular, it is most often used - to refer to a topic which has never reached a consensus within - the &os; community, and instead remains controversial. (The + transportation. However, in &os; parlance, the term refers to + topics that are simple enough that (nearly) anyone can offer an + opinion about, and often (nearly) everyone does. The genesis of this term is explained in more detail - in this document). You simply must have a working + in this document. You simply must have a working knowledge of this concept before posting to any &os; mailing list. ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/portbuild/article.sgml#31 (text+ko) ==== @@ -11,7 +11,7 @@ The &os; Ports Management Team - $FreeBSD: doc/en_US.ISO8859-1/articles/portbuild/article.sgml,v 1.67 2011/01/23 04:07:34 linimon Exp $ + $FreeBSD: doc/en_US.ISO8859-1/articles/portbuild/article.sgml,v 1.68 2011/02/26 00:58:15 linimon Exp $ 2003 @@ -1141,16 +1141,9 @@ Distfiles should be transferred with the cpdistfiles script: - &prompt.root; /var/portbuild/scripts/cpdistfiles ${arch} ${branch} + &prompt.root; /var/portbuild/scripts/cpdistfiles ${arch} ${branch} ${buildid} [-yesreally] | tee log2 - Or you can do it by hand using rsync - command: - - &prompt.root; cd /var/portbuild/${arch}/${branch} -&prompt.root; rsync -n -r -v -l -p -c distfiles/ portmgr@ftp-master:w/ports/distfiles/ | tee log - - Again, run the command without the -n - option after you have checked it. + Doing it by hand is deprecated. ==== //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/desktop/chapter.sgml#18 (text+ko) ==== @@ -1,6 +1,6 @@ @@ -355,6 +355,11 @@ &prompt.root; ln -s /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so \ /usr/local/lib/browser_plugins/ + + The /usr/local/lib/browser_plugins + directory will have to be created manually if it does not + exist on the system. ==== //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/disks/chapter.sgml#18 (text+ko) ==== @@ -1,7 +1,7 @@ @@ -3996,6 +3996,667 @@ + + + + + + Daniel + Gerzo + Contributed by + + + + + Freddie + Cash + With inputs from + + + Pawel Jakub + Dawidek + + + Michael W. + Lucas + + + Viktor + Petersson + + + + + + Highly Available Storage (HAST) + + HAST + high availability + + + + Synopsis + + High-availability is one of the main requirements in serious + business applications and highly-available storage is a key + component in such environments. Highly Available STorage, or + HASTHighly Available + STorage, was developed by &a.pjd; as a + framework which allows transparent storage of the same data + across several physically separated machines connected by a + TCP/IP network. HAST can be understood as + a network-based RAID1 (mirror), and is similar to the + DRBD® storage system known from the GNU/&linux; platform. + In combination with other high-availability features of &os; + like CARP, HAST makes it + possible to build a highly-available storage cluster that is + resistant to hardware failures. + + After reading this section, you will know: + + + + What HAST is, how it works and + which features it provides. + + + How to set up and use HAST on + &os;. + + + How to integrate CARP and + &man.devd.8;; to build a robust storage system. + + + + Before reading this section, you should: + + + + Understand &unix; and &os; basics + (). + + + Know how to configure network interfaces and other + core &os; subsystems (). + + + Have a good understanding of &os; networking + (). + + + Use &os; 8.1-RELEASE or newer. + + + + The HAST project was sponsored by The + &os; Foundation with the support from OMCnet Internet Service GmbH + and TransIP BV. + + + + HAST Features + + The main features of the HAST system + are: + + + + Can be used to mask I/O errors on local hard + drives. + + + File system agnostic, thus allowing to use any file + system supported by &os;. + + + Efficient and quick resynchronization, synchronizing + only blocks that were modified during the downtime of a + node. + + + + Can be used in an already deployed environment to add + additional redundancy. + + + Together with CARP, + Heartbeat, or other tools, it + can be used to build a robust and durable storage + system. + + + + + + HAST Operation + + As HAST provides a synchronous + block-level replication of any storage media to several + machines, it requires at least two nodes (physical machines) + — the primary (also known as + master) node, and the + secondary (slave) node. + These two machines together will be called a cluster. + + + HAST is currently limited to two cluster nodes in + total. + + + Since the HAST works in + primary-secondary configuration, it allows only one of the + cluster nodes to be active at any given time. The + primary node, also called + active, is the one which will handle all + the I/O requests to HAST-managed + devices. The secondary node is then being + automatically synchronized from the primary + node. + + The physical components of the HAST + system are: + + + + local disk (on primary node) + + + disk on remote machine (secondary node) + + + + HAST operates synchronously on a block + level, which makes it transparent for file systems and + applications. HAST provides regular GEOM + providers in /dev/hast/ + directory for use by other tools or applications, thus there is + no difference between using HAST-provided + devices and raw disks, partitions, etc. + + Each write, delete or flush operation is sent to the local + disk and to the remote disk over TCP/IP. Each read operation + is served from the local disk, unless the local disk is not + up-to-date or an I/O error occurs. In such case, the read + operation is sent to the secondary node. + + + Synchronization and Replication Modes + + HAST tries to provide fast failure + recovery. For this reason, it is very important to reduce + synchronization time after a node's outage. To provide fast + synchronization, HAST manages an on-disk + bitmap of dirty extents and only synchronizes those during a + regular synchronization (with an exception of the initial + sync). + + There are many ways to handle synchronization. + HAST implements several replication modes + to handle different synchronization methods: + + + + memsync: report write operation + as completed when the local write operation is finished + and when the remote node acknowledges data arrival, but + before actually storing the data. The data on the + remote node will be stored directly after sending the + acknowledgement. This mode is intended to reduce + latency, but still provides very good reliability. The + memsync replication mode is + currently not implemented. + + + fullsync: report write + operation as completed when local write completes and when + remote write completes. This is the safest and the + slowest replication mode. This mode is the + default. + + + async: report write operation + as completed when local write completes. This is the + fastest and the most dangerous replication mode. It + should be used when replicating to a distant node where + latency is too high for other modes. The + async replication mode is currently + not implemented. + + + + + Only the fullsync replication mode + is currently supported. + + + + + + HAST Configuration + + HAST requires + GEOM_GATE support in order to function. + The GENERIC kernel does + not include GEOM_GATE + by default, however the geom_gate.ko + loadable module is available in the default &os; installation. + For stripped-down systems, make sure this module is available. + Alternatively, it is possible to build + GEOM_GATE support into the kernel + statically, by adding the following line to the custom kernel + configuration file: + + options GEOM_GATE + + The HAST framework consists of several + parts from the operating system's point of view: + + + + the &man.hastd.8; daemon responsible for the data + synchronization, + + + the &man.hastctl.8; userland management utility, + + + the &man.hast.conf.5; configuration file. + + + + The following example describes how to configure two nodes + in master-slave / + primary-secondary + operation using HAST to replicate the data + between the two. The nodes will be called + hasta with an IP + address 172.16.0.1 and + hastb with an IP + address 172.16.0.2. Both of these + nodes will have a dedicated hard drive + /dev/ad6 of + the same size for HAST operation. + The HAST pool (sometimes also referred to + as a resource, i.e. the GEOM provider in /dev/hast/) will be called + test. + + The configuration of HAST is being done + in the /etc/hast.conf file. This file + should be the same on both nodes. The simplest configuration + possible is following: + + resource test { + on hasta { + local /dev/ad6 + remote 172.16.0.1 + } + on hastb { + local /dev/ad6 + remote 172.16.0.2 + } +} + + For more advanced configuration, please consult the + &man.hast.conf.5; manual page. + + + It is also possible to use host names in the + remote statements. In such a case, make + sure that these hosts are resolvable, e.g. they are defined + in the /etc/hosts file, or + alternatively in the local DNS. + + + Now that the configuration exists on both nodes, it is + possible to create the HAST pool. Run the + following commands on both nodes to place the initial metadata + onto the local disk, and start the &man.hastd.8; daemon: + + &prompt.root; hastctl create test +&prompt.root; /etc/rc.d/hastd onestart + + + It is not possible to use GEOM + providers with an existing file system (i.e. convert an + existing storage to HAST-managed pool), + because this procedure needs to store some metadata onto the + provider and there will not be enough required space + available. + + + HAST is not responsible for selecting node's role + (primary or secondary). + Node's role has to be configured by an administrator or other + software like Heartbeat using the + &man.hastctl.8; utility. Move to the primary node + (hasta) and + issue the following command: + + &prompt.root; hastctl role primary test + + Similarly, run the following command on the secondary node + (hastb): + + &prompt.root; hastctl role secondary test + + + It may happen that both of the nodes are not able to + communicate with each other and both are configured as + primary nodes; the consequence of this condition is called + split-brain. In order to troubleshoot + this situation, follow the steps described in . + + + It is possible to verify the result with the + &man.hastctl.8; utility on each node: + + &prompt.root; hastctl status test + + The important text is the status line + from its output and it should say complete + on each of the nodes. If it says degraded, + something went wrong. At this point, the synchronization + between the nodes has already started. The synchronization + completes when the hastctl status command + reports 0 bytes of dirty extents. + + + The last step is to create a filesystem on the + /dev/hast/test + GEOM provider and mount it. This has to be done on the + primary node (as the + /dev/hast/test + appears only on the primary node), and + it can take a few minutes depending on the size of the hard + drive: + + &prompt.root; newfs -U /dev/hast/test +&prompt.root; mkdir /hast/test +&prompt.root; mount /dev/hast/test /hast/test + + Once the HAST framework is configured + properly, the final step is to make sure that + HAST is started during the system boot time + automatically. The following line should be added to the + /etc/rc.conf file: + + hastd_enable="YES" + + + Failover Configuration + + The goal of this example is to build a robust storage + system which is resistant from the failures of any given node. + The key task here is to remedy a scenario when a + primary node of the cluster fails. Should + it happen, the secondary node is there to + take over seamlessly, check and mount the file system, and + continue to work without missing a single bit of data. + + In order to accomplish this task, it will be required to + utilize another feature available under &os; which provides + for automatic failover on the IP layer — + CARP. CARP stands for + Common Address Redundancy Protocol and allows multiple hosts + on the same network segment to share an IP address. Set up + CARP on both nodes of the cluster according + to the documentation available in . + After completing this task, each node should have its own + carp0 interface with a shared IP + address 172.16.0.254. + Obviously, the primary HAST node of the + cluster has to be the master CARP + node. + + The HAST pool created in the previous + section is now ready to be exported to the other hosts on + the network. This can be accomplished by exporting it + through NFS, + Samba etc, using the shared IP + address 172.16.0.254. The only + problem which remains unresolved is an automatic failover + should the primary node fail. + + In the event of CARP interfaces going + up or down, the &os; operating system generates a &man.devd.8; + event, which makes it possible to watch for the state changes + on the CARP interfaces. A state change on + the CARP interface is an indication that + one of the nodes failed or came back online. In such a case, + it is possible to run a particular script which will + automatically handle the failover. + + To be able to catch the state changes on the + CARP interfaces, the following + configuration has to be added to the + /etc/devd.conf file on each node: + + notify 30 { + match "system" "IFNET"; + match "subsystem" "carp0"; + match "type" "LINK_UP"; + action "/usr/local/sbin/carp-hast-switch master"; +}; + +notify 30 { + match "system" "IFNET"; + match "subsystem" "carp0"; + match "type" "LINK_DOWN"; + action "/usr/local/sbin/carp-hast-switch slave"; +}; + + To put the new configuration into effect, run the + following command on both nodes: + + &prompt.root; /etc/rc.d/devd restart + + In the event that the carp0 + interface goes up or down (i.e. the interface state changes), + the system generates a notification, allowing the &man.devd.8; + subsystem to run an arbitrary script, in this case + /usr/local/sbin/carp-hast-switch. This + is the script which will handle the automatic + failover. For further clarification about the above + &man.devd.8; configuration, please consult the + &man.devd.conf.5; manual page. + + An example of such a script could be following: + +#!/bin/sh + +# Original script by Freddie Cash <fjwcash@gmail.com> +# Modified by Michael W. Lucas <mwlucas@BlackHelicopters.org> +# and Viktor Petersson <vpetersson@wireload.net> + +# The names of the HAST resources, as listed in /etc/hast.conf +resources="test" + +# delay in mounting HAST resource after becoming master +# make your best guess +delay=3 + +# logging +log="local0.debug" +name="carp-hast" + +# end of user configurable stuff + +case "$1" in + master) + logger -p $log -t $name "Switching to primary provider for ${resources}." + sleep ${delay} + + # Wait for any "hastd secondary" processes to stop + for disk in ${resources}; do + while $( pgrep -lf "hastd: ${disk} \(secondary\)" > /dev/null 2>&1 ); do + sleep 1 + done + + # Switch role for each disk + hastctl role primary ${disk} + if [ $? -ne 0 ]; then + logger -p $log -t $name "Unable to change role to primary for resource ${disk}." + exit 1 + fi + done + + # Wait for the /dev/hast/* devices to appear + for disk in ${resources}; do + for I in $( jot 60 ); do + [ -c "/dev/hast/${disk}" ] && break + sleep 0.5 + done + + if [ ! -c "/dev/hast/${disk}" ]; then + logger -p $log -t $name "GEOM provider /dev/hast/${disk} did not appear." + exit 1 + fi + done + + logger -p $log -t $name "Role for HAST resources ${resources} switched to primary." + + + logger -p $log -t $name "Mounting disks." + for disk in ${resources}; do + mkdir -p /hast/${disk} + fsck -p -y -t ufs /dev/hast/${disk} + mount /dev/hast/${disk} /hast/${disk} + done + + ;; + + slave) + logger -p $log -t $name "Switching to secondary provider for ${resources}." + + # Switch roles for the HAST resources + for disk in ${resources}; do + if ! mount | grep -q "^${disk} on " + then + else + umount -f /hast/${disk} + fi + sleep $delay + hastctl role secondary ${disk} 2>&1 + if [ $? -ne 0 ]; then + logger -p $log -t $name "Unable to switch role to secondary for resource ${disk}." + exit 1 + fi + logger -p $log -t $name "Role switched to secondary for resource ${disk}." + done + ;; +esac + + In a nutshell, the script does the following when a node + becomes master / + primary: + + + + Promotes the HAST pools as + primary on a given node. + + + Checks the file system under the + HAST pool. + + + Mounts the pools at appropriate place. + + + + When a node becomes backup / + secondary: + + + + Unmounts the HAST pools. + + + Degrades the HAST pools to + secondary. + + + + + Keep in mind that this is just an example script which + should serve as a proof of concept solution. It does not + handle all the possible scenarios and can be extended or + altered in any way, for example it can start/stop required + services etc. + + + + For the purpose of this example we used a standard UFS + file system. In order to reduce the time needed for + recovery, a journal-enabled UFS or ZFS file system can + be used. + + + More detailed information with additional examples can be >>> TRUNCATED FOR MAIL (1000 lines) <<<