refer: http://osterman.com/wordpress/2007/06/03/mogilefs-howto
June 3rd, 2007 <!-- by e -->
Check out the latest copy of the MogileFS source code (recommended)
svn checkout http://code.sixapart.com/svn/mogilefs
Install common prereqs
[download:prereqs.sh]
perl -MCPAN -e ‘install Danga::Socket’ perl -MCPAN -e ‘install Gearman::Client’ perl -MCPAN -e ‘install Gearman::Server’ perl -MCPAN -e ‘install Gearman::Client::Async’ perl -MCPAN -e ‘install Net::Netmask’ perl -MCPAN -e ‘install IO::WrapTie’ perl -MCPAN -e ‘install IO::AIO’ perl -MCPAN -e ‘install List::MoreUtils’ perl -MCPAN -e ‘install Path::Class’ perl -MCPAN -e ‘install Perlbal’
[/download]
Go ahead and install the servers
cd mogilefs/trunk/server perl Makefile.PL chmod 755 /usr/bin/mogilefsd adduser mogile mkdir /home/mogilefs
Install the client module
cd api/perl/MogileFS-Client perl Makefile.PL make install
Install the admin utility scripts
cd utils perl Makefile.PL make install
Create the MySQL database
mysqladmin create mogilefs
Setup the SQL Permissions
grant all on mogilefs.* TO ‘mogile’@'%’ identified by ’some-password’; flush privileges;
Load the schema
./mogdbsetup --dbhost=localhost --dbname=mogilefs --dbuser=mogile --dbpass=some-password
Create configurations
mkdir /etc/mogilefs
Add the following to /etc/mogilefs/mogilefsd.conf
db_dsn DBI:mysql:mogilefs:tracker.yourdomain.com db_user mogile db_pass some-password conf_port 7001 listener_jobs 5 old_repl_compat 0 lib /usr/lib/perl5/site_perl/5.8.8/
* you may need to change the lib path relative to your system
Create the storage server config in /etc/mogilefs/mogstored.conf
httplisten=0.0.0.0:7500 mgmtlisten=0.0.0.0:7501 docroot=/home/mogilefs/
Start the tracker
su mogile -c “mogilefsd -c /etc/mogilefs/mogilefsd.conf --daemon”
Start the storage server on all the servers that will be providing the role
su mogile -c “mogstored --daemon”
Configure your domains and replication patterns
mogadm domain add [domain] mogadm class add [domain] [className]
Tell the tracker about all the hosts and devices acting as a storage server (mogstored)
mogadm host add [hostname] mogadm device add [hostname] [devX]
Make the device directory (device names need to be GLOBALLY unique; thus dev1 can never exist anywhere else on any other mogstored server. The prefix must be dev, followed by an integer greater than 0)
mkdir /home/mogilefs/dev1