📄 howto
字号:
The port numbers and/or cartridge set numbers can be omitted or fewerthan hostnames can be supplied, then the defaults will apply. If moreport or cartridge set numbers than hostnames are given, the superfluousones are ignored. The lists of hostnames and numbers can be separatedby whitespace and/or commas.When a full or incremental backup starts on a client, it tests theservers, one after the other, whether they are ready to service them.If none is ready, it waits for a minute and tries again.With each stored filesystem entry, not only the cartridge number andfile number on tape is stored, but now also the name of the host,where the entry is stored to, and the appropriate port number. Thusthey can be restored without the necessarity, that the user or adminis-trator knows, where they are now. This all happens transparently andwithout additional configuration efforts. For older backups, the firstentry of each list (hostname and port) is used. Therefore, in case ofan upgrade, the first entries MUST be those, that applied for thisbefore the upgrade.If there are several clients, the same order of server entries shouldnot be configured for all of them. This would probably cause most ofthe backups to go to the first server, while the other(s) are notexploited. The entries should be made in a way, that a good balancingof storage load is achieved. Other considerations are:- Can the backup be made to a server in the same subnet, where the client is- Has this software been upgraded ? Then the first entry should be the same server as configured before (see above)- The data volume on the clients to be saved (should be balanced)- The tape capacity of the servers- other considerations ...--------------------------------------------------------------------------10. How can i automatically make copies of the written tapes after a backup ?For this purpose a script has been added to the distribution. It's nameis autocptapes and it can be found in the /path/to/client/bin directory.autocptapes should read the statistics output and will copy all tapesfrom the first accessed tape through the last one to the given destination.Copying will begin at the first written tapefile, so not the whole tapecontents are copied all the time again.The script has the following usage:autocptapes [ -h <targetserver> ] [ -p <targetport> ] \ [ -k <targetkeyfile> ] [ -o cartnumoffset ]targetserver must be the name of the server, where to copy the tapes to. (default, if not set: the source server)targetport must be the appropriate target server port (default, if not set: the source port)targetkeyfile the file containing the key to authenticate to the target server (default: the same file as for the source server)cartnumoffset the offset to be added to the source cartridges' numbers to get the target cartridge numbers (may be negative, default: 0). This is useful, if e.g. copies of tapes 0-5 shall be on tapes 6-10, then simply an offset of 5 would be supplied.The script can be added to the client side configuration parameterExitProgram, so that it reads the report file containing the backupstatistics. This may e.g. look as follows:ExitProgram: /path/to/client/bin/autocptapes -o 5 < %rNote, that this is a normal shell interpreted line and %r can be usedin several commands separated by semicolon, && or || ...WARNING: If several servers are configured for the client, thisautomatic copying is severely discouraged, cause cartridge numberson one server do not necessarily have something to do with those onanother server. It should be carefully figured out, how a mapping ofsource and target servers and cartridge numbers could be achieved.This is subject of future implementations.--------------------------------------------------------------------------11: How to redirect network backups through a secure ssh connection ?ssh must be up and working on client(s) and server(s). On theserver, an sshd must be running. Then port forwarding can beused. As afbackup does not use a privileged port, the forwardingssh needs not to run as root. Any user is ok. To enable afbackupto use a secure ssh connection, no action is necessary on theserver. On the client, the following steps must be made:- Configure the client itself as the server in the clientside configuration file as localhost (the ssh forwarder seems to accept connections only from the loopback interface). No afbackup server process should be running on this client. If an afbackup server is running, a different port than the default 2988 must be configured. This different port number should be passed to ssh forwarder, when started.- Start the ssh forwarder. The following command should do the job: ssh -f -L 2988:afbserver:2988 afbserver sleep 100000000Explanations: -f makes the ssh run in the background, & is not necessary. -L tells the ssh to listen locally at port 2988. This(first) port number must be replaced, if a different port must be used due to an afbackup server running locally or other considerations. afbserver must be replaced with the name of the real afbackup server. The second port number 2988 is the one, where the afbackup server really expects connections and that was configured on the client before trying to redirect over ssh. The sleep 100000 is an arbitrary command that does not terminate within a sufficient time interval.Now the afbackup client connects to the locally running ssh, whoin turn connects the remote sshd, who connects the afbackup serverawaiting connections on the remote host. So all network traffic isdone between the ssh and sshd and is thus encrypted.A simple test can be run (portnum must only be supplied if != 2988)on the client: /path/to/client/bin/client -h localhost -q [ -p portnum ]If that works, any afbackup stuff should.If it is not acceptable, that the ssh-connection is initiated fromthe client side, the other direction can be set up using the -Roption of ssh. Instead of the second step in the explanations aboveperform:- On the server start the command: ssh -f -R 2988:afbserver:2988 afbclient sleep 100000000--------------------------------------------------------------------------12: What's the appropriate way to eject the cartridge after backup ?In my opinion it is best to exploit the secure remote start optionof afbackup. Programs present in the directory configured as theProgram-Directory on the server side can be started from a clientusing the -X option of afclient. Either write a small script, thatdoes the job and put the script into the configured and created (ifnot already present) directory. Don't forget execute permission. Orsimply create a symbolic link to mt in that directory (e.g. typeln -s `which mt` /path/to/server/rexec/mt). Then you can eject thecartridge from any client eject running /.../client/bin/afclient -h backupserver -X "mt -f /dev/whatever rewoffl"--------------------------------------------------------------------------13: How to encrypt the stored files and not only compress them ?A program, that performs the encryption is necessary, let's simply callit des, what is an example program for what we want to achieve here. Thebasic problem must be mentioned here: To supply the key it is necessaryto either type in the key twice or to supply it on the command line usingthe option -k. Typing the key in is useless in an automated environment.Supplying the key in an option makes it visible in the process list, thatany user can display using the ps command or (on Linux) reading thepseudo-file cmdline present in each process's /proc/<pid>/ directory.The des program tries to hide the key overwriting the 8 significant bytesof the argument, but this does not always work. Anyway the des programshall serve as example here. Note, that the des program will usuallyreturn an exit status unequal to 0 (?!?), so the message "minor errorsoccurred during backup" does not have special meanings.Another encryption program comes with the afbackup distribution and isbuilt, if the libdes is available and des-encrypted authentication isswitched on. The program is called __descrpt. See the file PROGRAMSfor details on this program. The advantage of this program is, thatno key has to be supplied on the command line visible in the processlist. The disadvantage is, that the program must not be executable byintruders, cause they would be able to simply start it and decrypt.To circumvent this to a certain degree, a filename can be supplied tothis program, that the key will be read from. In this case this keyfile must be access restricted instead of the program itself.If only built-in compression is to be used, everything is quite simple.The BuiltinCompressLevel configuration parameter must be set > 0 and theen- and decrypt programs be specified as CompressCmd and UncompressCmd.If an external program should be used for compress and uncompress, itis a little more difficult:Cause the client side configuration parameter CompressCommand is NOTinterpreted in a shell-like manner, no pipes are possible here. E.g. itis impossible to supply something like: gzip -9 | des -e -k lkwjer80723kthere.To fill this gap the helper program __piper is added to the distribution.This program gets a series of commands as arguments. The pipe symbol |may appear several times in the argument list indicating the end of acommand and the beginning of the next one. Standard output and standardinput of the following command are connected as usual in a shell command.No other special character is interpreted except the double quotes, thatcan delimit arguments consisting of several words separated by whitespace.The backslash serves as escape character for double quotes or the pipesymbol. The startup of a pipe created by the __piper program is expectedto be much faster compared to a command like sh -c "gzip | des -e ...",where a shell with all it's initializations is used.Example for the use of __piper in the client side configuration file:CompressCommand: /path/to/client/bin/__piper gzip -1 | des -e -k 87dsfdUncompressCommand: /path/to/client/bin/__piper des -d -k 87dsfd | gunzip--------------------------------------------------------------------------14: How to use the multi-stream server ? Anything special there ?The multi-stream server should be installed properly as described in thefile INSTALL or using the script Install. It is heavily recommended toconfigure a separate service (i.e. TCP-port) for the multi-stream server.Thus backups can go to either the single-stream server or to the multi-stream server. The index mechanism of the client side handles thistransparently. The information, where the data has been saved, has notto be supplied for restore.The single stream server might be used for full backups, because it isgenerally expected to perform better and provide higher throughput. Themulti-stream server has advantages with incremental backups, becauseseveral clients can be started in parallel to scan through their diskdirectories for things, that have changed, what may take a long time.If there are several file servers with a lot of data it might be desiredto start the incremental backups at the same time, otherwise it wouldtake too much time. Having configured the single stream server as defaultin the client side configuration, the incr_backup program will connectto the multi-stream server using the option -P with the appropriate portnumber of the multi-stream server.As it is not possible, that several single stream servers operate on thestreamer at the same time, it is not possible, that a multi-stream serverand a single-stream server do in parallel. This is only the multi-streamserver's job.The clients must be distinguishable for the multi-stream server. It putsthe data to tape in packets prefixed with a header containing the clients'identifiers. Dispatching during read it must have an idea, which clientis connected and what data it needs. Default identifier is the officialhostname of the client or the string "<client-program>", if the program"afclient" is used. It is not allowed, that several clients with the sameidentifier connect, cause that would mix up their data during read, whatis obviously not desirable. A client identifier can be configured in theclient side configuration file using the parameter ClientIdentifier orusing the option -W (who), that every client side program supports.It might be necessary to do this, e.g. if a client's official hostnamechanges. In this case the client won't receive any data anymore, causethe server now looks for data for the client with the new name on tape,which he won't find.To find out and store the client's identifiers easily it is includedinto the statistics report, that can be used (e.g. sent to an adminvia E-mail) in the client side exit program.--------------------------------------------------------------------------15: How many clients can connect the multi-stream server ?This depends on the maximum number of filedescriptors per process on theserver. On a normal Unix system this number is 256. The backup systemneeds some file descriptors for logging, storing temporary files and soon, so the maximum achievable number of clients is something around 240.It is not recommended to really run that many clients at the same time,this has NOT been tested.Anyway the number of filedescriptors per process can be increased onmost systems, if 240 is not enough.--------------------------------------------------------------------------16: How to get out of the trouble, when the migration script fails ?This depends, where the script fails. If it says:"The file .../start_positions already exists."there is no problem. You might have attempted migration before.If this is true, just remove this file or rename it. If it doesnot contain anything it is anyway useless. When the script tells,that some files in .../var of your client installation containdifferent (inconsistent) numbers, then it is getting harder.Locate the last line starting with ~~Backup: in you old styleminimum restore info and take the number at the end of it.The file `num' in your clientside var directory should containthe same number. If it does not, check the current number of theFile index files, also in the clientside var directory. Theirname is determined by the configuration parameter IndexFilePart.The file `num' should contain the highest number found in thefilenames. If not, edit the file num, so it does. Nonethelessthis number must also match the one noted earlier. If it doesnot, this is weird. If your minimum restore info contains onlysignificantly lower numbers, you have a real problem, causethen you minimum restore info is not up to date. In this casemigration makes no sense and you can skip the migration stepstarting anew with fingers crossed heavily.If the file `num' in the var directory is missing, then youmust check your configuration. If you have never made a backupbefore, then this file is indeed not there and migration makesnot too much sense.If the full_backup program you supply is found not beingexecutable, please double-check your configuration and makesure, that you are a user with sufficient power.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -