root/branches/cu-security-branch/doc/pvfs2-quickstart.tex @ 8397

Revision 8397, 37.7 KB (checked in by nlmills, 3 years ago)

initial merge with Orange-Branch. much will be broken

  • Property svn:executable set to *
Line 
1%
2%
3\documentclass[11pt, letterpaper]{article}
4\usepackage[dvips]{graphicx}
5%\usepackage{html}
6\usepackage{epsfig}
7\usepackage{rotating}
8\usepackage{times}
9\pagestyle{empty}
10
11%
12% GET THE MARGINS RIGHT, THE UGLY WAY
13%
14\topmargin 0.0in
15\textwidth 6.5in
16\textheight 9.0in
17\columnsep 0.25in
18\oddsidemargin 0.0in
19\evensidemargin 0.0in
20\headsep 0.0in
21\headheight 0.0in
22
23
24\title{A Quick Start Guide to PVFS2}
25\author{ PVFS2 Development Team }
26
27%
28% BEGINNING OF DOCUMENT
29%
30\begin{document}
31\maketitle
32
33\tableofcontents
34
35\newpage
36
37\thispagestyle{empty}
38
39\section{How to use this document}
40\label{sec:howto}
41
42The quick start guide is intended to be a reference on how to quickly
43install and configure a PVFS2 file system.  It is broken down into
44three parts.  The first describes how to download and compile the
45PVFS2 software.  The next section walks through the steps of
46configuring PVFS2 to store and access files on a single host, which
47may be useful for simple testing and evaluation.  The final section of
48this document describes how to install and configure PVFS2 in a true
49cluster environment with multiple servers and/or clients.
50
51\subsection{Versions}
52
53This document only applies to the most recent snapshot of PVFS2.
54
55\section{Downloading and compiling PVFS2}
56
57Follow the information at http://www.pvfs.org/pvfs2/download.html .
58Once the source code is downloaded,
59compiling the PVFS2 source code is a matter of running './configure',
60followed by 'make' from the top level source directory.  More detailed
61instruction for building and installing are provided below.
62
63\subsection{Dependencies}
64
65The following software packages are currently required by PVFS2:
66\begin{itemize}
67\item Berkely DB (version 3 or 4)
68\item aio support (provided by glibc and librt)
69\item pthreads
70\item gcc 2.96 or newer (DO NOT USE gcc 2.95! gcc 3.x recommended)
71\item GNU Make
72\end{itemize}
73
74The following software packages are currently recommended for use with PVFS2:
75\begin{itemize}
76\item GNU Libc (glibc) 2.3.2 [ or later ]
77\item Linux kernel version 2.6.0 (or later) or 2.4.19 (or later) (NOTE: not
78necessary for running PVFS2 servers, only the client kernel module). 
79\item A GNU/Linux environment (heterogenous configuration are
80supported)
81\end{itemize}
82
83ROMIO supports PVFS2.  It is not provided with pvfs2, but can be found
84as part of the following MPI implementations:
85
86\begin{itemize}
87\item MPICH2-0.96p2 or newer, though we suggest using the most recent MPICH2
88release
89\item OpenMPI-1.0 or newer, though it may not have some of the bug fixes or
90features of the MPICH2 version
91\end{itemize}
92
93\subsection{Untarring the packages}
94
95All source code is contained in one tarball: pvfs2-x.x.x.tar.gz.  The
96following example assumes that you will be building in the /usr/src
97directory, although that is not required:
98
99\begin{verbatim}
100[root@testhost /root]# cp pvfs2-x.x.x.tar.gz /usr/src
101[root@testhost /root]# cd /usr/src
102[root@testhost /usr/src]# tar -xzf pvfs2-x.x.x.tar.gz
103[root@testhost /usr/src]# ln -s pvfs2-x.x.x pvfs2
104[root@testhost /usr/src]# ls -lF
105total 476
106lrwxrwxrwx   1 root    root         15 Aug 14 17:42 pvfs2 -> pvfs2-x.x.x/
107drwxr-xr-x  12 root    root        512 Aug 14 10:11 pvfs2-x.x.x/
108-rw-r--r--   1 root    root     371535 Aug 14 17:41 pvfs2-x.x.x.tar.gz
109\end{verbatim}
110
111\subsection{Building and installing the packages}
112
113The default steps for building and installing PVFS2 are as follows:
114
115\begin{verbatim}
116[root@testhost /usr/src]# cd pvfs2
117[root@testhost /usr/src/pvfs2-XXX]# ./configure
118[root@testhost /usr/src/pvfs2-XXX]# make
119[root@testhost /usr/src/pvfs2-XXX]# make install
120\end{verbatim}
121
122Here are some optional configure arguments which may be of interest:
123\begin{itemize}
124\item --prefix=$<$path$>$: installs all files in the specified
125directory (/usr/local/ is the default if --prefix is not specified)
126\item --with-kernel=$<$path to 2.6.x kernel source$>$: this enables
127compilation of the PVFS2 Linux kernel driver [ Requires Linux Kernel
1282.6.0 or later ]
129\item --with-kernel24=$<$path to 2.4.x kernel source$>$: this enables
130compilation of the PVFS2 Linux kernel driver [ Requires Linux Kernel
1312.4.19 or later ]
132\item --with-mpi=$<$path to mpi installation$>$: this enables
133compilation of MPI based test programs
134\item --with-efence: automatically links in Electric Fence for
135debugging assistance
136\end{itemize}
137
138Also note that the pvfs2 2.6.x kernel source supports out of tree
139builds if you prefer to use that technique.
140
141\section{Configuring PVFS2 for a single host}
142\label{sec:single}
143
144This section documents the steps required to configure PVFS2 on a system
145in which a single machine acts as both the client and server for all
146PVFS2 operations.  It assumes that you have completed the above sections
147on building and installation already.  The hostname of the example machine
148is ``testhost'' and will be referenced as such in the following examples.
149
150IMPORTANT: if you intend to use the provided rc scripts to handle startup
151and shutdown of the PVFS2 server, then you must specify a valid hostname
152as reported by the \texttt{hostname} command line tool in the configuration.
153For this reason, we recommend that you \emph{not} use ``localhost'' as
154the hostname of your server, even if you intend to only test one machine.
155We will store all PVFS2 data in /pvfs2-storage-space.  /mnt/pvfs2 will
156serve as the mount point for the file system.  For more details about
157the purpose of these directories please see the PVFS2 users guide.
158
159\subsection{Server configuration}
160
161Since this is a single host configuration, we only have to configure
162one server daemon.  In the original PVFS, the metadata and I/O servers
163were separated into two separate programs (mgr and iod).  PVFS2,
164however, has only a single daemon called pvfs2-server which serves
165both roles.
166
167The most important part of server configuration is simply generating
168the configuration files.  These can be created using the
169pvfs2-genconfig script.  This is an interactive script which will ask
170several questions to determine your desired configuration.  Please pay
171particular attention to the listing of the metadata servers and I/O
172servers.  In this example we will use ``testhost'' for both.
173
174The pvfs2-genconfig tool will generate a single file system configuration
175file that will be identical for all servers.  This script should be
176excuted as root, so that we can place the configuration file in its
177default /etc/ location.
178
179In this simple configuration, we can accept the default options for
180every field.  We will use the hostname ``testhost'' rather than
181``localhost'' however.
182
183\begin{verbatim}
184root@testhost:~# /usr/bin/pvfs2-genconfig  \
185        /etc/pvfs2-fs.conf
186**********************************************************************
187        Welcome to the PVFS2 Configuration Generator:
188
189This interactive script will generate configuration files suitable
190for use with a new PVFS2 file system.  Please see the PVFS2 quickstart
191guide for details.
192
193**********************************************************************
194
195You must first select the network protocol that your file system will use.
196The only currently supported options are "tcp", "gm", and "ib".
197
198* Enter protocol type [Default is tcp]:
199
200Choose a TCP/IP port for the servers to listen on.  Note that this
201script assumes that all servers will use the same port number.
202
203* Enter port number [Default is 3334]:
204
205Next you must list the hostnames of the machines that will act as
206I/O servers.  Acceptable syntax is "node1, node2, ..." or "node{#-#,#,#}".
207
208* Enter hostnames [Default is localhost]: testhost
209
210Now list the hostnames of the machines that will act as Metadata
211servers.  This list may or may not overlap with the I/O server list.
212
213* Enter hostnames [Default is localhost]: testhost
214
215Configured a total of 1 servers:
2161 of them are I/O servers.
2171 of them are Metadata servers.
218
219* Would you like to verify server list (y/n) [Default is n]?
220
221Choose a file for each server to write log messages to.
222
223* Enter log file location [Default is /tmp/pvfs2-server.log]:
224
225Choose a directory for each server to store data in.
226
227* Enter directory name: [Default is /pvfs2-storage-space]:
228
229Writing fs config file... Done.
230
231Configuration complete!
232\end{verbatim}
233
234The generated config file will have conservative default values.  The PVFS2
235Users Guide has more information about the settings and the consequences of
236setting more aggressive, high performance values.
237
238\subsection{Starting the server}
239
240Before you run pvfs2-server for the first time, you must run it with a special
241argument that tells it to create a new storage space if it does not already
242exist.  In this example, we must run the server as root in order to create
243a storage space in /pvfs2-storage-space as specified in the configuration
244files.
245
246\begin{verbatim}
247bash-2.05b# /usr/sbin/pvfs2-server /etc/pvfs2-fs.conf -f
248\end{verbatim}
249
250Once the above step is done, you can start the server in normal mode
251as follows:
252
253\begin{verbatim}
254bash-2.05b# /usr/sbin/pvfs2-server /etc/pvfs2-fs.conf
255\end{verbatim}
256
257All log messages will be directed to /tmp/pvfs2-server.log, unless you specified
258a different location while running pvfs2-genconfig.  If you would prefer to run
259pvfs2-server in the foreground and direct all messages to stderr, then
260you may run the server as follows:
261
262\begin{verbatim}
263bash-2.05b# /usr/sbin/pvfs2-server /etc/pvfs2-fs.conf -d
264\end{verbatim}
265
266On startup, the PVFS2 server uses the hostname of the machine that it
267is running on to determine necessary information from the configuration
268file.  If the hostname doesn't match any of the addresses specified in
269the config file, then then you must use the -a option.  For example,
270each of above command lines could include ``-a testhost'' to
271specify that the server is using the \texttt{testhost} alias in the
272configuration file.
273
274\subsubsection{Automatic server startup and shutdown}
275\label{sec:rc}
276
277Like most other system services, PVFS2 may be started up automatically
278at boot up time through the use of rc scripts.  We have provided one
279such script that is suitable for use on RedHat (or similar) rc
280systems.  The following example demonstrates how to set this up:
281
282\begin{verbatim}
283bash-2.05b# cp /usr/src/pvfs2/examples/pvfs2-server.rc \
284    /etc/rc.d/init.d/pvfs2-server
285bash-2.05b# chmod a+x /etc/rc.d/init.d/pvfs2-server
286bash-2.05b# chkconfig pvfs2-server on
287bash-2.05b#  ls -al /etc/rc.d/rc3.d/S35pvfs2-server
288lrwxrwxrwx  1 root  root   22 Sep 21 13:11 /etc/rc.d/rc3.d/S35pvfs2-server \
289    -> ../init.d/pvfs2-server
290\end{verbatim}
291
292This script will now automatically launch on startup and shutdown to
293ensure that the pvfs2-server is started and stopped gracefully.
294To manually start the server, you can run the following command:
295
296\begin{verbatim}
297bash-2.05b# /etc/rc.d/init.d/pvfs2-server start
298Starting PVFS2 server:                                     [  OK  ]
299\end{verbatim}
300
301To manually stop the server:
302
303\begin{verbatim}
304bash-2.05b# /etc/rc.d/init.d/pvfs2-server stop
305Stopping PVFS2 server:                                     [  OK  ]
306\end{verbatim}
307
308\subsection{Client configuration}
309\label{subsec:client}
310
311There are two primary methods for accessing a PVFS2 file system.  The first is
312using the kernel module to provide standard Linux file system compatibility.
313This interface allows the user to run existing binaries and system utilities
314on PVFS2 without recompiling.  The second is through the MPI-IO interface,
315which is built on top of the \texttt{libpvfs2} library and allows for higher
316performance for parallel applications.
317
318Both of these methods require the same bit of information on the client to
319tell the client where to find the PVFS2 file system (or systems).  The
320information is presented in the same way as an \texttt{fstab (5)} entry:
321
322\begin{verbatim}
323tcp://testhost:3334/pvfs2-fs /mnt/pvfs2 pvfs2 defaults,noauto 0 0
324\end{verbatim}
325
326The entry lists a PVFS2 server (\texttt{tcp://testhost:3334/pvfs2-fs}) and a
327mount point (\texttt{/mnt/pvfs2}) on the client.  See the \texttt{fstab (5)}
328man page for more information on the format of these lines.
329
330We must create a mount point for the file system as well as an {\tt
331/etc/pvfs2tab} entry that will be used by the PVFS2 libraries to
332locate the file system.  The {\tt pvfs2tab} file is analogous to the
333{\tt /etc/fstab} file that most linux systems use to keep up with file
334system mount points.
335
336\begin{verbatim}
337[root@testhost /root]# mkdir /mnt/pvfs2
338[root@testhost /root]# touch /etc/pvfs2tab
339[root@testhost /root]# chmod a+r /etc/pvfs2tab
340\end{verbatim}
341
342Now edit this file so that it contains the following, except that you should
343substitute your host name in place of ``testhost'':
344
345\begin{verbatim}
346tcp://testhost:3334/pvfs2-fs /mnt/pvfs2 pvfs2 defaults,noauto 0 0
347\end{verbatim}
348
349There are a few alternatives to using an /etc/pvfs2tab which may be useful
350in production environments:
351\begin{itemize}
352\item One could put this entry in \texttt{/etc/fstab} file instead of
353\texttt{/etc/pvfs2tab}.
354\item One could avoid static tab file entries entirely and let the pvfs2 tools
355detect file systems that have been mounted using the Linux kernel
356driver.  This approach only works if you use the 2.6 Linux kernel or
357install the mount.pvfs2 utility on 2.4 Linux kernel systems.
358\end{itemize}
359
360\subsection{Testing your installation}
361\label{subsec:testing}
362PVFS2 currently includes (among others) the following tools for
363manipulating the file system using the native PVFS2 library:
364pvfs2-ping, pvfs2-cp, and pvfs2-ls.  These tools
365check the health of the file system, copy files to and from a PVFS2 file system, and list the
366contents of directories, respectively.  Their usage
367can best be summarized with the following examples:
368
369\begin{verbatim}
370bash-2.05b# ./pvfs2-ping -m /mnt/pvfs2
371
372(1) Searching for /mnt/pvfs2 in /etc/pvfs2tab...
373
374   Initial server: tcp://testhost:3334
375   Storage name: pvfs2-fs
376   Local mount point: /mnt/pvfs2
377
378(2) Initializing system interface and retrieving configuration from server...
379
380   meta servers (duplicates are normal):
381   tcp://testhost:3334
382
383   data servers (duplicates are normal):
384   tcp://testhost:3334
385
386(3) Verifying that all servers are responding...
387
388   meta servers (duplicates are normal):
389   tcp://testhost:3334 Ok
390
391   data servers (duplicates are normal):
392   tcp://testhost:3334 Ok
393
394(4) Verifying that fsid 9 is acceptable to all servers...
395
396   Ok; all servers understand fs_id 9
397
398(5) Verifying that root handle is owned by one server...
399
400   Root handle: 0x00100000
401   Ok; root handle is owned by exactly one server.
402
403=============================================================
404
405The PVFS2 filesystem at /mnt/pvfs2 appears to be correctly configured.
406
407bash-2.05b# ./pvfs2-ls /mnt/pvfs2/
408
409bash-2.05b# ./pvfs2-cp -t /usr/lib/libc.a /mnt/pvfs2/testfile
410Wrote 2310808 bytes in 0.264689 seconds. 8.325842 MB/seconds
411
412bash-2.05b# ./pvfs2-ls /mnt/pvfs2/
413testfile
414
415bash-2.05b# ./pvfs2-ls -alh /mnt/pvfs2/
416drwxrwxrwx    1 pcarns  users            0 2003-08-14 22:45 .
417drwxrwxrwx    1 pcarns  users            0 2003-08-14 22:45 .. (faked)
418-rw-------    1 root    root            2M 2003-08-14 22:47 testfile
419
420bash-2.05b# ./pvfs2-cp -t /mnt/pvfs2/testfile /tmp/testfile-out
421Wrote 2310808 bytes in 0.180621 seconds. 12.201016 MB/seconds
422
423bash-2.05b# diff /tmp/testfile-out /usr/lib/libc.a
424\end{verbatim}
425
426\section{Installing PVFS2 on a cluster}
427\label{sec:cluster}
428It is important to have in mind the roles that machines (a.k.a. nodes) will
429play in the PVFS2 system. There are three potential roles that a machine might
430play: metadata server,  I/O server, or client.
431
432A metadata server is a node that keeps up with metadata (such as permissions
433and time stamps) for the file system. An I/O server is a node that actually
434stores a portion of the PVFS2 file data. A client is a node that can read and
435write PVFS2 files. Your applications will typically be run on PVFS2 clients so
436that they can access the file system.
437
438A machine can fill one, two, or all of these roles simultaneously. Unlike
439PVFS-1, each role requires just the pvfs2-server binary.  It will consult the
440cluster-wide config file and the node-specific config file when it starts up to
441know what role pvfs2-server should perform on this machine.
442
443There can be many metadata servers, I/O servers, and clients. In this section
444we will discuss the components and configuration files needed to fulfill each
445role.
446
447We will configure our example system so that the node ``cluster1'' provides
448metadata information, eight nodes (named ``cluster1'' through ``cluster8'')
449provide I/O services, and all nodes act as clients.
450
451\subsection{Server configuration}
452\label{sec:server-config}
453
454We will assume that at this point you have either performed a make install
455on every node, or else have provided the pvfs2 executables, headers, and
456libraries to each machine by some other means.
457
458Installing PVFS2 on a cluster is quite similar to installing it on a single
459machine, so familiarize yourself with Section \ref{sec:single}.  We are going
460to generate one master config file and 8 smaller node-specific config files.
461Again, remember that it is critical to list correct hostnames for each machine,
462and to make sure that these hostnames match the output of the \texttt{hostname}
463command on each machine that will act as a server.
464
465\begin{verbatim}
466root@cluster1:~# /usr/local/pvfs2/bin/pvfs2-genconfig  \
467        /etc/pvfs2-fs.conf
468**********************************************************************
469        Welcome to the PVFS2 Configuration Generator:
470
471This interactive script will generate configuration files suitable
472for use with a new PVFS2 file system.  Please see the PVFS2 quickstart
473guide for details.
474
475**********************************************************************
476
477You must first select the network protocol that your file system will use.
478The only currently supported options are "tcp" and "gm".
479
480* Enter protocol type [Default is tcp]:
481
482Choose a TCP/IP port for the servers to listen on.  Note that this
483script assumes that all servers will use the same port number.
484
485* Enter port number [Default is 3334]:
486
487Next you must list the hostnames of the machines that will act as
488I/O servers.  Acceptable syntax is "node1, node2, ..." or "node{#-#,#,#}".
489
490* Enter hostnames [Default is localhost]: cluster{1-8}
491
492Now list the hostnames of the machines that will act as Metadata
493servers.  This list may or may not overlap with the I/O server list.
494
495* Enter hostnames [Default is localhost]: cluster1
496
497Configured a total of 8 servers:
4988 of them are I/O servers.
4991 of them are Metadata servers.
500
501* Would you like to verify server list (y/n) [Default is n]? y
502
503****** I/O servers:
504tcp://cluster1:3334
505tcp://cluster2:3334
506tcp://cluster3:3334
507tcp://cluster4:3334
508tcp://cluster5:3334
509tcp://cluster6:3334
510tcp://cluster7:3334
511tcp://cluster8:3334
512
513****** Metadata servers:
514tcp://cluster1:3334
515
516* Does this look ok (y/n) [Default is y]? y
517
518Choose a file for each server to write log messages to.
519
520* Enter log file location [Default is /tmp/pvfs2-server.log]:
521
522Choose a directory for each server to store data in.
523
524* Enter directory name: [Default is /pvfs2-storage-space]:
525
526Writing fs config file... Done.
527
528Configuration complete!
529\end{verbatim}
530
531The generated config files will have conservative default values.  The PVFS2
532Users Guide has more information about the settings and the consequences of
533setting more aggressive, high performance values.
534
535We have now made all the config files for an 8-node storage cluster:
536\begin{verbatim}
537root@cluster1:~# ls /etc/pvfs2/foo/
538pvfs2-fs.conf
539\end{verbatim}
540
541Now the config files must be copied out to all of the server nodes.  If you
542use the provided (Redhat style) rc scripts, then you can simply copy all
543config files to every node; each server will pick the correct config files
544based on its own hostname at startup time.  The following example assumes
545that you will use scp to copy files to cluster nodes.  Other possibilities
546include rcp, bpcp, or simply storing the configuration files on an NFS volume.
547Please note, however, that the rc script should be modified if you intend
548to store config files in any location other than the default /etc/.
549
550At this time, we also will copy out the example rc script an enable it on
551each machine.
552
553\begin{verbatim}
554root@cluster1:~# for i in `seq 1 8`; do
555> scp /etc/pvfs2-fs.conf cluster\${i}:/etc/
556> scp /usr/src/pvfs2/examples/pvfs2-server.rc \
557    cluster\${i}:/etc/rc.d/init.d/pvfs2-server
558> ssh cluster\${i} /sbin/chkconfig pvfs2-server on
559> done
560\end{verbatim}
561
562\subsection{Starting the servers}
563
564As with the single-machine case, you must run pvfs2-server with a
565special argument to create the storage space on all the nodes if it
566does not already exist.  Run the following command on every metadata
567or IO node in the cluster:
568
569\begin{verbatim}
570root@cluster1# /usr/sbin/pvfs2-server /etc/pvfs2-fs.conf -f
571\end{verbatim}
572
573Then once the storage space is created, start the server for real with a
574command like this on every metadata or IO node in the cluster:
575
576\begin{verbatim}
577root@cluster1# /usr/sbin/pvfs2-server /etc/pvfs2-fs.conf
578\end{verbatim}
579
580If you want to run the server in the foreground (e.g. for debugging), use the
581-d option.
582
583If you wish to automate server startup and shutdown with rc scripts, refer
584to the corresponding section \ref{sec:rc} from the single server example.
585
586\subsection{Client configuration}
587
588Setting up a client for multiple servers is the same as setting up a client
589for a single server.  Refer to section \ref{subsec:client}.
590
591The \texttt{/etc/pvfs2tab} file (or an \texttt{/etc/fstab} entry) needs to
592exist on each client so that each client can find the file system.  The server
593listed for each client can be different; any server in the PVFS2 file system
594will do.  For large clusters, using different server names will eliminate one
595potential bottleneck in the system by balancing the load of clients reading
596initial configuration information.
597
598\subsection {Testing your Installation}
599
600Testing a multiple-server pvfs2 installation is the same as testing a
601single-server pvfs2 installation.  Refer to section
602\ref{subsec:testing}
603
604\section{The PVFS2 Linux Kernel Interface}
605\label{sec:kernel-interface}
606
607\subsection{Finding an Appropriate Kernel Version}
608\label{sec:kernel-check}
609
610Now that you've mastered the download and installation steps of
611managing the userspace PVFS2 source code, configuring the PVFS2 Linux
612Kernel Interface is relatively straight forward.  We assume at this
613point that you are familiar with running the server and that a PVFS2
614storage space has already been created on the node that you would like
615to configure for use with the VFS.
616
617A Linux 2.6.0 kernel or later is recommended for the kernel interface,
618although 2.4.x kernel support has been added for systems that require
619it.  If you're using a 2.4.x kernel, you must be running 2.4.19 or
620later, as previous versions are NOT (and will not be) supported.
621
622The following examples assume that you've already downloaded,
623compiled, and are now running the Linux kernel located in the
624/usr/src/linux-2.x.x directory on your system.
625
626Before compiling the kernel module against your running kernel, check
627to make sure that you are running an appropriate kernel version.  You
628can do this in the following manner:
629
630\begin{verbatim}
631lain linux # cat /proc/version
632Linux version 2.6.6 (root@lain.mcs.anl.gov) (gcc version 3.3.3
63320040412 (Gentoo Linux 3.3.3-r5, ssp-3.3-7, pie-8.7.5.3)) #3 SMP Wed
634May 26 16:22:11 CDT 2004
635\end{verbatim}
636
637By issuing that command, we are able to inspect the output to ensure
638that we're running an appropriate kernel version.  If your kernel is
639older than 2.6.0 (for 2.6.x kernels) or 2.4.19 (for 2.4.x kernels),
640please download and install a later kernel version (or submit a
641request to your site's System Administrator).
642
643For reference, you can download Linux kernels at:
644\begin{verbatim}
6452.6.x kernels: http://www.kernel.org/pub/linux/kernel/v2.6/
6462.4.x kernels: http://www.kernel.org/pub/linux/kernel/v2.4/
647\end{verbatim}
648
649Once you're convinced the Linux kernel version is appropriate, it's
650time to compile the PVFS2 kernel module.
651
652\subsection{Preparing Linux Kernel 2.6.x configurations}
653\label{sec:vfs-configure}
654
655To generate the Makefile, you need to make sure that you run
656'./configure' with the '--with-kernel=path' argument.  An example is
657provided here for your convenience:
658
659\begin{verbatim}
660gil:/usr/src/pvfs2# ./configure --with-kernel=/usr/src/linux-2.6.0
661\end{verbatim}
662
663Note that you can often find a kernel source tree (or a symlink to the
664right place) at /lib/modules/`uname -r`/build2.  For example, if you were
665running the default Fedora 3 kernel (linux-2.6.9-1.667) you would find the
666kernel tree in \texttt{/lib/modules/2.6.9-1.667/build}.
667
668After this configure command is issued, build the PVFS2 source tree if it
669has not yet been built.
670
671Building the 2.6.x kernel module requires an extra step.  Since
672current kernels require writing a few files in the kernel source
673directory to build a module, you may have to become root to compile
674the kernel module.  To build the module, type ``make kmod''.
675
676At this point, we have a valid PVFS2 2.6.x Kernel module.  The module
677itself is the file {\tt pvfs2.ko} in subdirectory {\tt
678src/kernel/linux-2.6} in your build tree.  You may install it to the
679standard system location with ``make kmod\_install'', again you will
680likely have to be root to do this.  Or you may override the install
681location by setting the variable {\tt KMOD\_DIR} variable when you
682install.
683
684\subsection{Preparing Linux Kernel 2.4.x configurations}
685\label{sec:vfs24-configure}
686
687To generate the Makefile, you need to make sure that you run
688'./configure' with the '--with-kernel24=path' argument.  An example is
689provided here for your convenience:
690
691\begin{verbatim}
692gil:/usr/src/pvfs2# ./configure --with-kernel24=/usr/src/linux-2.4.26
693\end{verbatim}
694
695After this command is issued, build the PVFS2 source tree if it has
696not yet been built.
697
698Building the 2.4.x kernel module requires an extra step.  Since
699current kernels require writing a few files in the kernel source
700directory to build a module, you may have to become root to compile
701the kernel module.  To build the module, type ``make kmod24''.
702
703At this point, we have a valid PVFS2 2.4.x Kernel module.  The module
704itself is the file {\tt pvfs2.o} in subdirectory {\tt
705src/kernel/linux-2.4} in your build tree.  You may install it to the
706standard system location with ``make kmod24\_install'', again you will
707likely have to be root to do this.  Or you may override the install
708location by setting the variable {\tt KMOD\_DIR} variable when you
709install.
710
711\subsection{Testing the Kernel Interface}
712\label{sec:vfs-test}
713
714Now that you've built a valid PVFS2 kernel module, there are several
715steps to perform to properly use the file system.
716
717The basic steps are as follows:
718\begin{itemize}
719\item Create a mount point on the local filesystem
720\item Load the Kernel Module into the running kernel
721\item Start the PVFS2 Server application
722\item Start the PVFS2 Client application
723\item Mount your existing PVFS2 volume on the local filesystem
724\item Issue VFS commands
725\end{itemize}
726
727First, choose where you'd like to mount your existing PVFS2 volume.
728Create this directory on the local file system if it does not already
729exist.  Our mount point in this example is /mnt/pvfs2.
730
731\begin{verbatim}
732gil:~# mkdir /mnt/pvfs2
733\end{verbatim}
734
735Now load the kernel module into your running kernel.  You can do this
736by using the 'insmod' program, or modprobe if you've copied your
737module into the appropriate /lib/modules directory for your running
738kernel.
739
740\subsubsection{Loading the kernel module}
741For 2.6.x kernels ONLY:
742\begin{verbatim}
743gil:~# insmod /usr/src/pvfs2/src/kernel/linux-2.6/pvfs2.ko
744\end{verbatim}
745
746For 2.4.x kernels ONLY:
747\begin{verbatim}
748gil:~# insmod /usr/src/pvfs2/src/kernel/linux-2.4/pvfs2.o
749\end{verbatim}
750
751You should verify that the module was loaded properly using the
752command ``lsmod''.  Also, you can use the ``rmmod'' to remove the
753PVFS2 module after it's been loaded.  Only remove the module when you
754have safely unmounted all mounted file systems (if any) and stopped
755the pvfs2-client software.
756
757At this point, we need to start the PVFS2 server and the PVFS2 client
758applications before trying to mount a PVFS2 volume.  See previous
759sections on how to properly start the PVFS2 server if you're unsure.
760Starting the PVFS2 client is covered below.
761
762The PVFS2 client application consists of two programs.
763``pvfs2-client-core'' and ``pvfs2-client''.  DO NOT run
764``pvfs2-client-core'' by itself.  ``pvfs2-client'' is the PVFS2 client
765application.  This application cannot be started unless the PVFS2
766server is already running.  Here is an example of how to start the
767PVFS2 client:
768
769\begin{verbatim}
770gil:/usr/src/pvfs2# cd src/apps/kernel/linux-2.6/
771gil:/usr/src/pvfs2/src/apps/kernel/linux-2.6# ./pvfs2-client -f -p ./pvfs2-client-core
772pvfs2-client starting
773Spawning new child process
774About to exec ./pvfs2-client-core
775Waiting on child with pid 17731
776\end{verbatim}
777
778The -f argument is not required.  For reference, this keeps the PVFS2
779client application running in the foreground.
780
781The -p argument is required unless the pvfs2-client-core is installed
782and can be found in your PATH.
783
784Also worth noting is the -a argument (not required).  For reference,
785this sets the timeout value (in milliseconds) of the client side
786attribute cache.  Setting this to a large value will improve attribute
787read times (e.g. running ``ls'' repeatedly), but can reflect incorrect
788attributes if a remote client is modifying them.  The default value is
7890 milliseconds, effectively disabling this client side attribute
790cache.
791
792Other arguments and descriptions can be viewed by running the program
793with the -h option.
794
795Now that the module is loaded, and the pvfs2-server and pvfs2-client
796programs are running, we can mount our PVFS2 file system (and verify
797that it's properly mounted) as follows:
798
799\begin{verbatim}
800lain pvfs2 # mount -t pvfs2 tcp://testhost:3334/pvfs2-fs /mnt/pvfs2
801lain pvfs2 # mount | grep pvfs2
802tcp://lain.mcs.anl.gov:3334/pvfs2-fs on /tmp/mnt type pvfs2 (rw)
803\end{verbatim}
804
805NOTE: The device of the format tcp://testhost:3334/pvfs2-fs MUST be
806specified, as we need to know a valid running pvfs2-server and file
807system name to dynamically mount a pvfs2 volume.  These values can be
808read from your configuration files.  As a side note, you can use
809``umount'' to unmount the PVFS2 volume when you're ready.
810
811Now that a PVFS2 volume is mounted, normal VFS operation can be issued
812on the command line.  An example is provided below:
813
814\begin{verbatim}
815gil:/usr/src/pvfs2/src/kernel/linux-2.6# mkdir /mnt/pvfs2/newdir
816gil:/usr/src/pvfs2/src/kernel/linux-2.6# ls -al /mnt/pvfs2/newdir
817total 1
818drwxr-xr-x    2 root     root            0 Aug 15 13:29 .
819drwxr-xr-x    3 root     root            0 Aug 15 13:21 ..
820gil:/usr/src/pvfs2/src/kernel/linux-2.6# cp pvfs2.ko
821/mnt/pvfs2/newdir/foo
822gil:/usr/src/pvfs2/src/kernel/linux-2.6# ls -al /mnt/pvfs2/newdir
823total 2
824drwxr-xr-x    2 root     root            0 Aug 15 13:29 .
825drwxr-xr-x    3 root     root            0 Aug 15 13:21 ..
826-rw-r--r--    1 root     root       330526 Aug 15 13:30 foo
827\end{verbatim}
828
829\subsubsection{Special Note for 2.4 kernels}
830
831We need a small helper application \texttt{/sbin/mount.pvfs2} to mount pvfs2
832under 2.4 kernels.   It must be installed under \texttt{/sbin}.  Note that
833``make install'' will not touch \texttt{/sbin}, so you will have to install it
834by hand.  With the helper application installed, the 2.6 mount commands and
835fstab entries are the same. 
836
837If you do not have \texttt{/sbin/mount.pvfs2} available, you can still use the
838old appraoch:
839
840\begin{verbatim}
841gil:~# mount -t pvfs2 pvfs2 /mnt/pvfs2 -o tcp://testhost:3334/pvfs2-fs
842gil:~# mount | grep pvfs2
843pvfs2 on /mnt/pvfs2 type pvfs2 (rw)
844\end{verbatim}
845
846
847\subsection{Unmounting and stopping PVFS2 on a client}
848
849While this is a quick \emph{start} guide, knowing how to cleanly shut
850things down can be helpful too!
851
852Unmounting a PVFS2 volume is as simple as using ``umount'':
853\begin{verbatim}
854gil:~# umount /mnt/pvfs2
855gil:~# mount | grep pvfs2
856\end{verbatim}
857
858After all PVFS2 volumes have been unmounted, it is safe to kill the
859pvfs2-client:
860\begin{verbatim}
861gil:~# killall pvfs2-client
862\end{verbatim}
863
864Waiting a few seconds after killing the pvfs2-client will ensure that
865everything has terminated properly.  Once the pvfs2-client has been
866killed, it is safe to remove the PVFS2 kernel module:
867\begin{verbatim}
868gil:~# rmmod pvfs2
869\end{verbatim}
870
871\appendix
872
873\section{Notes on running PVFS2 without root access}
874
875The preceding documentation assumes that you have root access on the
876machine(s) that you wish to install the file system.  However, this is
877not strictly required for any component except for the kernel VFS
878support.  The servers, client libraries (such as MPI-IO), and
879administrative tools can all be used by non-priviledged users.  This
880may be particularly useful for evaluation or testing purposes.
881
882In order to do this, you must make the following adjustments to the
883installation and configuration process:
884\begin{itemize}
885\item Use the --prefix option at configure time to choose an alternate
886directory (one that you have write access to) for installation.  An example
887would be /home/username/pvfs2-build.
888\item When generating the server config files, choose a data storage
889directory that you have write access to, but preferably not NFS mounted.  An
890example would be /tmp/pvfs2-test-space.
891\item Place the pvfs2tab file in an alternate location, such as
892/home/username/pvfs2-build/pvfs2tab, instead of /etc/pvfs2tab.
893Then set the PVFS2TAB\_FILE environment variable to the full path
894to this file.  A tcsh example would be: ``setenv PVFS2TAB\_FILE
895/home/username/pvfs2-build/pvfs2tab''.
896\end{itemize}
897
898
899\section{Debugging your PVFS2 configuration}
900
901Bug reports and questions should be directed to the PVFS2 users
902mailing list for best results (see the PVFS2 web site for details:
903http://www.pvfs.org/pvfs2/lists.html).  It is helpful to include a
904description of your problem, the PVFS2 version number, and include
905relevant log information from /var/log/messages and
906/tmp/pvfs2-server.log.
907
908People who wish to find more verbose information about what the file
909system is doing can enable extra logging messages from the server.
910This is done by adjusting the ``EventLogging'' field in the file
911system configuration file.  By default it is set to ``none''.  You can
912set it to a comma seperated list of log masks to get more information.
913An example would be ``EventLogging storage,network,server'', which
914will result in verbose messages from the storage subsystem, the
915network subsystem, and server state machines.  \emph{WARNING: this may
916result in extremely large log files!}  The logging masks can also be
917set at runtime using the pvfs2-set-debugmask command line tool.  Usage
918information and a list of supported masks will be shown if it is run
919with no arguments.
920
921Similarly, run-time client debugging information can be gathered by
922using environment variables before running the client application.
923The default client logging method is to set the variable
924PVFS2\_DEBUGMASK to values such as ``client,network''.  Many of the
925supported client debugging masks overlap the server masks that can be
926verified using pvfs2-set-debugmask.  By default, setting
927PVFS2\_DEBUGMASK emits debugging information to stderr, often
928intermixed with the client program output.  If you'd like to redirect
929client debugging to a file, set the PVFS2\_DEBUGFILE environment
930variable to a valid file name.  This causes all debug information
931specified by the PVFS2\_DEBUGMASK to be stored in the file specified,
932no longer intermixing the output with the client program.  The file
933specified in the PVFS2\_DEBUGFILE environment variable will be
934appended if it already exists.
935Another influential environment variable that can be used to trigger
936kmod logging messages is PVFS2\_KMODMASK. By setting values of this variable
937to ``file, inode'' prior to starting pvfs2-client-core daemon,
938verbose kmod subsystem error diagnostics are written to the system ring buffer
939and eventually to the kernel logs.
940One could also set the kmod diagnostic level when the kernel module is loaded
941like so, insmod pvfs2.ko module\_parm\_debug\_mask=<diagnostic level>.
942The diagnostic level will be a bitwise OR of values specified in pvfs2-debug.h.
943For more information on setting the kernel or client debug mask, see
944\texttt{doc/pvfs2-logging.txt} in the PVFS source tree.
945
946\section{ROMIO Support}
947\label{sec:romio}
948
949Building ROMIO with PVFS2 support can be a bit tricky, and is certainly not
950well documented.  Reports of the correct way to build for OpenMPI would be
951appreciated.  This document will cover building for MPICH2.
952
953First, get the software.  Download MPICH2 from
954http://www.mcs.anl.gov/mpi/mpich2/.  We may have found bug fixes since the last MPICH2 release.  If there are bug fixes, they can be found at
955http://www.mcs.anl.gov/romio/pvfs2-patches.html.
956
957Unpack mpich2. Apply the ROMIO patch in the src/mpi/romio directory if one is
958needed.
959
960\begin{verbatim}
961prompt% tar xzf ~/src/mpich2-1.4.0p1.tar.gz    # unpack mpich2 source
962prompt% cd mpich2-1.4.0p1/src/mpi/romio        # change to ROMIO dir
963prompt% patch -p1 < ~/src/romio-<CORRECT_VERSION>.diff   #apply patch
964prompt% cd ../../..                            # return to top of src
965prompt%
966\end{verbatim}
967
968In order to build MPICH2 with a ROMIO that speaks PVFS2, pass the
969\texttt{--with-pvfs2=PVFS\_PREFIX} option to configure.  'PVFS2\_PREFIX' is the
970prefix you gave to the PVFS configure script (e.g. /usr/local or
971/opt/packages/pvfs-2.6.0). 
972
973\begin{verbatim}
974configure --with-pvfs2=PVFS_PREFIX [other flags]
975\end{verbatim}
976
977Now compile and install MPICH2 as you normally would.  Applications accessing
978PVFS2 through MPI-IO will bypass the kernel interface and talk to PVFS2 servers
979directly.  If you do not have the file system mounted, ROMIO will still work.  Just be sure to add the "pvfs2:" to your file name.
980
981Please note: older versions of MPICH2 need a few changes
982to the normal configure process.  MPICH2-1.0.4p1 and older will need to
983know the path to the PVFS2 installation.  Modify the {\tt CFLAGS},
984{\tt LDFLAGS} and {\tt LIBS} environment variables.
985
986\begin{verbatim}
987prompt% export CFLAGS="<other desired flags> -I/usr/local/pvfs2/include"
988prompt% export LDFLAGS="-L/usr/local/pvfs2/lib"
989prompt% export LIBS="-lpvfs2 -lpthread"
990prompt% configure --with-file-system=ufs+nfs+testfs+pvfs2 [other flags]
991\end{verbatim}
992
993\end{document}
Note: See TracBrowser for help on using the browser.