mogileFS Distributed Storage - Installation Notes

  

Environment is centos

呃, I have taken a lot of detours and thought that I have relied on too many Baohe modules for a long time.

Later found that the installation can be simplified, yum no mogilefs, can be installed by epel.

The first installation method, using epel


# rpm -Uvh http: //download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm

# yum -y install mogilefsd perl-MogileFS-Client perl-MogileFS- Utils

# yum -y install mogstored mogstored-backend-perlbal mogstored-backend-lighttpd mogstored-backend-apache perl-MogileFS-Client perl-MogileFS-Utils

If you can't find the error AIO needs to be supplemented with AIO

#cpan

#cpan> install IO::AIO

______________________________________________________________

Second reinstallation method, using cpan< Br>

# cpan # cpan> install IO::AIO # cpan> install DBI # cpan> install DBD::mysql # cpan> install MogileFS::Server install Gearman::Client Install Gearman::Server install Sys::Syscall install Perlbal install Net::Netmask install Danga::Socket install Gearman::Client::Async # cpan> install MogileFS::Utils install MogileFS::Client

______________________________________________________________

The third method is the traditional one-by-one package installation method:

This method is more annoying, so I won’t say it, it’s all tears. All cramped

______________________________________________________________

The following is the configuration:

It is quite easy to configure the principle.

First step, initialization Database # mogdbsetup --dbhost=127.0.0.1 --dbname=mogilefs --dbuser=mogilefs --dbpass=jongin Step 2, create a new tracker configuration file # vim /etc/mogilefsd.conf db_dsn DBI:mysql:mogilefs:127.0. 0.1db_user mogilefsdb_pass jonginconf_port 6001listener_jobs 5

Step 3, start trackers.

# adduser mogile# su mogile# mogilefsd -c /Etc/mogilefsd.conf --daemon

Step 4, initializing storage server data

# mogadm --lib=/usr/lib/perl5/5.8.8 --trackers=222.191. 251.xx:6001 host add mogilestorage --ip=222.191.251.xx--port=7500 --status=alive check to see if it works: # mogadm --lib=/usr/lib/perl5/5.8.8 --trackers =222.191.251.xx:6001 host list add device to storage server# mogadm -lib=/usr/lib/perl5/5.8.8 -trackers=222.191.251.xx:6001 device add mogilestorage 1Check if it works: # mogadm --lib=/usr/lib/perl5/5.8.8 --trackers=222.191.251.xx:6001 device list

Step 5, create a new Storage configuration file # vim /etc/mogstored.conf< Br>

httplisten=0.0.0.0:7500 mgmtlisten=0.0.0.0:7501 docroot=/data/mdata

Create Storage Directory-> mkdir -p /data /mdata/dev1

Step 6, run MogileFS

# mogstored -c /etc/mogstored.conf --daemon

View all your services are up # Ps -ef |  Grep mogilefsd# ps -ef |  Grep mogstored

Part 7, test run

Generate domain# mogadm --lib=/usr/lib/perl5/5.8.8 --trackers=222.191.251.xx:6001 domain Add icv.cn add a class to domain# mogadm --lib=/usr/lib/perl5/5.8.8 --trackers=222.191.251.xx:6001 class add icv.cn type1

1. Install the php-mogileFS extension reference, http://projects.usrportage.de/index.fcgi/php-mogilefs

2. Write the test file <?php

$client-> Connect('222.191.251.xxx, 6001, 'jongin.com');

$client->put('http://www.baidu.com/img/logo-yy.gif' , 'myFile', 'type1');$metadata = $client->get('myFile');print_r($metadata);$content = file_get_contents($metadata['path1']);echo $content;< Br>

?>

Copyright © Windows knowledge All Rights Reserved