Feed on
Subscription

Use FAM and IMON to realize data to duplicate below Linux



What in the article we will discuss is,How to cast costly SAN (Storage Area Network of network of the area that put store,Like GFS of global file system) or network piece equipment duplicates in data of the implementation below Linux.We used FAM in duplicate system (the file changes surveillant module) with IMON (module of information node surveillance) ,These two systems are SGI is what IRIX develops at the outset.

The stuff of SGI is really great Cool,It is they went to transplanting of these two programs on Linux and published source code.Should be being cost already was a problem no longer when,Can use be based on GFS (global file system) realize mirror of real time data with SAN;Otherwise,Data is shared reach other a lot of choices are indispensable.

A few methods can offer an alternative.In the article we will undertake discussion to these methods,The actor weakness that you will see they are respective.

Why should use duplicate replace share?

Assume file server is not offerred to client end share data?Yes,The working environment of hypothesis is really such.If we are in,used file server is those who pass NFS or software of SMB and so on share a file,Can exist in the system " bottleneck " and " the crucial drop that causes systematic trouble " .If the equipment putting store that share is carried on GFS (SAN or the SCSI of many passageway) share data,This kind of configuration not only price is high,And this kind puts lay aside case still can become " the crucial drop that causes systematic trouble " .Also can use NBD (network piece equipment) build mirror of a network,But this is not a kind of commonly used means,Some are short of NBD itself be restricted,It is hard to set government very much,If you just want to be in,data duplicates between server of a few a few WEB,Can bring more troubles to you only with NBD.

As far as possible simple

Good,We try to duplicate below.

Plan one:

Two WEB server gives priority to a server medium,Additionally one is backup server.The file on requirement backup server wants with advocate the maintenance on the server is identical.This is very simple.

But how to make its work automatically?The user gets FTP for many times to arrive everyday advocate data duplicates on the server.But when advocate server happening mistake, take-over by backup server what does the meeting when the system produce?Because this is planted,backup operation is not real time,The data affirmation in backup server and advocate the server is abhorrent,At this moment the administrator will be very angry.You can run to time of course guardianship program,5 seconds run every other " Delete Source Destination of - of Av of Rsync - " ,But make the negative charge that can raise a machine so,The movement that affects a system.

Plan two:

Server of a FTP is used save newer Web data,And means of cycle of use Dns of six Web server achieves laden balance,The data that can assure every server to go up so is identical.Such we can avoid to use NFS,But such solution not can satisfactory.

What is so best means of settlement?Should be " produce the ability when change to duplicate the file to each Web servers in data only " ,If the file did not produce change,also do not make with respect to what.This namely we are used " FAM " the job that will do.

Made intelligence works

So,How do we know the file sent change?The member that I think the Windows program of M$ is developed is met so say:We are OK a few seconds seek every other target catalog,Make among them file and the file that save in cache quite,Saw file time jab and size whether produce change.To,Right,Be such.

The working way that this is kind of poll,The time jab that its problem depends on searching and compares a file and size,Its cost is costly.You can imagine in the every other on WEB server 5 seconds move " LR /somedirectory of Ls - " the consequence that cause?

Best method should be:When the file is altered can somebody tells us,Such we can take corresponding action.This is " IMON " the work that should do.

What is FAM

FAM is module of file change surveillance,It offerred a group of API to applied process,When designation file or catalog produce change,To application by its the program issues an announcement.FAM is comprised by two parts:Tiring-room guards program FAM,It is in charge of receiving request and send an announcement;Library file LIBFAM,Client end applies a program to correspond with FAM with it.If long-range main engine opened the document that gets surveillance,The FAM of this locality can be contacted with the FAM of long-range main engine,Send the request long-range FAM.

The client that FAM also can inform it when a certain file begins or stopping to move is carried.(for instance:In IRIX mutual top of a table,If a program is moving so its icon can twinkle) .

FAM is in what wrote for IRIX 1989 by Bruce Karsh,Rescripted 1995 by Bob Miller.The FAM version compose of this open source code is built and move on Linux and IRIX,As identical as the FAM in IRIX6.5.8.

What is IMON?

IMON is module of information node surveillance,The one part that it is a kernel,Have when the file FAM is informed by it when changing.By application the program tells FAM to undertake monitoring to a certain catalog or file,FAM requests this to convey again IMON.When change be havinged by these surveillant files,The kernel informs IMON,Inform FAM by IMON again,The applied process that informs responsible surveillance of this file by FAM finally.

IMON is by what Wiltse Carpenter writes in the kernel that was IRIX 1989,Fall to Linux by Roger Chickering transplanting again.The IMON below the IMON kernel patch below Linux and IRIX is in a lot of respects are very similar,Just with kernel file system hang receive code to differ.

Install FAM and IMON

Can download FAM and IMON from the website of SGI,Material detailed information examines the resource list from the back please.IMON is patch of a kernel,The kernel passes node of information of its surveillance interior.The method that installs a patch is as follows:The source in the kernel runs patch program below file directory.





Pi of Cd/usr/src/linuxpathch -

? ? runs Config or Menuconfig next,In " file system chooses " this part chooses " Inode Monitor(IMON) Support (EXPERIMENTAL) " ,Compile a kernel to restart system.Compiling FAM itself is very simple,The source in FAM moves below file directory. / Configure and Make All Install with respect to success.

We will install SGI below: The Perl module that FAM calls,We can write incident to handle an order with Perl.

Install SGI: FAM Perl module

You won't want to come with C/C++ really process designing?The situation that I do not understand you,But I am very lazy,And my this individual also lacks patience,So I write duplicate government program with Perl.

Concerned download installs SGI: The problem of FAM can look for Jesse N.Glick(jglick@sig.bsh.com) to contact.Install these models fast very simple,Moving CPAN module:





- E Shellinstall SGI of MCPAN of Perl -: FAM

Installed SGI so: FAM and all must module.

With Fam_mirror implementation duplicates

Fam_mirror is me those who write use at the Script program that duplicates automatically.The particular case that should know Fam_mirror,You can be in Http: / / Www.linuxfocus.org/common/src/article199/fam_mirror.html goes examining,If want to download Fam_mirror,Ask Http://www.linuxfocus.org/common/src/article199/fam_mirror.You are OK re-edit this program,the Shell that instead of the leader with $replicaHosts current instead, $rsh uses currently,The order that also can implement $rsync instead same function.

We see the first plan below:

Two machines do WEB server (Web1,Web2) .Among them one gives priority to a server (like Web1) ,Another is from the server (Web2) .Server of the first FTP is Web1,FTP can move to serve far from on Web2 (otherwise,Systematic work may keep data to the middle of the file at backing up the user when means is returned) .

In two servers,Web documentation is put in / in Var/www catalog,In Rsh of the setting in two machines or Ssh,Make Web1 need not countersign can run telecommand on Web2.I am to those who fill the Ssh_key that adds me to realize this requirement is in in the Authorized_keys in duplicate lead plane normally.the data of Web1 long-range synchronism arrives the command on Web2 is:





Avz /var/wwwweb2:/var/www/ of Rsync -

Editor Fam_mirror file,@replicaHosts instead:





@replicaHosts=qw(web2)

Fam_mirror moves on Web1:





Fam_mirror /var/www %26amp;

Such,If the file on Web1 happened,change,In this kind of file that changes to also can be written to Web2.

Plan sees in light of us now 2:(there is server of much stage WEB in the system)

Lead plane Linuxweb1, Linuxweb2, Linuxweb3 and Linuxweb4 are Web server.Lead plane Linuxftp 1 is Ftp server (advocate server) .Web lead plane does not open FTP to serve to the user.

FAM and IMON, SGI installs on lead plane Linuxftp1: FAM and Fam_mirror.In Rsh of the buy on every lead plane or Ssh.Linuxftp1 need not countersign can be on four WEB server moving telecommand.

Editor Fam_mirror,@replicaHosts the setting is:





@replicaHosts=qw(linuxweb1 Linuxweb2 Linuxweb3 Linuxweb4) ;

If need also can alter $rsh and $rsync,Assume WEB text is put in each machines / below Var/www catalog.

Move on Linuxftp 1:INIT_MIRROR=1 Fam_mirror /var/www%26amp;

Such,Four WEB server can is opposite the file of the change on Linuxftp 1 undertakes updating.



Related:

    Submit: