####################1st step: install mysql ######################
$ sudo apt-get install mysql-server //ubuntu 可以到 software center 安装mysql-server
#trouble shooting: about mysql's remoting access
#see http://blog.csdn.net/guanfu_jiang/article/details/7208794
###########################2nd step: install mofilefs command ############
#you should note the cpan's source url list , if cann't download data , change the source url
#use command: cpan> o conf init
$ sudo cpan
$ cpan> install IO::AIO
$ cpan> install DBI
$ cpan> install DBD::mysql
$ cpan> install MogileFS::Server
$ cpan> install Gearman::Client
$ cpan> install Gearman::Server
$ cpan> install Sys::Syscall
$ cpan> install Perlbal
$ cpan> install Net::Netmask
$ cpan> install Danga::Socket
$ cpan> install Gearman::Client::Async
$ cpan> install MogileFS::Utils
$ cpan> install MogileFS::Client
###########################3rd step: install mofilefs database command ############
$ mogdbsetup --dbhost=127.0.0.1 --dbname=mogilefs --dbuser=mogile --dbpass=mogile
#confirm: access mysql , check database & tables, if there are some tables like 'domain','class','file','class' etc.
$sudo mysql -umogile -pmogile
mysql> use mogilefs;
mysql> show tables;
###########################4th step: confugure mofilefs tracker command ############
$ vim /etc/mogilefs/mogilefsd.conf
db_dsn = DBI:mysql:mogilefs:host=127.0.0.1;port=3306;mysql_connect_timeout=5
db_user = mogile
db_pass = mogile
conf_port = 7001
listener_jobs = 5
node_timeout = 5
rebalance_ignore_missing = 1
###########################5th step: start mofilefs tracker command ###############
$ adduser mogilefs
$ su mogilefs
$ mogilefsd -c /etc/mogilefs/mogilefsd.conf --daemon
###########################6th step: intial mofilefs storage command ###############
#add storage
$ mogadm --lib=/usr/lib/perl5/5.12.4 --trackers=127.0.0.1:7001 host add mogilestorage --ip=127.0.0.1 --port=7500 --status=alive
#confirm:
$ mogadm --lib=/usr/lib/perl5/5.12.4 --trackers=127.0.0.1:7001 host list
#add device
$ mogadm --lib=/usr/lib/perl5/5.12.4 --trackers=127.0.0.1:7001 device add mogilestorage 1
#confirm:
$ mogadm --lib=/usr/lib/perl5/5.12.4 --trackers=127.0.0.1:7001 device list
##########################7th step: configure mofilefs storage command #############
$ vim /etc/mogstored.conf
httplisten=0.0.0.0:7500
mgmtlisten=0.0.0.0:7501
docroot=/home/mogilefs/store
$mkdir -p /home/mogilefs/store/dev1
##########################8th step: run mofilefs command ################
$ mogstored -c /etc/mogilefs/mogstored.conf --daemon
#confirm:
$ ps -ef | grep mogilefsd
$ ps -ef | grep mogstored
##########################9th step: test mofilefs command ####################
#add domain
$ mogadm --lib=/usr/lib/perl5/5.12.4 --trackers=127.0.0.1:7001 domain add testdomain
#add class to above domain
$ mogadm --lib=/usr/lib/perl5/5.12.4 --trackers=127.0.0.1:7001 class add testdomain testclass
##########################10th step: use mofilefs client api to access mogilefs ###########