一、环境
主机:ThinkPad-T420
操作系统:ubuntu12.04
软件版本:pvfs-2.8.2
用户:root
二、安装支撑的数据库 Berkely DB
1、wget
2、cp db-4.6.18.tar.gz /usr/src/
3、cd /usr/src/
4、tar -zxf db-4.6.18.tar.gz
5、cd db-4.6.18/build_unix
6、env cc=gcc ../dist/configure --prefix=/usr/berkeleydb(指定编译器和安装路径)
7、make
8、make install
9、echo '/usr/berkeleydb/lib/' >> /etc/ld.so.conf(在系统库路径中追加berkerly DB的库的路径)
10、ldconfig
三、安装pvfs
1、安装SSL的开发库和头文件等,可能用于PVFS2的网络通讯:
root@mini-ThinkPad-T420:apt-get install libssl-dev
2、安装AIO的库(This library enables userspace to use Linux kernel asynchronous I/O system calls, important for the performance of databases):
root@mini-ThinkPad-T420:apt-get install libaio-dev
3、下载pvfs的源码:
(1)cp pvfs-2.8.2-tar.gz /usr/src
(2)cd /usr/src
(3)tar -zxf pvfs-2.8.2-tar.gz
(4)ln -s pvfs-2.8.2 pvfs2
(5)cd pvfs2
(6)./configure
假如执行无误应该会有如下显示:
点击(此处)折叠或打开
- ***** Displaying PVFS Configuration Information *****
- ------------------------------------------------------
- PVFS2 configured to build karma gui : no
- PVFS2 configured to perform coverage analysis : no
- PVFS2 configured for aio threaded callbacks : yes
- PVFS2 configured to use FUSE : no
- PVFS2 configured for the 2.6.x kernel module : no
- PVFS2 configured for the 2.4.x kernel module : no
- PVFS2 configured for using the mmap-ra-cache : no
- PVFS2 will use workaround for redhat 2.4 kernels : no
- PVFS2 will use workaround for buggy NPTL : no
- PVFS2 server will be built : yes
- PVFS2 version string: 2.8.2
(8)make install
执行后的结果最后几行如下显示:
点击(此处)折叠或打开
- # for compatibility in case anyone really wants "lsplus"
- ln -snf pvfs2-ls /usr/local/bin/pvfs2-lsplus
- install -m 755 src/apps/admin/pvfs2-config /usr/local/bin
- install -m 755 ./src/apps/admin/pvfs2-genconfig /usr/local/bin
- install -m 755 ./src/apps/admin/pvfs2-config-convert /usr/local/bin
- install -d /usr/local/sbin
- install -m 755 src/apps/admin/pvfs2-mkspace src/apps/admin/pvfs2-migrate-collection src/apps/admin/pvfs2-change-fsid src/apps/admin/pvfs2-showcoll /usr/local/bin
- install -m 755 src/server/pvfs2-server /usr/local/sbin
1、pvfs2-genconfig /etc/pvfs2-fs.conf(生成配置文件)
2、* Enter protocol type [Default is tcp]: 回车
* Enter port number [Default is 3334]: 回车
* Enter directory name: [Default is /pvfs2-storage-space]: 回车
* Enter log file location [Default is /tmp/pvfs2-server.log]: /var/log/pvfs2-server.log(可以选择回车默认,我将这个加到了系统日志的目录下)
* Enter hostnames [Default is localhost]: mini-ThinkPad-T420(此处必须填上你的机器的名称)
回车
。
。
3、pvfs2-server /etc/pvfs2-fs.conf -f(第一次启动的时候需要格式化存储目录加上-f的参数)
(以后可以不用加任何参数,当然也可以加上-d的参数,让其在终端进程中运行,这样终端结束,文件系统自动关闭)
4、客户端配置
(1)mkdir /mnt/pvfs2(配置挂载点的目录)
(2)vi /etc/fstab(在文件末尾追加以下行,并且将紫色部分换成之前自己填写的自己的主机名称)
tcp://mini-ThinkPad-T420:3334/pvfs2-fs /mnt/pvfs2 pvfs2 defaults,noauto 0 0
5、验证安装:
pvfs2-ping -m /mnt/pvfs2
点击(此处)折叠或打开
- (1) Parsing tab file...
- (2) Initializing system interface...
- (3) Initializing each file system found in tab file: /etc/fstab...
- PVFS2 servers: tcp://mini-ThinkPad-T420:3334
- Storage name: pvfs2-fs
- Local mount point: /mnt/pvfs2
- /mnt/pvfs2: Ok
- (4) Searching for /mnt/pvfs2 in pvfstab...
- PVFS2 servers: tcp://mini-ThinkPad-T420:3334
- Storage name: pvfs2-fs
- Local mount point: /mnt/pvfs2
- meta servers:
- tcp://mini-ThinkPad-T420:3334
- data servers:
- tcp://mini-ThinkPad-T420:3334
- (5) Verifying that all servers are responding...
- meta servers:
- tcp://mini-ThinkPad-T420:3334 Ok
- data servers:
- tcp://mini-ThinkPad-T420:3334 Ok
- (6) Verifying that fsid 238510620 is acceptable to all servers...
- Ok; all servers understand fs_id 238510620
- (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.
rm -r /pvfs2-storage-space
至于文件系统的使用和分析,本人正在研究,有一定进展之后再跟大家一起分享!