⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 intro

📁 一套客户/服务器模式的备份系统代码,跨平台,支持linux,AIX, IRIX, FreeBSD, Digital Unix (OSF1), Solaris and HP-UX.
💻
📖 第 1 页 / 共 2 页
字号:
          Introduction to AF's Backup system          ==================================This file gives a short introduction into AF's backup system,it's architecture (wow !), the ideas behind it and how it canbe used to serve the individual needs.Client-Server-------------It's a client-server system. The server is a machine that hasaccess to some kind of storage media, usually a tape drive.This server side knows how to handle this device, how manycartridges are in use and what to do when a cartridge gets fullor other special cases occur. What the server side does notknow is anything that has to do with directory structures, files,attributes of the stored files or even their names. This is allhandled on the client side. The server only knows data streams.The client demands from the server the functionality to pass itthe next bunch of data from the tape, to write a packet to tape,to put in a certain cartridge and the server performs the actionswhich it can can. The client knows how to pack and unpack thefiles and directories and on which cartridges and files they arewritten and can be found. For this purpose it maintains filelists containing the names of all stored filesystem entries in alocal directory. These filelists are not saved to the backupunless explicitly configured. Compression is done on the clientside to reduce network traffic and to achieve more safety.If the packed stream had been compressed, a single wrong bit inthe stream would make the whole rest of the backup useless. Thusthe files are compressed individually on the client side.Server''''''Server IdentificationAn afbackup server is addressed using one of it's hostnames anda port number. Two services can be configured for each afbackupserver: a single stream and a multi stream server, each servingon a separate port. It's up to the client, which service it willuse. The multi stream server can handle requests from severalclients in parallel (only for saving, not for restore), thusmultiplexing the data stream. This multiplexing requires someoverhead, so the performance of the multi stream service can beexpected worse than the single stream service. For full backupsthe single stream server might be preferred, but for incrementalbackups, where a client is spending most of the time searchingfor modified filesystem entries, the multi stream server mightbe the service to choose. Then the possibly several clients canscan their disks in parallel, sending the data to backup to theserver as it is found.Because the two servers are using the same (sets of) tapes, anadditional identifier is introduced to enable clients to figureout, that they are speaking to the same server through differentservices/ports. This together with the strongly recommended useof a host alias to address the server(s), makes for being ableto move the backup service from one machine to another. Changethe host alias to the other machine, connect the storage mediato it, move over the afbackup installation and that's it. Ofcourse the clients must see, that the host alias has changed,so a working name service is necessary.Storage DevicesAny kind of streamer can be used with this backup system. Theonly restriction is that it must have a block- or character-device entry in the /dev-directory. The blocksize of the devicemust be set correctly in the server-side configuration.Besides streamers data can also be saved to filesystems.The configuration to do this is a little special andcan be taken from Question 3 of the HOWTO.FAQ.DO-DONT.With streamers several tape cartridges can and should be used.There are two basic cases: Either you have a robot or you do not.If you do not have a robot, you must change the cartridges manually.The server supplies you with e-mail, whenever another cartridgeshould be put into the drive. Having done this, a specialcommand (cartready) must be run on the server to let it know,that it can continue now.If you have a robot, but no special software (commands) to tellit which cartridge to insert into the drive, you must set therobot to sequential mode. That is, the robot puts the next tapeinto the drive once the current one is ejected. Such a mode isusually supported in which case the server ejects the cartridgesout of the drive until the right tape is found.If you have commands to set the cartridge directly, you canconfigure them in the configuration file.CartridgesThe cartridges are identified by numbers beginning with 1. Oncethey are in use, they automatically get a magnetic label thatthey keep until overwritten with a special command (label_tape).It is a good idea also to use adhesive labels and to write thenumbers onto the tapes, so they can't be mixed up. The serverrecognizes if there is a tape in the drive that has the wronglabel. What happens then depends on the cases mentioned above.If you have no robot, you get another email, that points youto the problem. If you have a robot in sequential mode, theserver tries all cartridges it has and attempts to find the rightone. If it finds a tape with the right label, this is used. If itdoes not, it stops and writes errors to the serverside error logfile.If you have a robot and commands to set the cartridge, and therobot inserts the wrong one, this is considered a severe problemand the server stops, again writing errors to it's error log. Itthen sends an email then waits for a maintainer to solve the problemand to allow the server to continue by issuing a command.Once all tapes of a set (for cartridge sets see the next section)have been used up, the server tries to start over with the firstof the set, overwriting it. The server tracks what tapes areneeded for clients to restore all their data. When full, thesetapes are not overwritten until explicitly permitted or the dataon them is no longer in any index file on a client. Tapes can beset to read-only state. The server will never write to tapes inthis mode, not even in the variable append operating mode. Invariable append mode, any tape of the correct cartridge set canbe supplied to the streamer device and it will be accepted forwriting. If the data on that tape is still needed by clients, thenext data will be appended to the area on tape already written,otherwise the tape will be overwritten. If not in variable appendmode, the next writing position commences from where writing stoppedbefore. This can be overridden using the cartis command or theclient-side option -G.More cartridges than the robot can juggle can be used. For thiscase see the HOWTO.FAQ.DO-DONT Q6.Cartridge SetsYou can devide your cartridges into sets for several purposes.A set comprises of several cartridges, e.g. the cartridgesnumber 1-3. There may be cartridges, that are not in any setand a cartridge must not be in more than one set. This wouldbe a configuration error. Nonetheless if you have a robot, youmust tell the backup system the number of cartridges, the robotis handling. The configuration parameter is named Cartridge-Sets.If you do not configure sets of cartridges, all of the availablecartridges will be used as the one and only existing set. Whichset to use, can be configured in the client side configurationfile or overriding this setting by using commandline options(-S). Client access to tapes is handled on a per-set basis.Restrictions can be configured evaluating the client's officialhost name. If the server is unable to determine the client'shostname, access is denied, if a restriction is configured. Ifno restriction is configured, access is granted for any client.Clients must authenticate to operate a server, so this defaultbehaviour is not to be considered a security issue. Attempts ofanswers to the question, why to use sets, can be found in theHOWTO.FAQ.DO-DONT Q4.Storage unitsThis is a term used for the combination of a backup server'shostname, the port number to connect and a valid cartridge setnumber on this server. Several storage units can be configuredon each client. When starting a backup, the client-side firstchecks the servers for availability one after the other andstarts the backup to the first available one found. Running arestore the user or administrator does not have to remember,to which storage unit the backup went. This is all handledtransparently.For each of the three client-side configuration parameters(server hostname, port number and cartridge set) severalentries are now allowed. They are associated by position.For further information, see the HOWTO.FAQ.DO-DONT HOWTO Q9.Read and WriteThe read position can be requested by clients without anyrestriction assuming the client is granted access to the tapein question. With the write position it is different. By defaultthe server continues to write at the position where the mostrecent write operation ended. This postition handling is maintainedindividually for each cartridge set. For each set the writingposition is stored. Writing position means not only the cartridgeused before, but also the number of the file on tape. Thusanother tape is not started for each and every backup. The defaultbehaviour can be changed to variable append mode. In this modeany tape in the right cartridge set with remaining space and notin read-only state can be supplied to the streamer device and beaccepted for writing. If the tape is containing data needed byclients for restore, the next data is appended, otherwise thetape is reused and completely overwritten.The data stream is written to the tape in pieces (tape files) ofa configurable maximum size. This is done to find the positionfaster, where certain data has been stored. The client knows forevery file, on which cartridge the file is and in which tape fileit can be found. Thus a restore of certain requested files is muchfaster than starting only one file for each backup, in the worstcase using up a whole cartridge.LockingThe server process generates a lockfile when starting to preventseveral server processes to access the same tape drive. Nonethelessif several processes start, the one started later waits a confi-gurable time for the device to become available sending emailafter configurable intervals. Another lock is set for access toan autochanger if used.Client''''''Full and Incremental Backup, Backup LevelsA full backup means, that everything requested is stored on theserver. An incremental backup stores only these files and direc-tories, that have changed or are newer than the start of theprevious full or incremental backup. For determining what haschanged, the mtime in the inode is used by default. Additionallyit is possible to configure, that also the inode change time(ctime) is evaluated. Why this might be done can be read fromthe HOWTO.FAQ.DO-DONT, Q2.Problems may arise if mechanisms are used that create files anddirectories while resetting the mtime to an earlier date and time(e.g. using tar -x or cpio -i). In these cases files are not savedduring the next incremental backup.If a backup level is supplied, when running incr_backup, theneverything is stored that has changed since the most recentrun with a higher or equal level. Note, that other backup systemsdefine levels the other way round: the lower the level number,the more is written to backup.The full backup can be divided into several parts. This is useful,for example, if the duration for backing up everything is toolong for the intended time frame. If the full backup should runduring the weekend, but the about 60 hours from friday eveningto monday morning are not sufficient, this is a case for severalparts. These can be configured by listing the files and directoriesfor each part in different client-side configuration parameters.Before the parameter NumBackupParts must be set appropriately.Packing and UnpackingThe client packs the files and directories and sends them to theserver or receives a data stream from the server and unpacks it.If compression is requested, a configurable compression programcan be used to process each packed file individually. The name ofthe appropriate uncompress-program is packed into the stream, soit needs not be supplied during restore. Nonetheless it must beensured that compress and uncompress-programs exist within thesearch path of the client processes or are supplied with the fullpath.FilelistsFor each stored filesystem entry the client writes a line to afile containing the cartridge number where it can be found forrestore, the tape file number and (since 2.9) the ID of theuser owning the filesystem entry. This listfile resides locally

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -