1. Configure the environment (root User) Configure/etc/hosts (root User) (0) Prepare to create program/pvfs2-insta under/root
1. Configure the environment (root User)
Configure/etc/hosts
202.117.10.37 www.linuxidc.com
// Www.linuxidc.com serves as the metadata server, I/O server, client
2. Install pvfs-2.8.2 (root User)
(0) Preparation
Create the program/pvfs2-install directory under/root as the installation directory
Softdirectory (set pvfs-2.8.2.tar.gz)
(1) Extract
[Root@www.linuxidc.com soft] # tar-zxvf pvfs-2.8.2.tar.gz
(2) Compile and install
[Root@www.linuxidc.com pvfs-2.8.2] #./configure-prefix =/root/program/pvfs2-install/
Root@www.linuxidc.com pvfs-2.8.2 # make
[Root@www.linuxidc.com pvfs-2.8.2] # make install
3. Server Configuration
(1) In PVFS2, the daemon pvfs2-server serves as the metadata server, I/O server two roles
(2) generate a configuration file
Root@www.linuxidc.com ~ #~ /Program/pvfs2-install/bin/pvfs2-genconfig/etc/pvfs2-fs.conf
* Enter protocol type [Default is tcp]:
* Enter directory name: [Default is/pvfs2-storage-space]:
* Enter log file location [Default is/tmp/pvfs2-server.log]:
Next you must list the hostnames of the machines that will act
I/O servers. Acceptable syntax is "node1, node2,..." or "node {#-#,#,#}".
* Enter hostnames [Default is localhost]: www.linuxidc.com
* Wocould you like to verify server list (y/n) [Default is n]?
Writing fs config file... done
// Generate the/etc/pvfs2-gencon configuration file through the interactive script pvfs2-fs.conf fi g
// Note: the metadata server and I/O server are named www.linuxidc.com (do not use localhost)
(3) create a bucket before the first startup
Root@www.linuxidc.com ~ #~ /Program/pvfs2-install/sbin/pvfs2-server/etc/pvfs2-fs.conf-f
Root@www.linuxidc.com ~ # Ll/will find more/pvfs2-storage-space
(4) manually start the server (by default, log write/tmp/pvfs2-server.log)
Root@www.linuxidc.com ~ #~ /Programs/pvfs2-install/sbin/pvfs2-server/etc/pvfs2-fs.conf
[S 12/21] PVFS2 Server on node www.linuxidc.com version 2.8.2 starting...
You can use netstat-nplt to check that the service has been started and occupies port 3344.
(5) set the boot start (put the pvfs2-server.rc under/etc/rc. d/init. d, to a standalone service, and set the boot start)
Root@www.linuxidc.com ~ # Cp ~ /Soft/pvfs-2.8.2/examples/pvfs2-server.rc/etc/rc. d/init. d/pvfs2-server
Root@www.linuxidc.com ~ # Chmod a + x/etc/rc. d/init. d/pvfs2-server
Root@www.linuxidc.com ~ # Chkconfig pvfs2-server on
Root@www.linuxidc.com ~ # Ls-al/etc/rc. d/rc3.d/S35pvfs2-server // check to ensure that the service is started when runlevel3 is started in plain text
Lrwxrwxrwx 1 root 22 Dec 22/etc/rc. d/rc3.d/S35pvfs2-server-> ../init. d/pvfs2-server
To start manually immediately:
Root@www.linuxidc.com ~ #/Etc/rc. d/init. d/pvfs2-server start
Or [root@www.linuxidc.com ~] # Service pvfs2-server (restart)
4. Configure the client
Create a mount point and set the mount point file pvfs2tab.
Root@www.linuxidc.com ~ # Mkdir/mnt/pvfs2
Root@www.linuxidc.com ~ # Touch/etc/pvfs2tab
Root@www.linuxidc.com ~ # Chmod a + r/etc/pvfs2tab
Root@www.linuxidc.com ~ # Vi/etc/pvfs2tab
Root@www.linuxidc.com ~ # Cat/etc/pvfs2tab
Tcp: // www.linuxidc.com: 3334/pvfs2-fs/mnt/pvfs2 pvfs2 defaults, noauto 0 # noauto on mount-
In fact, it is also possible to put the above line into/etc/fstab, and there is no need to create the/etc/pvfs2tab file.
5. Test (with pvfs2-ping, pvfs-cp, pvfs-ls command to test)
Root@www.linuxidc.com ~ #~ /Program/pvfs2-install/bin/pvfs2-ping/m/mnt/pvfs2/
(1) Parsing tab file...
(2) Initializing system interface...
(3) Initializing each file system found in tab file:/etc/pvfs2tab...
PVFS2 servers: tcp: // www.linuxidc.com: 3334
Storage name: pvfs2-fs
Local mount point:/mnt/pvfs2
/Mnt/pvfs2: OK
(4) Searching for/mnt/pvfs2/in pvfstab...
PVFS2 servers: tcp: // www.linuxidc.com: 3334
Storage name: pvfs2-fs
Local mount point:/mnt/pvfs2
Meta servers:
Tcp: // www.linuxidc.com: 3334
Data servers:
Tcp: // www.linuxidc.com: 3334
(5) Verifying that all servers are responding...
Meta servers:
Tcp: // www.linuxidc.com: 3334 OK
Data servers:
Tcp: // www.linuxidc.com: 3334 OK
(6) Verifying that fsid 153623231 is acceptable to all servers...
OK; all servers understand fs_id 153623231
(7) Verifying that root handle is owned by one server...
Root handle: 1048576
OK; root handle is owned by exactly one server.
========================================================== ==================================
The PVFS2 filesystem at/mnt/pvfs2/appears to be correctly configured.
Root@www.linuxidc.com ~ #~ /Program/pvfs2-install/bin/pvfs2-ls/mnt/pvfs2
Lost + found
Root@www.linuxidc.com ~ #~ /Program/pvfs2-install/bin/pvfs2-cp-t/usr/lib/libc. a/mnt/pvfs2/testfile
Wrote 2817820 bytes in 0.879265 seconds. 3.056283 MB/seconds
Root@www.linuxidc.com ~ #~ /Program/pvfs2-install/bin/pvfs2-ls-alh/mnt/pvfs2
Drwxrwxrwx 1 root 4.0 K 2011-12-23.
Drwxrwxrwx 1 root 4.0 K 2011-12-23 .. (faked)
-Rw-r -- 1 root 2.7 M 2011-12-23 10: 51 testfile
Drwxrwxrwx 1 root 4.0 K 2011-12-21 19:19 lost + found
Root@www.linuxidc.com ~ #~ /Program/pvfs2-install/bin/pvfs2-cp-t/mnt/pvfs2/testfile/tmp/testfile-out
Wrote 2817820 bytes in 0.034848 seconds. 77.114483 MB/seconds
Root@www.linuxidc.com ~ # Diff/tmp/testfile-out/usr/lib/libc.