1. Configure the environment (root User) (1) Configure/etc/hosts202.117.10.37www.linuxidc.com202.117.10.50www.linuxidc.net (2) Configure password-less login (on www.linuxidc.com) [root@www.linuxidc.com
1. Configure the environment (root User)
(1) Configure/etc/hosts on the two machines respectively
202.117.10.37 www.linuxidc.com
202.117.10.50 www.linuxidc.net
(2) Configure logon without a password (on www.linuxidc.com)
Root@www.linuxidc.com ~ # Ssh-keygen-t rsa
Root@www.linuxidc.com ~ # Cp ~ /. Ssh/id_rsa.pub ~ /. Ssh/authorized_keys
Root@www.linuxidc.com ~ # Scp ~ /. Ssh/* root@www.linuxidc.net :~ /. Ssh/
(3) machine role assignment
Www.linuxidc.com serves as the metadata server
Www.linuxidc.com and www.linuxidc.net are both I/O servers.
Both www.linuxidc.com and www.linuxidc.net serve as clients at the same time.
2. Install the pvfs-2.8.2 (the root user allocates the compilation and installation on www.linuxidc.com and www.linuxidc.net)
(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) www.linuxidc.com serves as the metadata server, www.linuxidc.com and www.linuxidc.net serves as the I/O node.
(2) generate a configuration file on www.linuxidc.com
Root@www.linuxidc.com ~ #~ /Program/pvfs2-install/bin/pvfs2-genconfig/etc/pvfs2-fs.conf
- **************************************** ******************************
- Welcome to the PVFS2 Configuration Generator:
- This interactive script will generate configuration files suitable
- For use with a new PVFS2 file system. Please see the PVFS2 quickstart
- Guide for details.
- **************************************** ******************************
- You must first select the network protocol that your file system will use.
- The only currently supported options are "tcp", "gm", "mx", "ib", and "portals ".
- (For multi-homed invocations, use e.g. "ib, tcp ".)
- * Enter protocol type [Default is tcp]:
- Choose a TCP/IP port for the servers to listen on. Note that this
- Script assumes that all servers will use the same port number.
- * Enter port number [Default is 3334]:
- Choose a directory for each server to store data in.
- * Enter directory name: [Default is/pvfs2-storage-space]:
- Choose a file for each server to write log messages.
- * 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]: amao99 {1-2}
- Use same servers for metadata? (Recommended)
- * Enter yes or no [Default is yes]: no
- Now list the hostnames of the machines that will act as Metadata
- Servers. This list may or may not overlap with the I/O server list.
- * Enter hostnames [Default is localhost]: www.linuxidc.com
- Configured a total of 2 servers:
- 2 of them are I/O servers.
- 1 of them are Metadata servers.
- * Wocould you like to verify server list (y/n) [Default is n]? Y
- * ***** I/O servers:
- Www.linuxidc.com
- Www.linuxidc.net
- * ***** Metadata servers:
- Www.linuxidc.com
- * Does this look OK (y/n) [Default is y]? Y
- Writing fs config file... done
(3) copy the configuration file from www.linuxidc.com to www.linuxidc.net and place it in the same path.
Root@www.linuxidc.com ~ # Scp/etc/pvfs2-fs.conf (www.linuxidc.net:/etc/
(4) set the service on www.linuxidc.com and www.linuxidc.net respectively, and start the service upon startup.
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
The execution on www.linuxidc.net is the same as that on www.linuxidc.com. You can also perform the following operations on www.linuxidc.net:
Root@www.linuxidc.com ~ # Scp ~ /Soft/pvfs-2.8.2/examples/pvfs2-server.rc www.linuxidc.net:/etc/rc. d/init. d/pvfs2-server
Root@www.linuxidc.com ~ # Ssh www.linuxidc.net/bin/chmod a + x/etc/rc. d/init. d/pvfs2-server
Root@www.linuxidc.com ~ # Ssh www.linuxidc.net/sbin/chkconfig pvfs2-server on
(5) create a bucket (on two IO servers respectively)
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
Also executed on www.linuxidc.net
Root@www.linuxidc.net ~ #~ /Program/pvfs2-install/sbin/pvfs2-server/etc/pvfs2-fs.conf-f
Root@www.linuxidc.net ~ # Ll/will find more/pvfs2-storage-space
(6) manually start metadata server and I/O server (that is, execute on www.linuxidc.com and www.linuxidc.net)
Root@www.linuxidc.net ~ #~ /Programs/pvfs2-install/sbin/pvfs2-server/etc/pvfs2-fs.conf
[S 12/23] PVFS2 Server on node www.linuxidc.net version 2.8.2 starting...
You can use netstat-nplt to check that the service has been started and occupies port 3344.
Also executed on www.linuxidc.net
Root@www.linuxidc.net ~ #~ /Programs/pvfs2-install/sbin/pvfs2-server/etc/pvfs2-fs.conf
4. Client Configuration
Also, use www.linuxidc.com as the client (any other machine can be used as the client), create a mount point, and set the mount point to the pvfs2tab file.
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.net: 3334/pvfs2-fs/mnt/pvfs2 pvfs2 defaults, noauto 0 # noauto on mount-
Note:
(1) 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.
(2) In this example, there are two storage nodes: www.linuxidc.com and www.linuxidc.net. when the client is attached to the server, the server can be any one of them because the server is of an equal identity, in this example, tcp: // www.linuxidc.net: 3334/pvfs2-fs
(3) When multiple clients exist, different clients should not be mounted on the same server as much as possible, which can distribute the input/output load.
(4) After the configuration is complete, restart the client and the client will be automatically mounted. Then you can test it.