root/trunk/doc/pvfs2-quickstart.tex @ 3279

Revision 3279, 32.6 KB (checked in by neill, 9 years ago)

- some minor updates
- the html things don't work on my machine...removed for now

  • Property svn:executable set to *
Line 
1%
2%
3\documentclass[11pt, letterpaper]{article}
4\usepackage[dvips]{graphicx}
5%\usepackage{html}
6\usepackage{psfig}
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\date{Last Updated: March 2004}
27
28%
29% BEGINNING OF DOCUMENT
30%
31\begin{document}
32\maketitle
33
34\tableofcontents
35
36\newpage
37
38\thispagestyle{empty}
39
40\section{How to use this document}
41\label{sec:howto}
42
43The quick start guide is intended to be a reference on how to quickly
44install and configure a PVFS2 file system.  It is broken down into
45three parts.  The first describes how to download and compile the
46PVFS2 software.  The next section walks through the steps of
47configuring PVFS2 to store and access files on a single host, which
48may be useful for simple testing and evaluation.  The final section of
49this document describes how to install and configure PVFS2 in a true
50cluster environment with multiple servers and/or clients.
51
52\subsection{Versions}
53
54This document only applies to alpha snapshots of PVFS2 as of March
552004.
56
57\section{Downloading and compiling PVFS2}
58
59At this time, tarballs (and CVS access) are provided to trusted
60parties.  If you're reading this, you should have a method of
61obtaining the PVFS2 source code.  Once the source code is downloaded,
62compiling the PVFS2 source code is a matter of running './configure',
63followed by 'make' from the top level source directory.  More detailed
64instruction for building and installing are provided below.
65
66\subsection{Dependencies}
67
68The following software packages are currently required by PVFS2:
69\begin{itemize}
70\item Berkely DB (version 3 or 4)
71\item aio support (provided by glibc and librt)
72\item pthreads
73\item gcc 2.9.x or newer
74\item GNU Make
75\end{itemize}
76
77The following software packages are currently encouraged for use with PVFS2:
78\begin{itemize}
79\item GNU Libc (glibc) 2.3.2 [ or later ]
80\item Linux kernel version 2.6.0-test4, or later (NOTE: not necessary for
81  running PVFS2 servers, only the client kernel module)
82\end{itemize}
83
84The following system assumptions are also made:
85\begin{itemize}
86\item A Homogeneous GNU/Linux environment
87\end{itemize}
88
89ROMIO supports PVFS2.  It is not provided with pvfs2, but can be found as part
90of the following MPI implementations:
91
92\begin{itemize}
93\item MPICH2-0.96p2 or newer
94\end{itemize}
95
96\subsection{Untarring the packages}
97
98All source code is contained in one tarball: pvfs2-XXX.tgz.  The
99following example assumes that you will be building in the /usr/src
100directory, although that is not required:
101
102\begin{verbatim}
103[root@testhost /root]# cp pvfs2-XXX.tgz /usr/src
104[root@testhost /root]# cd /usr/src
105[root@testhost /usr/src]# tar -xzf pvfs2-XXX.tgz
106[root@testhost /usr/src]# ln -s pvfs2-XXX pvfs2
107[root@testhost /usr/src]# ls -lF
108total 476
109lrwxrwxrwx   1 root    root         15 Aug 14 17:42 pvfs2 -> pvfs2-XXX/
110drwxr-xr-x  12 root    root        512 Aug 14 10:11 pvfs2-XXX/
111-rw-r--r--   1 root    root     371535 Aug 14 17:41 pvfs2-XXX.tgz
112
113\end{verbatim}
114
115\subsection{Building and installing the packages}
116
117The default steps for building and installing PVFS2 are as follows:
118
119\begin{verbatim}
120[root@testhost /usr/src]# cd pvfs2
121[root@testhost /usr/src/pvfs2-XXX]# ./configure
122[root@testhost /usr/src/pvfs2-XXX]# make
123[root@testhost /usr/src/pvfs2-XXX]# make install
124\end{verbatim}
125
126Here are some optional configure arguments which may be of interest:
127\begin{itemize}
128\item --prefix=$<$path$>$: installs all files in the specified directory
129(/usr/local/ is the default if --prefix is not specified)
130\item --with-kernel=$<$path to kernel source$>$: this enables compilation of
131the PVFS2 Linux kernel driver [ Requires Linux Kernel 2.6.0-test4 or later ]
132\item --with-mpi=$<$path to mpi installation$>$: this enables compilation of MPI
133based test programs
134\item --with-efence: automatically links in Electric Fence for debugging assistance
135\end{itemize}
136
137Also note that the pvfs2 kernel source supports out of tree builds if you
138prefer to use that technique.
139
140\section{Configuring PVFS2 for a single host}
141\label{sec:single}
142
143This section documents the steps required to configure PVFS2 on a system
144in which a single machine acts as both the client and server for all
145PVFS2 operations.  It assumes that you have completed the above sections
146on building and installation already.  The hostname of the example machine
147is ``testhost'' and will be referenced as such in the following examples.
148IMPORTANT: if you intend to use the provided rc scripts to handle startup
149and shutdown of the PVFS2 server, then you must specify a valid hostname
150as reported by the \texttt{hostname} command line tool in the configuration.
151For this reason, we recommend that you \emph{not} use ``localhost'' as
152the hostname of your server, even if you intend to only test one machine.
153We will store all PVFS2 data in /pvfs2-storage-space.  /mnt/pvfs2 will
154serve as the mount point for the file system.  For more details about
155the purpose of these directories please see the PVFS2 users guide.
156
157\subsection{Server configuration}
158
159Since this is a single host configuration, we only have to configure
160one server daemon.  In the original PVFS, the metadata and I/O servers
161were separated into two separate programs (mgr and iod).  PVFS2,
162however, has only a single daemon called pvfs2-server which serves
163both roles.
164
165The most important part of server configuration is simply generating
166the configuration files.  These can be created using the
167pvfs2-genconfig script.  This is an interactive script which will ask
168several questions to determine your desired configuration.  Please pay
169particular attention to the listing of the metadata servers and I/O
170servers.  In this example we will use ``testhost'' for both.
171
172The pvfs2-genconfig tool will generate two configuration files.  One
173is a file system configuration file that will be identical for all
174servers (if we had more than one).  The second is a server specific
175configuration file that will be different for each server.  The server
176specific files have the hostname of the server that they belong to
177appended to the file name.  This script should be excuted as root, so
178that we can place the configuration files in their default /etc/
179locations.
180
181In this simple configuration, we can accept the default options for
182every field.  We will use the hostname ``testhost'' rather than
183``localhost'' however.
184
185\begin{verbatim}
186root@testhost:~# /usr/bin/pvfs2-genconfig  \
187        /etc/pvfs2-fs.conf /etc/pvfs2-server.conf
188**********************************************************************
189        Welcome to the PVFS2 Configuration Generator:
190
191This interactive script will generate configuration files suitable
192for use with a new PVFS2 file system.  Please see the PVFS2 quickstart
193guide for details.
194
195**********************************************************************
196
197You must first select the network protocol that your file system will use.
198The only currently supported options are "tcp", "gm", and "ib".
199
200* Enter protocol type [Default is tcp]:
201
202Choose a TCP/IP port for the servers to listen on.  Note that this
203script assumes that all servers will use the same port number.
204
205* Enter port number [Default is 3334]:
206
207Next you must list the hostnames of the machines that will act as
208I/O servers.  Acceptable syntax is "node1, node2, ..." or "node{#-#,#,#}".
209
210* Enter hostnames [Default is localhost]: testhost
211
212Now list the hostnames of the machines that will act as Metadata
213servers.  This list may or may not overlap with the I/O server list.
214
215* Enter hostnames [Default is localhost]: testhost
216
217Configured a total of 1 servers:
2181 of them are I/O servers.
2191 of them are Metadata servers.
220
221* Would you like to verify server list (y/n) [Default is n]?
222
223Choose a file for each server to write log messages to.
224
225* Enter log file location [Default is /tmp/pvfs2-server.log]:
226
227Choose a directory for each server to store data in.
228
229* Enter directory name: [Default is /pvfs2-storage-space]:
230
231Writing fs config file... Done.
232Writing 1 server config file(s)... Done.
233
234Configuration complete!
235\end{verbatim}
236
237\subsection{Starting the server}
238
239Before you run pvfs2-server for the first time, you must run it with a special
240argument that tells it to create a new storage space if it does not already
241exist.  In this example, we must run the server as root in order to create
242a storage space in /pvfs2-storage-space as specified in the configuration
243files.
244
245\begin{verbatim}
246bash-2.05b# /usr/sbin/pvfs2-server /etc/pvfs2-fs.conf \
247        /etc/pvfs2-server.conf-testhost -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                /etc/pvfs2-server.conf-testhost
256\end{verbatim}
257
258All log messages will be directed to /tmp/pvfs2-server.log, unless you specified
259a different location while running pvfs2-genconfig.  If you would prefer to run
260pvfs2-server in the foreground and direct all messages to stderr, then
261you may run the server as follows:
262
263\begin{verbatim}
264bash-2.05b# /usr/sbin/pvfs2-server /etc/pvfs2-fs.conf \
265        /etc/pvfs2-server.conf-testhost -d
266\end{verbatim}
267
268\subsubsection{Automatic server startup and shutdown}
269\label{sec:rc}
270
271Like most other system services, PVFS2 may be started up automatically
272at boot up time through the use of rc scripts.  We have provided one
273such script that is suitable for use on RedHat (or similar) rc
274systems.  The following example demonstrates how to set this up:
275
276\begin{verbatim}
277bash-2.05b# cp /usr/src/pvfs2/examples/pvfs2-server.rc \
278    /etc/rc.d/init.d/pvfs2-server
279bash-2.05b# chmod a+x /etc/rc.d/init.d/pvfs2-server
280bash-2.05b# chkconfig pvfs2-server on
281bash-2.05b#  ls -al /etc/rc.d/rc3.d/S35pvfs2-server
282lrwxrwxrwx  1 root  root   22 Sep 21 13:11 /etc/rc.d/rc3.d/S35pvfs2-server \
283    -> ../init.d/pvfs2-server
284\end{verbatim}
285
286This script will now automatically launch on startup and shutdown to
287ensure that the pvfs2-server is started and stopped gracefully.
288To manually start the server, you can run the following command:
289
290\begin{verbatim}
291bash-2.05b# /etc/rc.d/init.d/pvfs2-server start
292Starting PVFS2 server:                                     [  OK  ]
293\end{verbatim}
294
295To manually stop the server:
296
297\begin{verbatim}
298bash-2.05b# /etc/rc.d/init.d/pvfs2-server stop
299Stopping PVFS2 server:                                     [  OK  ]
300\end{verbatim}
301
302\subsection{Client configuration}
303\label{subsec:client}
304
305There are two primary methods for accessing a PVFS2 file system.  The
306first is the native PVFS2 interface which is made available through
307{\tt libpvfs2}.  This also happens to be the same interface used by
308ROMIO if you configure your system to use MPI-IO.  The second method
309relies on a kernel module to provide standard Linux file system
310compatibility.  This interface allows the user to use existing
311binaries and system utilities on PVFS2 without recompiling.  We will
312cover how to configure both access methods here.
313
314We must create a mount point for the file system as well as an {\tt
315/etc/pvfs2tab} entry that will be used by the PVFS2 libraries to
316locate the file system.  The {\tt pvfs2tab} file is analogous to the
317{\tt /etc/fstab} file that most linux systems use to keep up with file
318system mount points.
319
320\begin{verbatim}
321[root@testhost /root]# mkdir /mnt/pvfs2
322[root@testhost /root]# touch /etc/pvfs2tab
323[root@testhost /root]# chmod a+r /etc/pvfs2tab
324\end{verbatim}
325
326Now edit this file so that it contains the following, except that you should
327substitute your host name in place of ``testhost'':
328
329\begin{verbatim}
330tcp://testhost:3334/pvfs2-fs /mnt/pvfs2 pvfs2 default 0 0
331\end{verbatim}
332
333\subsection{Testing your installation}
334\label{subsec:testing}
335PVFS2 currently includes (among others) the following tools for
336manipulating the file system using the native PVFS2 library:
337pvfs2-ping, pvfs2-import, pvfs2-ls, and pvfs2-export.  These tools
338check the health of the file system, import local files, list the
339contents of directories, and export files, respectively.  Their usage
340can best be summarized with the following examples:
341
342\begin{verbatim}
343bash-2.05b# ./pvfs2-ping -m /mnt/pvfs2
344
345(1) Searching for /mnt/pvfs2 in /etc/pvfs2tab...
346
347   Initial server: tcp://testhost:3334
348   Storage name: pvfs2-fs
349   Local mount point: /mnt/pvfs2
350
351(2) Initializing system interface and retrieving configuration from server...
352
353   meta servers (duplicates are normal):
354   tcp://testhost:3334
355
356   data servers (duplicates are normal):
357   tcp://testhost:3334
358
359(3) Verifying that all servers are responding...
360
361   meta servers (duplicates are normal):
362   tcp://testhost:3334 Ok
363
364   data servers (duplicates are normal):
365   tcp://testhost:3334 Ok
366
367(4) Verifying that fsid 9 is acceptable to all servers...
368
369   Ok; all servers understand fs_id 9
370
371(5) Verifying that root handle is owned by one server...
372
373   Root handle: 0x00100000
374   Ok; root handle is owned by exactly one server.
375
376=============================================================
377
378The PVFS2 filesystem at /mnt/pvfs2 appears to be correctly configured.
379
380bash-2.05b# ./pvfs2-ls /mnt/pvfs2/
381
382bash-2.05b# ./pvfs2-import /usr/lib/libc.a /mnt/pvfs2/testfile
383PVFS2 Import Statistics:
384********************************************************
385Destination path (local): /mnt/pvfs2/testfile
386Destination path (PVFS2 file system): /testfile
387File system name: pvfs2-fs
388Initial config server: tcp://localhost:3334
389********************************************************
390Bytes written: 2555802
391Elapsed time: 0.416727 seconds
392Bandwidth: 5.848920 MB/second
393********************************************************
394
395bash-2.05b# ./pvfs2-ls /mnt/pvfs2/
396testfile
397
398bash-2.05b# ./pvfs2-ls -alh /mnt/pvfs2/
399drwxrwxrwx    1 pcarns  users            0 2003-08-14 22:45 .
400drwxrwxrwx    1 pcarns  users            0 2003-08-14 22:45 .. (faked)
401-rw-------    1 root    root            2M 2003-08-14 22:47 testfile
402
403bash-2.05b# ./pvfs2-export /mnt/pvfs2/testfile /tmp/testfile-out
404PVFS2 Import Statistics:
405********************************************************
406Source path (local): /mnt/pvfs2/testfile
407Source path (PVFS2 file system): /testfile
408File system name: pvfs2-fs
409Initial config server: tcp://localhost:3334
410********************************************************
411Bytes written: 2555802
412Elapsed time: 0.443431 seconds
413Bandwidth: 5.496690 MB/second
414********************************************************
415
416bash-2.05b# diff /tmp/testfile-out /usr/lib/libc.a
417\end{verbatim}
418
419\section{Installing PVFS2 on a cluster}
420\label{sec:cluster}
421It is important to have in mind the roles that machines (a.k.a. nodes) will
422play in the PVFS2 system. There are three potential roles that a machine might
423play: metadata server,  I/O server, or client.
424
425A metadata server is a node that keeps up with metadata (such as permissions
426and time stamps) for the file system. An I/O server is a node that actually
427stores a portion of the PVFS2 file data. A client is a node that can read and
428write PVFS2 files. Your applications will typically be run on PVFS2 clients so
429that they can access the file system.
430
431A machine can fill one, two, or all of these roles simultaneously. Unlike
432PVFS-1, each role requires just the pvfs2-server binary.  It will consult the
433cluster-wide config file and the node-specific config file when it starts up to
434know what role pvfs2-server should perform on this machine.
435
436We currently support just one metadata server (this limit will be raised in the
437future).  There can be many I/O servers and clients. In this section we will
438discuss the components and configuration files needed to fulfill each role.
439
440We will configure our example system so that the node ``cluster1'' provides
441metadata information, eight nodes (named ``cluster1'' through ``cluster8'')
442provide I/O services, and all nodes act as clients.
443
444\subsection{Server configuration}
445We will assume that at this point you have either performed a make install
446on every node, or else have provided the pvfs2 executables, headers, and
447libraries to each machine by some other means.
448
449Installing PVFS2 on a cluster is quite similar to installing it on a single
450machine, so familiarize yourself with Section \ref{sec:single}.  We are going
451to generate one master config file and 8 smaller node-specific config files.
452Again, remember that it is critical to list correct hostnames for each machine,
453and to make sure that these hostnames match the output of the \texttt{hostname}
454command on each machine that will act as a server.
455
456\begin{verbatim}
457root@cluster1:~# /usr/local/pvfs2/bin/pvfs2-genconfig  \
458        /etc/pvfs2-fs.conf /etc/pvfs2-server.conf
459**********************************************************************
460        Welcome to the PVFS2 Configuration Generator:
461
462This interactive script will generate configuration files suitable
463for use with a new PVFS2 file system.  Please see the PVFS2 quickstart
464guide for details.
465
466**********************************************************************
467
468You must first select the network protocol that your file system will use.
469The only currently supported options are "tcp" and "gm".
470
471* Enter protocol type [Default is tcp]:
472
473Choose a TCP/IP port for the servers to listen on.  Note that this
474script assumes that all servers will use the same port number.
475
476* Enter port number [Default is 3334]:
477
478Next you must list the hostnames of the machines that will act as
479I/O servers.  Acceptable syntax is "node1, node2, ..." or "node{#-#,#,#}".
480
481* Enter hostnames [Default is localhost]: cluster{1-8}
482
483Now list the hostnames of the machines that will act as Metadata
484servers.  This list may or may not overlap with the I/O server list.
485
486* Enter hostnames [Default is localhost]: cluster1
487
488Configured a total of 8 servers:
4898 of them are I/O servers.
4901 of them are Metadata servers.
491
492* Would you like to verify server list (y/n) [Default is n]? y
493
494****** I/O servers:
495tcp://cluster1:3334
496tcp://cluster2:3334
497tcp://cluster3:3334
498tcp://cluster4:3334
499tcp://cluster5:3334
500tcp://cluster6:3334
501tcp://cluster7:3334
502tcp://cluster8:3334
503
504****** Metadata servers:
505tcp://cluster1:3334
506
507* Does this look ok (y/n) [Default is y]? y
508
509Choose a file for each server to write log messages to.
510
511* Enter log file location [Default is /tmp/pvfs2-server.log]:
512
513Choose a directory for each server to store data in.
514
515* Enter directory name: [Default is /pvfs2-storage-space]:
516
517Writing fs config file... Done.
518Writing 8 server config file(s)... Done.
519
520Configuration complete!
521\end{verbatim}
522
523We have now made all the config files for an 8-node storage cluster:
524\begin{verbatim}
525root@cluster1:~# ls /etc/pvfs2/foo/
526pvfs2-fs.conf               pvfs2-server.conf-cluster5
527pvfs2-server.conf-cluster1  pvfs2-server.conf-cluster6
528pvfs2-server.conf-cluster2  pvfs2-server.conf-cluster7
529pvfs2-server.conf-cluster3  pvfs2-server.conf-cluster8
530pvfs2-server.conf-cluster4
531\end{verbatim}
532
533Now the config files must be copied out to all of the server nodes.  If you
534use the provided (Redhat style) rc scripts, then you can simply copy all
535config files to every node; each server will pick the correct config files
536based on its own hostname at startup time.  The following example assumes
537that you will use scp to copy files to cluster nodes.  Other possibilities
538include rcp, bpcp, or simply storing the configuration files on an NFS volume.
539Please note, however, that the rc script should be modified if you intend
540to store config files in any location other than the default /etc/.
541
542At this time, we also will copy out the example rc script an enable it on
543each machine.
544
545\begin{verbatim}
546root@cluster1:~# for i in `seq 1 8`; do
547> scp /etc/pvfs2-server.conf-cluster\${i} cluster\${i}:/etc/
548> scp /etc/pvfs2-fs.conf cluster\${i}:/etc/
549> scp /usr/src/pvfs2/examples/pvfs2-server.rc \
550    cluster\${i}:/etc/rc.d/init.d/pvfs2-server
551> ssh cluster\${i} /sbin/chkconfig pvfs2-server on
552> done
553\end{verbatim}
554
555\subsection{Starting the servers}
556
557As with the single-machine case, you must run pvfs2-server with a
558special argument to create the storage space on all the nodes if it
559does not already exist.  Run the following command on every metadata
560or IO node in the cluster:
561
562\begin{verbatim}
563root@cluster1# /usr/sbin/pvfs2-server /etc/pvfs2-fs.conf \
564        /etc/pvfs2-server.conf -f
565\end{verbatim}
566
567Then once the storage space is created, start the server for real with a
568command like this on every metadata or IO node in the cluster:
569
570\begin{verbatim}
571root@cluster1# /usr/sbin/pvfs2-server /etc/pvfs2-fs.conf \
572        /etc/pvfs2-server.conf
573\end{verbatim}
574
575If you want to run the server in the foreground (e.g. for debugging), use the
576-d option.
577
578If you wish to automate server startup and shutdown with rc scripts, refer
579to the corresponding section \ref{sec:rc} from the single server example.
580
581\subsection{Client configuration}
582
583Setting up a client for multiple servers is the same as setting up a client for a single server.  Refer to section \ref{subsec:client}. 
584
585\subsection {Testing your Installation}
586
587Testing a multiple-server pvfs2 installation is the same as testing a
588single-server pvfs2 installation.  Refer to section
589\ref{subsec:testing}
590
591\section{Configuring the PVFS2 Linux VFS Interface}
592\label{sec:vfs-configure}
593
594Assuming you've mastered the download and installation steps of
595managing the PVFS2 source code, configuring the PVFS2 Linux VFS
596Interface is relatively straight forward.  We assume at this point
597that you are familiar with running the server and that a PVFS2 storage
598space has already been created on the node that you would like to
599configure for use with the VFS.  We also assume that you are able to
600run a Linux 2.6.0-test4 kernel or later.
601
602The basic steps are as follows:
603\begin{itemize}
604\item Make sure you are running Linux Kernel version 2.6.0-test4 or
605  later
606\item Compile the PVFS2 Kernel Module against your running kernel
607\end{itemize}
608
609Check to make sure that you are running a Linux 2.6.0-test4 Kernel or
610later.  You can do this in the following manner:
611
612\begin{verbatim}
613gil:~# cat /proc/version
614Linux version 2.6.0-test4 (root@gil) (gcc version 3.3.1 20030722
615(Debian prerelease)) #1 Thu Aug 14 14:32:57 CDT 2003
616\end{verbatim}
617
618By issuing that command, we are able to inspect the output to ensure
619that we're running an appropriate kernel version.  If your kernel is
620older than this version, please download the latest kernel available
621at:
622
623\begin{verbatim}
624http://www.kernel.org/pub/linux/kernel/v2.6/
625
626(or your favorite mirror site)
627\end{verbatim}
628
629Once you're convinced the Linux kernel version is appropriate, it's
630time to compile the PVFS2 kernel module.  To generate the Makefile,
631you need to make sure that you run './configure' with the
632'--with-kernel=path' argument.  An example is provided here for your
633convenience:
634
635\begin{verbatim}
636gil:/usr/src/pvfs2# ./configure --with-kernel=/usr/src/linux
637\end{verbatim}
638
639This example assumes that you've already downloaded, compiled, and are
640now running the kernel located in the /usr/src/linux directory.  After
641this command is issued, build the PVFS2 source tree if it has not yet
642been built.
643
644Building the kernel module requires an extra step.  Since current kernels
645require writing a file in the kernel source directory to build a module, you
646may have to become root to compile the kernel module.  To build the module,
647type ``make kmod''.
648
649At this point, we have a valid PVFS2 Kernel module.  The module itself
650is the file {\tt pvfs.ko} in subdirectory {\tt src/kernel/linux-2.6} in
651your build tree.  You may install it
652to the standard system location with ``make kmod\_install'', again you will
653likely have to be root to do this.  Or you may override the install location
654by setting the variable {\tt KMOD\_DIR} variable when you install.
655
656\section{Testing the PVFS2 Linux VFS Interface}
657\label{sec:vfs-test}
658
659Now that you've built a valid PVFS2 kernel module, there are several
660steps to perform to properly use the file system.
661
662The basic steps are as follows:
663\begin{itemize}
664\item Create a mount point on the local filesystem
665\item Load the Kernel Module into the running kernel
666\item Start the PVFS2 Server application
667\item Start the PVFS2 Client application
668\item Mount your existing PVFS2 volume on the local filesystem
669\item Issue VFS commands
670\end{itemize}
671
672First, choose where you'd like to mount your existing PVFS2 volume.
673Create this directory on the local file system if it does not already
674exist.  Our mount point in this example is /mnt/pvfs2.
675
676\begin{verbatim}
677gil:~# mkdir /mnt/pvfs2
678\end{verbatim}
679
680Now load the kernel module into your running kernel.  You can do this
681by using the 'insmod' program, or modprobe if you've copied your
682module into the appropriate /lib/modules directory for your running
683kernel.  You can then verify that the module was loaded properly using
684'lsmod' as follows:
685
686\begin{verbatim}
687gil:~# insmod /usr/src/pvfs2/src/kernel/linux-2.6/pvfs2.ko
688gil:~# lsmod
689Module                  Size  Used by
690pvfs2                  52320  0
691\end{verbatim}
692
693Note that the module size observed does NOT need to match that as
694shown above.  Also, you can use 'rmmod' to remove the PVFS2 module
695after it's been loaded.
696
697At this point, we need to start the PVFS2 server and the PVFS2 client
698applications before trying to mount a PVFS2 volume.  See previous
699sections on how to properly start the PVFS2 server if you're unsure.
700Starting the PVFS2 client is covered below.
701
702The PVFS2 client application consists of two programs.
703pvfs2-client-core and pvfs2-client.  Do not run pvfs2-client-core by
704itself.  pvfs2-client is the PVFS2 client application.  This
705application cannot be started unless the PVFS2 server is already
706running.  Here is an example of how to start the PVFS2 client:
707
708\begin{verbatim}
709gil:/usr/src/pvfs2# cd test/kernel/linux-2.6/
710gil:/usr/src/pvfs2/test/kernel/linux-2.6# ./pvfs2-client -f -p ./pvfs2-client-core
711pvfs2-client starting
712Spawning new child process
713About to exec ./pvfs2-client-core
714Waiting on child with pid 17731
715\end{verbatim}
716
717The -f argument is not required.  For reference, this keeps the PVFS2
718client application running in the foreground.
719
720The -p argument is required unless the pvfs2-client-core is installed
721and can be found in your PATH.
722
723Now that the module is loaded, and the pvfs2-server and pvfs2-client
724programs are running, we can mount our PVFS2 file system (and verify
725that it's properly mounted) as follows:
726
727\begin{verbatim}
728gil:~# mount -t pvfs2 tcp://testhost:3334/pvfs2-fs /mnt/pvfs2
729gil:~# mount
730/dev/hda3 on / type ext3 (rw,errors=remount-ro)
731proc on /proc type proc (rw)
732devpts on /dev/pts type devpts (rw,gid=5,mode=620)
733/dev/hda1 on /boot type ext2 (rw)
734pvfs2 on /mnt/pvfs2 type pvfs2 (rw)
735\end{verbatim}
736
737NOTE: The device of the format tcp://testhost:3334/pvfs2-fs MUST be
738specified, as we need to know a valid running pvfs2-server and file
739system name to dynamically mount a pvfs2 volume.  These values can be
740read from your configuration files.  As a side note, you can use
741'umount' to unmount the PVFS2 volume when you're ready.
742
743Now that a PVFS2 volume is mounted, normal VFS operation can be issued
744on the command line.  An example is provided below:
745
746\begin{verbatim}
747gil:/usr/src/pvfs2/src/kernel/linux-2.6# mkdir /mnt/pvfs2/newdir
748gil:/usr/src/pvfs2/src/kernel/linux-2.6# ls -al /mnt/pvfs2/newdir
749total 1
750drwxr-xr-x    2 root     root            0 Aug 15 13:29 .
751drwxr-xr-x    3 root     root            0 Aug 15 13:21 ..
752gil:/usr/src/pvfs2/src/kernel/linux-2.6# cp pvfs2.ko
753/mnt/pvfs2/newdir/foo
754gil:/usr/src/pvfs2/src/kernel/linux-2.6# ls -al /mnt/pvfs2/newdir
755total 2
756drwxr-xr-x    2 root     root            0 Aug 15 13:29 .
757drwxr-xr-x    3 root     root            0 Aug 15 13:21 ..
758-rw-r--r--    1 root     root       330526 Aug 15 13:30 foo
759\end{verbatim}
760
761\appendix
762
763\section{Notes on running PVFS2 without root access}
764
765The preceding documentation assumes that you have root access on the
766machine(s) that you wish to install the file system.  However, this is not
767strictly required for any component except for the kernel VFS support.  The
768servers, client libraries (such as MPI-IO), and administrative tools can all
769be used by non-priviledged users.  This may be particularly useful for
770evaluation or testing purposes.
771
772In order to do this, you must make the following adjustments to the
773installation and configuration process:
774\begin{itemize}
775\item Use the --prefix option at configure time to choose an alternate
776directory (one that you have write access to) for installation.  An example
777would be /home/username/pvfs2-build.
778\item When generating the server config files, choose a data storage
779directory that you have write access to, but preferably not NFS mounted.  An
780example would be /tmp/pvfs2-test-space.
781\item Place the pvfs2tab file in an alternate location, such as
782/home/username/pvfs2-build/pvfs2tab, instead of /etc/pvfs2tab.
783Then set the PVFS2TAB\_FILE environment variable to the full path
784to this file.  A tcsh example would be: ``setenv PVFS2TAB\_FILE
785/home/username/pvfs2-build/pvfs2tab''.
786\end{itemize}
787
788
789\section{Debugging your PVFS2 configuration}
790
791Bug reports and questions should be directed to the PVFS2 users mailing list
792for best results (see the PVFS2 web site for details:
793http://www.pvfs.org/pvfs2/lists.html).  It is helpful to
794include a description of your problem, the PVFS2 version number, and include
795relevant log information from /var/log/messages and /tmp/pvfs2-server.log.
796
797People who wish to find more verbose information about what the file
798system is doing can enable extra logging messages from the server.
799This is done by adjusting the ``EventLogging'' field in the file system
800configuration file.  By default it is set to ``none''.  You can set it to
801a comma seperated list of log masks to get more information.  An example
802would be ``EventLogging storage,network,server'', which will result
803in verbose messages from the storage subsystem, the network subsystem,
804and server state machines.  \emph{WARNING: this may result in extremely
805large log files!}  The logging masks can also be set at runtime using the
806pvfs2-set-debugmask command line tool.  Usage information and a list of
807supported masks will be shown if it is run with no arguments.
808
809Similarly, run-time client debugging information can be gathered by
810using environment variables before running the client application.
811The default client logging method is to set the variable
812PVFS2\_DEBUGMASK to values such as ``client,network''.  Many of the
813supported client debugging masks overlap the server masks that can be
814verified using pvfs2-set-debugmask.  By default, setting
815PVFS2\_DEBUGMASK emits debugging information to stderr, often
816intermixed with the client program output.  If you'd like to redirect
817client debugging to a file, set the PVFS2\_DEBUGFILE environment
818variable to a valid file name.  This causes all debug information
819specified by the PVFS2\_DEBUGMASK to be stored in the file specified,
820no longer intermixing the output with the client program.
821
822\section{ROMIO Support}
823\label{sec:romio}
824
825Building ROMIO with PVFS2 support can be a bit tricky, and is certainly
826not well documented.  While ROMIO has been updated with PVFS2 support,
827only MPICH2 has included a recent snapshot of ROMIO. 
828
829First, get the software.  Download MPICH2 from
830http://www.mcs.anl.gov/mpi/mpich2/.  While MPICH2 contains a ROMIO
831with PVFS2 support, the PVFS2 API has continued to stabilize since
832MPICH2 was last released.  Patches to syncronize the ROMIO in MPICH2
833with PVFS2 can be found at
834http://www.mcs.anl.gov/romio/pvfs2-patches.html.  There is also a
835patch in the PVFS2 source in {\tt doc/coding}. For example's sake,
836assume all software was downloaded to {\tt \$\{HOME\}/src}.
837
838Unpack mpich2, then change to the src/mpi/romio directory.  Apply the
839ROMIO patch.  The patch makes changes to the ROMIO configure scripts, so you'll have to re-run {\tt autoconf} to generate a new configure file.
840
841\begin{verbatim}
842prompt% tar xzf ~/src/mpich2-0.96p2.tar.gz     # unpack mpich2 source
843prompt% cd mpich2-0.96p2/src/mpi/romio         # change to ROMIO dir
844prompt% patch -p0 < ~/src/romio-<CORRECT_VERSION>.diff   #apply patch
845prompt% autoconf                               # create a new 'configure'
846prompt% cd ../../..                            # return to top of src
847prompt%
848\end{verbatim}
849
850In order to build MPICH2 with a ROMIO that speaks PVFS2, a few changes
851have to be made to the normal configure process.  MPICH2 will need to
852know the path to the PVFS2 installation.  Modify the {\tt CFLAGS},
853{\tt LDFLAGS} and {\tt LIBS} environment variables.
854
855\begin{verbatim}
856prompt% export CFLAGS="<other desired flags> -I/usr/local/pvfs2/include"
857prompt% export LDFLAGS="-L/usr/local/pvfs2/lib"
858prompt% export LIBS="-lpvfs2 -lpthread"
859prompt%
860\end{verbatim}
861
862The MPICH2 configure script needs a some additional arguments to build
863ROMIO correctly.  The {\tt enable-romio} flag builds ROMIO and  the
864{\tt with-file-system} flag tells ROMIO which file systems to support.
865
866\begin{verbatim}
867configure --enable-romio --with-file-system=ufs+nfs+pvfs2 [other flags]
868\end{verbatim}
869
870Now compile and install MPICH2 as you normally would.  Applications accessing
871PVFS2 through MPI-IO will bypass the kernel interface and talk to PVFS2 servers directly. 
872
873\end{document}
Note: See TracBrowser for help on using the browser.