如何在 BladeCenter JS20 上安裝 PVFS2 文件系統(tǒng)
適用機(jī)型: | |
所有BladeCenter JS20 |
文檔內(nèi)容: |
PVFS2 對(duì)軟件包的要求:
db-devel
kernel-source
db-64bit (生成64位的PVFS2 Client 時(shí)需要)
測(cè)試環(huán)境:
在這里,我們使用的是PVFS2 1.3.0 的版本,可以從下面網(wǎng)址去下載
http://www.pvfs.org/pvfs2/index.html
BladeCenter JS20 三臺(tái),在本次實(shí)驗(yàn)中,我們用兩臺(tái) BladeCenter JS20 來(lái)做為 PVFS2 Data I/O Server (node17, node18),而 node17 同時(shí)也是 PVFS2 MetaData Server. 另外一臺(tái) BladeCenter 我們做為 PVFS2 Client
node17 (192.168.28.57)
node18 (192.168.28.58)
test01 (192.168.28.60)
操作系統(tǒng)我們使用的是 SuSE Linux Enterprise Server 9
PVFS2 Server 的安裝:
(我們把下載的 pvfs2-1.3.0.tar.gz 放在了 /tmp 目錄下)
首先我們要進(jìn)行解包:
node17:/tmp # tar xzvf pvfs2-1.3.0.tar.gz
然后進(jìn)行設(shè)置:
node17:/tmp # cd pvfs2-1.3.0/
node17:/tmp/pvfs2-1.3.0 # ./configure
最后會(huì)出現(xiàn)下面的顯示信息:
***** Displaying PVFS2 Configuration Information *****
------------------------------------------------------
PVFS2 configured to build karma gui : no
PVFS2 configured to use epoll : no
PVFS2 configured to perform coverage analysis : no
PVFS2 configured for aio threaded callbacks : yes
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 configured for a thread-safe client library : yes
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: 1.3.0
生成二進(jìn)制文件:
node17:/tmp/pvfs2-1.3.0 # make
安裝生成的二進(jìn)制文件:
node17:/tmp/pvfs2-1.3.0 # make install
同樣的操作,我們要在另一個(gè)裝備做為PVFS2 I/O Server 的 node18 上再做一遍。
PVFS2 Client 的安裝:
在準(zhǔn)備做為 PVFS2 Client 的 test01 上,我們要生成 64 位的應(yīng)用程序,這是由于我們使用的Linux內(nèi)核是64位的,PVFS2 Client 必須與內(nèi)核匹配。
(我們把下載的 pvfs2-1.3.0.tar.gz 放在了 /tmp 目錄下)
解開(kāi)壓縮包:
test02:/tmp # tar xzvf pvfs2-1.3.0.tar.gz
test02:/tmp # cd pvfs2-1.3.0/
編譯前,先定義兩個(gè)環(huán)境變量,這樣,在生成二進(jìn)制文件中,就會(huì)生成64位的程序:
test02:/tmp/pvfs2-1.3.0 # export CFLAGS=”-m64”
test02:/tmp/pvfs2-1.3.0 # export LDFLAGS=”-m64”
生成二進(jìn)制文件(使用 --disable-server 選項(xiàng)會(huì)在編譯時(shí),不成生PVFS2 Server 的相關(guān)程序):
test02:/tmp/pvfs2-1.3.0 # ./configure --with-kernel=/usr/src/linux –disable-server
***** Displaying PVFS2 Configuration Information *****
------------------------------------------------------
PVFS2 configured to build karma gui : no
PVFS2 configured to use epoll : no
PVFS2 configured to perform coverage analysis : no
PVFS2 configured for aio threaded callbacks : yes
PVFS2 configured for the 2.6.x kernel module : yes
PVFS2 configured for the 2.4.x kernel module : no
PVFS2 configured for using the mmap-ra-cache : no
PVFS2 configured for a thread-safe client library : yes
PVFS2 will use workaround for redhat 2.4 kernels : no
PVFS2 will use workaround for buggy NPTL : no
PVFS2 server will be built : no
PVFS2 version string: 1.3.0
生成二進(jìn)制文件:
node17:/tmp/pvfs2-1.3.0 # make
安裝生成的二進(jìn)制文件:
node17:/tmp/pvfs2-1.3.0 # make install
準(zhǔn)備生成 kernel module:
test02:/tmp/pvfs2-1.3.0 # make kmod
安裝生成的 kernel module:
test02:/tmp/pvfs2-1.3.0 # make kmod_install
運(yùn)行 PVFS
設(shè)置 PVFS Server:
在 node17 上,運(yùn)行下面命令:
node17:/tmp/pvfs2-1.3.0 # pvfs2-genconfig /etc/pvfs2-fs.conf /etc/pvfs2-server.conf
· Protocol: tcp
· Port: 3334
· I/O Servers: 所有準(zhǔn)備提供存儲(chǔ)空間的服務(wù)器
· Metadata Server: 做為Metadata 的服務(wù)器
· Logfile: /var/log/pvfs2.log
· Data store directory: /pvfs-storage
初始化做為 pvfs2 的存儲(chǔ)空間:
在 node17 和 node18 上,都要執(zhí)行,缺省情況下,會(huì)是 /pvfs2-storage-space,可以通過(guò)修改 /etc/pvfs2-server.conf-* 的文件來(lái)更改。
node17 上
node17:/tmp/pvfs2-1.3.0 # pvfs2-server /etc/pvfs2-fs.conf /etc/pvfs2-server.conf-node17 –f
node18 上
node18:/tmp/pvfs2-1.3.0 # pvfs2-server /etc/pvfs2-fs.conf /etc/pvfs2-server.conf-node18 -f
啟動(dòng) pvfs2 server:
node17 上
node17:/tmp/pvfs2-1.3.0 # pvfs2-server /etc/pvfs2-fs.conf /etc/pvfs2-server.conf-node17
[22:38:42.560848] PVFS2 Server version 1.3.0 starting.
node18 上
node18:/tmp/pvfs2-1.3.0 # pvfs2-server /etc/pvfs2-fs.conf /etc/pvfs2-server.conf-node18
[22:38:42.560848] PVFS2 Server version 1.3.0 starting.
設(shè)置 PVFS2 Client:
test02:/tmp/pvfs2-1.3.0 # mkdir /mnt/pvfs2
test02:/tmp/pvfs2-1.3.0 # vi /etc/pvfs2tab
加入一行
tcp://node17:3334/pvfs2-fs /mnt/pvfs2 pvfs2 defaults 0 0
測(cè)試 pvfs2:
test02:/tmp/pvfs2-1.3.0 # pvfs2-ping -m /mnt/pvfs2/
(1) Parsing tab file...
(2) Initializing system interface...
(3) Initializing each file system found in tab file: /etc/pvfs2tab...
/mnt/pvfs2: Ok
(4) Searching for /mnt/pvfs2/ in pvfstab...
PVFS2 servers: tcp://node17:3334
Storage name: pvfs2-fs
Local mount point: /mnt/pvfs2
meta servers:
tcp://node17:3334
data servers:
tcp://node17:3334
tcp://node18:3334
(5) Verifying that all servers are responding...
meta servers:
tcp://node17:3334 Ok
data servers:
tcp://node17:3334 Ok
tcp://node18:3334 Ok
(6) Verifying that fsid 1106969663 is acceptable to all servers...
Ok; all servers understand fs_id 1106969663
(7) Verifying that root handle is owned by one server...
Root handle: 1048576
Ok; root handle is owned by exactly one server.
=============================================================
The PVFS filesystem at /mnt/pvfs2/ appears to be correctly configured.
我們可以先嘗試向 pvfs2 文件系統(tǒng)上寫(xiě)一個(gè)文件
test02:/tmp/pvfs2-1.3.0 # pvfs2-ls /mnt/pvfs2
lost+found
我們用dd創(chuàng)建一個(gè)100MB的用來(lái)測(cè)試的文件 testfile
test02:/tmp/pvfs2-1.3.0 # dd if=/dev/zero of=/tmp/testfile bs=1024 count=102400
102400+0 records in
102400+0 records out
把 testfile 拷貝到PVFS2文件系統(tǒng)上
test02:/tmp/pvfs2-1.3.0 # pvfs2-cp /tmp/testfile /mnt/pvfs2
檢查一下剛才拷貝的文件是否存大,文件大小是否一致
test02:/tmp/pvfs2-1.3.0 # pvfs2-ls -lh /mnt/pvfs2
drwxrwxrwx 1 root root 4.0K 2005-09-21 22:48 lost+found
-rw-r--r-- 1 root root 100.0M 2005-09-21 14:44 testfile
刪除剛才拷貝的文件 testfile
test02:/tmp/pvfs2-1.3.0 # pvfs2-rm /mnt/pvfs2/testfile
test02:/tmp/pvfs2-1.3.0 # pvfs2-ls /mnt/pvfs2
lost+found
上面,我們是使用PVFS提供的工具來(lái)對(duì)PVFS2文件系統(tǒng)來(lái)訪問(wèn),如果要在操作系統(tǒng)下,象訪問(wèn)本地硬盤(pán)一樣直接訪問(wèn)PVFS2文件系統(tǒng),我們需要先加載 pvfs2 文件系統(tǒng)到 /mnt/pvfs2,這樣我們就可以用正常的方式來(lái)訪問(wèn) pvfs2 文件系統(tǒng)了。
首先要加載 pvfs2.ko 模塊:
test02:/tmp/pvfs2-1.3.0 # depmod
test02:/tmp/pvfs2-1.3.0 # modprobe pvfs2
(在剛才執(zhí)行了 make kmod_install 以后,pvfs2.ko 會(huì)被安裝到 /lib/modules/2.6.5-7.97-pseries64/kernel/fs/pvfs2 目錄下)
啟動(dòng) pvfs2 client:
test02:/tmp/pvfs2-1.3.0 # pvfs2-client –p /usr/local/sbin/pvfs2-client-core
(一定要先加裁 pvfs2.ko 的模塊,再啟動(dòng) pvfs2 client 程序)
加載 pvfs2 文件系統(tǒng)
mount –t pvfs2 tcp://node17:3334/pvfs2-fs /mnt/pvfs2
現(xiàn)在,我們就可以用系統(tǒng)命令來(lái)訪問(wèn) pvfs2 文件系統(tǒng)了:
test02:/tmp/pvfs2-1.3.0 # ls /mnt/pvfs2/
. .. lost+found
test02:/tmp/pvfs2-1.3.0 # cp /tmp/testfile /mnt/pvfs2/
test02:/tmp/pvfs2-1.3.0 # ll -h /mnt/pvfs2/
total 101M
drwxrwxrwx 2 root root 4.0K Oct 21 14:52 .
drwxr-xr-x 3 root root 72 Oct 20 17:08 ..
drwxrwxrwx 1 root root 4.0K Oct 21 2005 lost+found
-rw-r--r-- 1 root root 100M Oct 21 14:52 testfile
test02:/tmp/pvfs2-1.3.0 # rm /mnt/pvfs2/testfile
test02:/tmp/pvfs2-1.3.0 # ls /mnt/pvfs2/
. .. lost+found
注:
下載 PVFS2 的網(wǎng)址
http://www.pvfs.org/pvfs2/download.html
PVFS2 的 FAQ 以及 QuickGuide
http://www.pvfs.org/pvfs2/documentation.html
讓系統(tǒng)啟動(dòng)時(shí),pvfs2 server 做為一個(gè)服務(wù)自動(dòng)啟動(dòng):
把下面的文件拷貝到 /etc/init.d 目錄下,并且用 chmod 改為可執(zhí)行
聯(lián)系客服