2:バックアップされる側のホストの設定

Date 2012-1-4 4:18:27 | Topic: amandaのバージョンを3.3にする

バックアップされる側の全てのサーバーで下記を行う。
クライアント・プログラムをインストール
http://www.zmanda.com/download-amanda.phpにアクセスし、下の方にある Select your version: で最新の分(私は3.3.0だった)を選び、表示された画面をスクロールダウンしていくとRedhat Enterprise 5.0があるので、その中のamanda-backup_client-3.3.0-1.rhel5.x86_64.rpmをダウンロードし、そのディレクトリに移ってから
# rpm -Uvh amanda-backup_client-3.3.0-1.rhel5.x86_64.rpm
/var/lib/amanda/.amandahostsはなくなっており、多分必要なくなったのだろう。(実は必要)その変わり、/etc/amandaにamanda-client.confがありこれを編集し、下記の設定をする。
#
# amanda-client.conf - sample Amanda client configuration file.
#
# This file normally goes in /etc/amanda/amanda-client.conf.
#
conf "MyConfig" # your config name
index_server "smb.kinryokai.net" # your amindexd server
tape_server "smb.kinryokai.net" # your amidxtaped server
tapedev "" # your tape device
# if not set, Use configure or ask server.
# if set to empty string "", ask server
# amrecover will use the changer if set to the value
# of 'amrecover_changer' in the server amanda.conf.

# auth - authentication scheme to use between server and client.
# Valid values are "bsd", "bsdudp", "bsdtcp", "krb5", "local",
# "rsh" and "ssh".
# Default: [auth "bsdtcp"]
auth "bsdtcp"
ssh_keys "" # your ssh keys file if you use ssh auth


続いて/etc/hotsファイルの編集。下記の設定をした。
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.135.210 smb.kinryokai.net smb


/etc/xinetd.d/にあるファイルはamandaclientになっており、変更する必要はなかった。一様xinetd をリスタートする
# service xinetd restart

amandaのプロセスをチェックする
# lsof | grep amanda
bash 20247 root cwd DIR 253,6 4096 12812289 /download/amanda
xinetd 21848 root 5u IPv4 1083562 TCP *:amanda (LISTEN)
lsof 28642 root cwd DIR 253,6 4096 12812289 /download/amanda
grep 28643 root cwd DIR 253,6 4096 12812289 /download/amanda
lsof 28644 root cwd DIR 253,6 4096 12812289 /download/amanda

と表示された。
ファイヤーウォールの設定。udpの10080を開ける
システム>管理>セキュリティレベルとファイヤーウォールの設定をクリック
その他のポートをクリック、追加をクリック、ポートに10080を入れ、プロトコルをudpにし、OKをクリック、適用をクリック、OKをクリック、確認ダイアログが開くのでOKをクリック。これでudp 10080 がファイヤーウォールを通れる。
私ははiptables.shというスクリプトを作りいろいろな設定をしてあり、その中で iptables -A INPUT -s $LOCALNET -j ACCEPT ($LOCALNETは使用しているネットワークを定義している。この意味は内部からのアクセスをすべて許可)ので特に設定はしなかった、
amanda-serverのdisklistに設定を追加。アマンダのサーバーに移って
# gedit /etc/amanda/MyConfig/disklist
下記の設定にした。ファイルのオーナーは既にamandabackupになっているので、ユーザーを変更する必要は無い。
localhost /var simple-gnutar-local
localhost /samba simple-gnutar-local
localhost /Data simple-gnutar-local
xen.itca.co.jp /dev/md1 dump-comp
 ← 追加 ホストでは / (ルート)になっているraid1
xen.itca.co.jp /dev/md0 dump-comp
 ← 追加 ホストでは /bootになっているraid1
xen.itca.co.jp /dev/vg1/download dump-comp
 ← 追加 ホストでは ダウンロードしたファイルの置き場所になっているLVM
でもって、xinetdを再起動とamacheck
# service xinetd restart
以前は各テープにラベルを付けないとダメだったが、このバージョンからラベルは自動で付けてくれる。
# sudo -u amandabackup amcheck MyConfig
ありゃりゃ
ERROR: NAK xen.kinryokai.net: user amandabackup from smb.kinryokai.net is not allowed to execute the service noop: cannot open /var/lib/amanda/.amandahosts: No such file or directory
Client check: 2 hosts checked in 0.259 seconds. 1 problem found.

とエラーが出た。やっぱり.amandahostsはいるんじゃん!! で バックアップされるホストに移って /var/lib/amanda/.amandahostsに
smb.kinryokai.net amandabackup amdump
と設定し、一様xinetdを再起動。サーバーに移って
# sudo -u amandabackup amcheck MyConfig
とチェックすると、又エラー。
ERROR: NAK xen.itca.co.jp: user amandabackup from smb.itca.co.jp is not allowed to execute the service noop: /var/lib/amanda/.amandahosts: incorrect permissions; file must be accessible only by its owner
Client check: 2 hosts checked in 0.222 seconds. 1 problem found.

パーミッションが問題とあるので、てっきりオーナーかと思ってバックアップされるホストのこのファイルをチェックするがamandabackupになっている?ググるとパーミッションを600にしないと、いけない様だ。
# chmod 600 /var/lib/amanda/.amandahosts
とし、サーバーに戻って
# sudo -u amandabackup amcheck MyConfig
今度はエラーが出なかた。やれやれ
2012/1/21追記:.amandahostsの内容がlocalhostやlocalhost.localdomainになっていたので ホスト名とFQDN(smb と smb.kinryokai.net)に変更したがこれはamrecoverでエラーになる。オリジナルのlocalhostやlocalhost.localdomainでないとダメ。


This article comes from 錦稜会 KINRYOKAI
https://www.kinryokai.net

The URL for this story is:
https://www.kinryokai.net/article.php?storyid=119