Mogilefs distributed storage-Installation notes

Source: Internet
Author: User
Tags to domain

The environment is centos.

Er, it took a long time to install a plug-in because it had taken a lot of detours and thought it was dependent on too many baowhe modules.

Later I found that the installation can be simplified. Yum does not have mogilefs and can be installed through epel.

First, use 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-backend-perlbal mogstored-backend-Lighttpd mogstored-backend-Apache Perl-mogilefs-client Perl-mogilefs-utils

If AIO cannot be found after an error is reported, you need to install AIO again.

# CPAN

# CPAN> install IO: AIO

______________________________________________________________

The second installation method, using CPAN

# 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 method of installing dependent packages one by one:

This method is annoying, so I don't want to talk about it anymore. It's all tears. '''my hands have crated.

______________________________________________________________

The configuration is as follows:

After figuring out the principle, it is quite easy to configure.

Step 1: Initialize the database
# Mogdbsetup -- dbhost = 127.0.0.1 -- dbname = mogilefs -- dbuser = mogilefs -- dbpass = jongin

Step 2: Create a tracker configuration file
# Vim/etc/mogilefsd. conf
Db_dsn DBI: mysql: mogilefs: 127.0.0.1
Db_user mogilefs
Db_pass jongin
Conf_port 6001
Listener_jobs 5

Step 3: Start trackers.

# Adduser mogile
# Su mogile
# Mogilefsd-C/etc/mogilefsd. conf -- daemon

Step 4: Initialize the 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 for effectiveness:
# Mogadm -- Lib =/usr/lib/perl5/5.8.8 -- trackers = 222.191.251.xx: 6001 host list
Add devices to storage server
# Mogadm-Lib =/usr/lib/perl5/5.8.8-trackers = 222.191.251.xx: 6001 device add mogilestorage 1
Check for effectiveness:
# Mogadm -- Lib =/usr/lib/perl5/5.8.8 -- trackers = 222.191.251.xx: 6001 Device List

Step 5: Create a storage configuration file
# Vim
/Etc/mogstored. conf

Httplisten = 0.0.0.0: 7500
Mgmtlisten = 0.0.0.0: 7501
Docroot =/DATa/mdata

Create a storage directory-> mkdir-P/DATa/mdata/dev1

Step 6: Run mogilefs

# Mogstored-C/etc/mogstored. conf -- daemon

Check whether all your services are available
# Ps-Ef | grep mogilefsd
# Ps-Ef | grep mogstored

Part 7: Test and 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 test files
<? PHP

$ Client-> connect ('19191.251.xxx, 222, '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 ['pattern']);
Echo $ content;

?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.