mogilefs 安装

####################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 ###########


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值