This article http://blog.csdn.net/jrckkyy/archive/2010/11/24/6032877.aspx has installed the necessary dependent software and configured environment variables
Now start to compile, install and simple operation. Here we use three chunkservers and one metaserver to run on the same machine.
/data/jrckkyy/kfs0.5 Start below the directory where kfs is unzipped
cd /data/jrckkyy/kfs0.5
mkdir build
cd build
// we first compile the debug version
mkdir debug
cmake ../../
make install // The compiled binary file will be automatically placed under /data/jrckkyy/kfs0.5/build/debug/bin at this time
// compile the release version
mkdir ../release;cd ../release;
cmake -D CMAKE_BUILD_TYPE=release ../../
make install // The compiled binary file will be automatically placed under /data/jrckkyy/kfs0.5/build/release/bin at this time
// Compile the release version with debugging information
mkdir ../reldbg;cd ../reldbg
cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo ../../
make install // The compiled binary file will be automatically placed under /data/jrckkyy/kfs0.5/build/reldbg/bin at this time
// We have compiled the binary files such as metaserver chunkserver tool commands and so on. We will install three chunkservers and one metaserver on one machine here.
cd /data/jrckkyy/kfs0.5/script/
vi machines_local.cfg // Create configuration file
# KFS Machine configuration file
#
# The following configuration is a single node KFS setup. There is
# one meta server and 2 chunk servers. The chunk servers are exporting
# 30,000,000 bytes or 30 G apiece. Note the unique values for the baseport, rundir.
#
[metaserver]
node: localhost
rundir: /data/metaserverrundir
baseport: 20000
clusterkey: test-cluster
[chunkserver1]
node: localhost
rundir: /data/chunkserver1rundir
baseport: 30000
space: 30 G
[chunkserver2]
node: localhost
rundir: /data/chunkserver2rundir
baseport: 40000
space: 30000 M
[chunkserver3]
node: localhost
rundir: /data/chunkserver3rundir
baseport: 50000
space: 30000000000
// Install the metaserver chunkserver tool program shell, etc. to the target machine. Here, up to 25 threads are used to install 25 nodes concurrently. If it is already installed, it will be automatically ignored
python kfssetup.py -f machines_local.cfg -b ../build -w ../webui/ -s 0
// Start all the machines in the configuration file just now, if they are already started, they will be ignored automatically
python kfslaunch.py -f machines_local.cfg --start // Of course --stop is to stop
// Use the built-in ping command to view the current metaserver is connected to the control machine information
../build/bin/tools/kfsping -m -s localhost -p 20000
Up servers: 3
s=202.106.199.36, p=40000, rack=0, used=0(GB), free=29.2969(GB), util=0%, nblocks=0, lastheard=8 (sec), ncorrupt=0, nchunksToMove=0, numDrives=1
s=202.106.199.37, p=30000, rack=0, used=0(GB), free=30(GB), util=0%, nblocks=0, lastheard=21 (sec), ncorrupt=0, nchunksToMove=0, numDrives=1
s=202.106.199.36, p=50000, rack=0, used=0(GB), free=27.9397(GB), util=0%, nblocks=0, lastheard=5 (sec), ncorrupt=0, nchunksToMove=0, numDrives=1
// Log in to metaserver to execute shell commands, you can execute some simple shell commands, rm, rmdir, mv, stat, pwd, etc., changeReplication is used to change the number of backups of a file
python kfsshell.py -f machines_local.cfg -b ../build/release/bin/
KfsShell>
Unknown cmd:
Supported cmds are:
cd
changeReplication
cp
ls
mkdir
mv
rm
rmdir
stat
pwd
append
Type <cmd name> --help for command specific help
KfsShell>