5. 测试(在client端测试借助pvfs2-ping, pvfs-cp, pvfs-ls命令来测试)
[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.net: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.net:3334
- Storage name: pvfs2-fs
- Local mount point: /mnt/pvfs2
- meta servers:
- tcp://www.linuxidc.com:3334
- data servers:
- tcp://www.linuxidc.com:3334
- tcp://www.linuxidc.net:3334
- (5) Verifying that all servers are responding...
- meta servers:
- tcp://www.linuxidc.com:3334 Ok
- data servers:
- tcp://www.linuxidc.com:3334 Ok
- tcp://www.linuxidc.net:3334 Ok
- (6) Verifying that fsid 1249973606 is acceptable to all servers...
- Ok; all servers understand fs_id 1249973606
- (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 //第一次ls,没任何东西
[root@www.linuxidc.com ~]# ~/program/pvfs2-install/bin/pvfs2-cp -t /usr/lib/libc.a /mnt/pvfs2/testfile
Wrote 2817820 bytes in 1.041003 seconds. 2.581436 MB/seconds //cp了一些东西放进去
[root@www.linuxidc.com ~]# ~/program/pvfs2-install/bin/pvfs2-ls -alh /mnt/pvfs2
drwxrwxrwx 1 root root 4.0K 2011-12-23 18:37 . //果真有东西了
drwxrwxrwx 1 root root 4.0K 2011-12-23 18:37 .. (faked)
-rw-r--r-- 1 root root 2.7M 2011-12-23 18:37 testfile
drwxrwxrwx 1 root root 4.0K 2011-12-23 18:06 lost+found
[root@www.linuxidc.com /]# ~/program/pvfs2-install/bin/pvfs2-cp -t /mnt/pvfs2/testfile /tmp/testfile-out
Wrote 2817820 bytes in 0.157310 seconds. 17.082721 MB/seconds //把放进去的东西再拷出来,放在/tmp下面
[root@www.linuxidc.com /]# diff /tmp/testfile-out /usr/lib/libc.a //把考出来的文件和原来的文件比较,发现一模一样
6.总结
(1)client把I/O servers(不管I/O server有多少个节点)之一挂在到本地/mnt/pvfs2目录后,就可以像访问本地目录一样对其进行读/写/操作了
(2)唯一不同的是,不是用linux自带的读写命令(如ls, cp),而要用到pvfs2的命令(pvfs2-ls, pvfs2-cp),故在client上也应该把这些命令文件放置好
(3)为了在client上执行命令时,不用绝对路径或者相对路径,可以把防止pvfs2命令的目录加入到环境变量文件中
(4)通过client给/mnt/pvfs2写入一些文件后,分别在www.linuxidc.com和www.linuxidc.net两个节点上通过linux自带的ll查看本地存储目录/pvfs2-storage-space/
- [root@www.linuxidc.com /]# ls -l /pvfs2-storage-space/
- total 20
- drwxr-xr-x 4 root root 4096 Dec 23 18:30 4a811566
- -rw------- 1 root root 8192 Dec 23 18:06 collections.db
- -rw------- 1 root root 8192 Dec 23 18:06 storage_attributes.db
- [root@www.linuxidc.com /]# ssh www.linuxidc.net ls -l /pvfs2-storage-space/
- total 20
- drwxr-xr-x 4 root root 4096 Dec 23 18:29 4a811566
- -rw------- 1 root root 8192 Dec 23 18:06 collections.db
- -rw------- 1 root root 8192 Dec 23 18:06 storage_attributes.db
以上情况说明,文件是被均衡地放在了两个节点上???哪怕是非常小的文件??
