Distributed File System MogileFS installation steps

Source: Internet
Author: User

My environment here is the RHEL 5 environment.

Both the MySQL database and the tracker are placed on a single server for 192.168.2.85

Storage server two units, respectively, 192.168.2.98 192.168.2.222

First: Install the Mysql database

MySQL installation please download the RPM installation package is the most convenient, download source installation is also very simple. I am here to install using RPM package.

After the installation is complete, use the command service MySQL start

After startup, use the MySQL client to enter Mysql-uroot-p, then enter the default null password, then enter into the MySQL console.

We've changed the MySQL access code to 111111.

The Modify command is:

Use MySQL;

Update user set Password=password (' 111111 ') where user= ' root ';

Quit

Then restart the MySQL.

Service MySQL Stop

Service MySQL Start

Second: Install dependent packages

Execute command: PERL-MCPAN-E Shell into Perl dependent package installation mode

Install Danga::socket
Install DBI
Install Net::netmask
Install Gearman::server
Install Gearman::client::async
Install Io::aio
Install Perlbal

Install Mysql

Install Mogilefs::server

Install Mogilefs::client
Install Mogilefs::utils

The above dependent packages are all installed and exited.

Locate the directory where the DBD module is located, and my directory is/root/.cpan/build/, which is a variety of dependent packages that were downloaded during the installation.

CD dbd-mysql-3.0008

Perl makefile.pl--libs= "-l/usr/lib64/mysql-lmysqlclient-l/usr/lib64-lz"--cflags=-i/usr/include/mysql--mysql_ Config=/usr/bin/mysql_config--testhost=127.0.0.1--testdb=test--testuser=root--testpassword=111111

Make

Make Test

Make install

Third: Database creation and table creation

Go to MySQL console mysql-uroot-p111111 and execute the following command

# MySQL

mysql> CREATE DATABASE mogilefs;
Mysql> GRANT all on mogilefs.* to ' Mogile ';
mysql> SET PASSWORD for ' mogile ' @ '% ' = old_password (' 111111 ');
mysql> FLUSH privileges;
Mysql> quit

Then execute the following command to create the table

Mogdbsetup--dbhost=127.0.0.1--dbname=mogilefs--dbuser=root--dbpassword=111111--yes--verbose

IV: Configuring the Tracker configuration file

Execute with Root user

AddUser Mogile

Mkdir/etc/mogilefs

[Plain]View PlainCopy
  1. <span style= "FONT-SIZE:18PX;" >[[email protected] mogilefs]# vi/etc/mogilefs/mogilefsd.conf
  2. # Enable Daemon mode to work on background and use syslog
  3. Daemonize = 0
  4. # Where to store the PID of the daemon (must is the same in the Init script)
  5. Pidfile =/var/run/mogilefsd/mogilefsd.pid
  6. # Database Connection Information
  7. DB_DSN = dbi:mysql:mogilefs:host=127.0.0.1
  8. Db_user = root
  9. Db_pass = 111111
  10. # Ip:port to listen in for mogilefs client requests
  11. Listen = 192.168.2.85:7001
  12. # Optional, if you don ' t define the port above.
  13. Conf_port = 7001
  14. # Number of query workers to start by default.
  15. Query_jobs = 10
  16. # Number of delete workers to start by default.
  17. Delete_jobs = 1
  18. # Number of replicate workers to start by default.
  19. Replicate_jobs = 5
  20. # Number of Reaper workers to start by default.
  21. # (you don ' t usually need to increase this)
  22. Reaper_jobs = 1
  23. # Number of fsck workers to start by default.
  24. # (These can cause a lot of load when fsck ' ing)
  25. #fsck_jobs = 1
  26. # Minimum amount of space to reserve in megabytes
  27. # default:100
  28. # consider setting the larger than the largest file you
  29. # would normally be uploading.
  30. #min_free_space = 200
  31. # Number of seconds to wait for a storage node to respond.
  32. # Default:2
  33. # Keep This low, so busy storage nodes is quickly ignored.
  34. #node_timeout = 2
  35. # Number of seconds to wait for connect to a storage node.
  36. # Default:2
  37. # Keep The overloaded nodes get skipped.
  38. #conn_timeout = 2
  39. # Allow replication to use the secondary node get port,
  40. # If you had Apache or similar configured for GET ' s
  41. #repl_use_get_port = 1</span>



Execute the following command to start

Su Mogile

[Email protected] mogilefsd]$ mogilefsd-c/etc/mogilefs/mogilefsd.conf--daemon
[[email protected] mogilefsd]$ Ps-aux|grep MOGILEFSD to see if it started MOGILEFSD success

V: Configure configuration files for storage server

AddUser Mogile
Mkdir/var/mogdata
MKDIR/VAR/MOGDATA/DEV1 (second directory is/var/mogdata/dev2)
Chown Mogile:mogile/var/mogdata/dev1
Mkdir/etc/mogilefs

[HTML]View PlainCopy
    1. <span style=>[[email protected] mogilefs]# vi /etc/mogilefs/mogstored.conf    
    2.   
    3. maxconns = 10000&NBSP;&NBSP;
    4. httplisten = 0.0.0.0:7500  
    5. mgmtlisten =  0.0.0.0:7501&NBSP;&NBSP;
    6. DOCROOT&NBSP;=&NBSP;/VAR/MOGDATA&NBSP;&NBSP;
    7. </span>&NBSP;&NBSP;


Execute the following command to start

Find the directory where mogilefs-server-2.51 is located, mine is/root/.cpan/build/

CD mogilefs-server-2.51

Perl makefile.pl

Make

Make Test

Make install

Then start storage server

[Email protected] mogilefs-server-2.51]# mogstored--daemon
[Email protected] mogilefs-server-2.51]# Ps-aux|grep mogstored

Sixth: Add storage server to tracker server for logging

Switch to Tracker server 192.168.2.85

Execute the following command

Mogadm--trackers=192.168.2.85:7001 Host Add mogilestorage1--ip=192.168.2.98--port=7500--status=alive

Mogadm--trackers=192.168.2.85:7001 Host Add mogilestorage2--ip=192.168.2.222--port=7500--status=alive

Once added, use the following command to check the added results

Mogadm--trackers=192.168.2.85:7001 Host List

Down to add a hard drive device for tracker server to manage

Mogadm--trackers=192.168.2.85:7001 Device Add mogilestorage1 1

Mogadm--trackers=192.168.2.85:7001 Device Add Mogilestorage2 2

Execute the following command to view the added results

Mogadm--trackers=192.168.2.85:7001 Device List

You can also perform the following command to view detailed hard disk data

Mogadm--trackers=192.168.2.85:7001 Check

The command to add a test domain is as follows

Mogadm--trackers=192.168.2.85:7001 Domain Add TestDomain

Mogadm--trackers=192.168.2.85:7001 class Add TestDomain Normal

The MogileFS file system is provided to the client in the form of an API, and you need to integrate the API with your own code.

There are third-party encapsulated PHP, Java, Ruby, Perl.

I'm going to use Perl + fuse, but the Perl fuse module doesn't compile, and it's dead.

You have encountered such an error:

fuse.xs:43:error:expected specifier-qualifier-list before ' tthx '

http://blog.csdn.net/langeldep/article/details/6637517

Distributed File System MogileFS installation steps

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.