2010年12月6日月曜日

Cloudstore on CentOS5.3

== CloudStore on CentOS5.3
|
      -----------------------------------------
      |              |           |            |
 192.168.0.1   192.168.0.2  192.168.0.3  192.168.0.4
[Mata Server]    [Chunk]      [Chunk]      [Chunk]

== Install Package on All server

> yum -y install gcc gcc-++ zlib-devel e2fsprogs-devel openssl-devel xfsprogs-devel boost boost-devel
> yum -y groupinstall "Java" "Java Development"

> rpm -ivh http://dag.wieers.com/rpm/packages/log4cpp/log4cpp-0.3.5-0.rc3.el5.rf.x86_64.rpm
> rpm -ivh http://dag.wieers.com/rpm/packages/log4cpp/log4cpp-devel-0.3.5-0.rc3.el5.rf.x86_64.rpm
> rpm -ivh http://dl.atrpms.net/all/cmake-2.6.4-7.el5.x86_64.rpm

> wget http://downloads.sourceforge.net/project/kosmosfs/kosmosfs/kfs-0.3/kfs-0.3.tar.gz

> mkdir /home/kfs
> tar xzf kfs-0.3.tar.gz
> cd kfs-0.3
> mkdir build
> cd build
> cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/home/kfs/cloudstore ../
> gmake
> gmake install

> vi /etc/hosts
192.168.0.1 kfs1
192.168.0.2 kfs2
192.168.0.3 kfs3
192.168.0.4 kfs4

== On meta server

=Send public key to other server
> ssh-keygen -t rsa
> scp /root/.ssh/id_rsa.pub kfs1:/root/.ssh/authorized_keys
> scp /root/.ssh/id_rsa.pub kfs2:/root/.ssh/authorized_keys
> scp /root/.ssh/id_rsa.pub kfs3:/root/.ssh/authorized_keys
> scp /root/.ssh/id_rsa.pub kfs4:/root/.ssh/authorized_keys

=COnfiguration
> vi /root/work/kfs-0.3/script/smachines.cfg
# KFS Machine configuration file
[metaserver]
node: kfs1
clusterkey: kfs-test-cluster
rundir: /home/kfs/meta
baseport: 20000
loglevel: INFO
numservers: 2

[chunkserver_defaults]
rundir: /home/kfs/chunk
chunkDir: /home/kfs/chunk/bin/kfschunk
baseport: 30000
space: 5 G
loglevel: INFO

= Configure for Chunk Server's info
> /root/work/kfs-0.3/scripts/machines.txt
kfs2
kfs3
kfs4

> cp machines.txt ../webui/all-machines.txt

= Distribute setting file to other server
> python kfssetup.py -f machines.cfg -m machines.txt -b /home/kfs/cloudstore -w ../webui

= Start all of service from Meta Server
> cd /home/kfs/meta/scripts/
> python kfslaunch.py -f machines.cfg -m machines.txt -s

= Check the status
> /home/kfs/cloudstore/bin/tools/kfsping -m -s kfs1 -p 20000

= Stop Service
> python kfslaunch.py -f machines.cfg -m machines.txt -S

= Put Data
> echo "jun" > /root/test/jun.txt
> /home/kfs/cloudstore/bin/tools/cptokfs -s kfs1 -p 20000 -d /root/test/jun.txt -k jun.txt

= Check
> /home/kfs/cloudstore/bin/tools/kfsshell -s kfs1 -p 20000
KfsShell> ls -al
dumpster/ Aug 24 07:57 (dir)
jun.txt Aug 24 08:57 4

= Read Data
> cd /tmp
> /home/kfs/cloudstore/bin/tools/cpfromkfs -s kfs1 -p 20000 -d ./jun.txt -k jun.txt
> cat jun.txt
jun

= Confirm chunk data
> /home/kfs/cloudstore/bin/tools/kfsfileenum -s kfs1 -p 20000 -f jun.txt
0 6
216.69.70.84 30000 4
216.69.70.82 30000 4
216.69.70.83 30000 4
File size computed from chunksizes: 4


=Mount Cloudstore as FUSE

> /etc/yum.repos.d/CentOS-Base.repo

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://ftp.riken.jp/Linux/dag/redhat/el$releasever/en/$basearch/dag

> wget http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
> rpm --import RPM-GPG-KEY.dag.txt
> yum -y install fuse

> vi /root/work/kfs-0.3/CMakeLists.txt
SET(Fuse_LIBRARY_DIR "/usr/lib64")
SET(Fuse_INCLUDE_DIR "/usr/include")

> cd /root/work/kfs-0.3/build
> make install

> vi /home/kfs/cloudstore/bin/kfs.prp
metaServer.name = kfs1
metaServer.port = 20000

> mkdir /tmp/kfs-fuse
> cd /home/kfs/cloudstore/bin/
> ./kfs_fuse /tmp/kfs-fuse -f &
> cd /tmp/kfs-fuse
> echo "jun2" > jun2.txt
> cat jun2.txt
jun2

ラベル:


コメント:

コメントを投稿

登録 コメントの投稿 [Atom]





<< ホーム

This page is powered by Blogger. Isn't yours?

登録 投稿 [Atom]