Get the App
SLTechnology News&Howtos  ›  Servers  › 

Linux uses MogileFS distributed file system and uses nginx to implement reverse proxy

Shulou Source: shulou.com Published: 2022-06-03 08:36:05 10月26日 Update

MogileFS is a set of efficient automatic file backup components developed by Six Apart and widely used in web2.0 sites including LiveJournal.

Features of MogileFS:

Work in the application layer, no single point, automatic file replication (the smallest unit of replication is class, not files), transfer neutral and transfer using nfs or http protocols.

The structure of MogileFS is as follows:

Tracker: is the core of mogilefs, is a scheduler, through the database to save meta-information, including daemon,class,host and other information, the main responsibilities: monitoring back-end mogstore nodes, and instructing store nodes to complete data addition, deletion, query, and replication between nodes.

Mogstore: the storage location of the actual data, usually a pseudo-http server.

Database: used to save the global information of a node.

1. Install MogileFS

a. Download MogileFS

MogileFS-Server: https://github.com/mogilefs/MogileFS-Server

MogileFS-Utils: https://github.com/mogilefs/MogileFS-Utils

Perl-MogileFS-Client: https://github.com/mogilefs/perl-MogileFS-Client

b. Installation:

Extract the file and enter it into the file

[root@clone3 nginx-1.11.12] # make Makefile.PL

[root@clone3 nginx-1.11.12] # make & & make install

[root@clone3 nginx-1.11.12] # yum install perl-IO-AIO123123

two。 Configuration file explanation

Parameter answer: total dosage 8

3. Start and test

1. Create the / var/run/mogilefsd directory and modify the group owner

[root@Master mogilefs] # mkdir-p / var/run/mogilefsd

[root@Master mogilefs] # chown-R mogilefs.mogilefs / var/run/mogilefsd/

two。 Create the / mog/mogdata directory and modify the group owner

[root@Master mogilefs] # mkdir-p / mog/mogdata

[root@Master mogilefs] # chown-R mogilefs.mogilefs / mog/mogdata/

3. Start the mogilefsd process and the mogstored process

[root@Master mogilefs] # service mogilefsd start

Starting mogilefsd

[root@Master mogilefs] # service mogstored start

Starting mogstored

* * the startup script here is installed using the rpm package and comes with it. Generally, there is no service script installed using make * *

4. Configure mogstord node hosts using administrative tools

* * actual access location of files * *

5. Access using a browser

Such a mogilefs distributed storage is set up, but the mogilefsd process and the mogstored process are on the unified host.

6. Load balancing design structure

7. Use nginx real, now reverse proxy

When using nginx reverse proxy mogilefs, you need to use a third-party module to enable the implementation of the proxy. Nginx does not support the proxy of mogilefs. Download the module as nginx_mogilefs_module, download address: http://www.grid.net.ru/nginx/download/nginx_mogilefs_module-1.0.4.tar.gz

* * for more information, please refer to the official document: http://www.grid.net.ru/nginx/mogilefs.en.html**

8. Configure two mogilefs host

When configuring two hosts, the mogilefsd process will read the information of the mogstord node in the database, which can only be configured according to the above description. It is recommended to configure on one mogilefsd node and the other node can read it in the database.

9. Test result

Tags: Nodes files configurations data processes agents hosts information databases locations parameters actual modules directories structures scripts transfer storage applications services Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple vpn Xiaomi MariaDB Linux