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