• 検索結果がありません。

BIGLOBE クラウドホスティング ( 西日本リージョン ) バックアップ構築 設定マニュアル 1.0 版 (2014 年 7 月 7 日 ) ビッグローブ株式会社 1 Copyright 2014 BIGLOBE. All Rights Reserved

N/A
N/A
Protected

Academic year: 2021

シェア "BIGLOBE クラウドホスティング ( 西日本リージョン ) バックアップ構築 設定マニュアル 1.0 版 (2014 年 7 月 7 日 ) ビッグローブ株式会社 1 Copyright 2014 BIGLOBE. All Rights Reserved"

Copied!
24
0
0

読み込み中.... (全文を見る)

全文

(1)

1.0 版

(2014年7月7日)

ビッグローブ株式会社

BIGLOBE クラウドホスティング(西日本リージョン)

バックアップ構築

設定マニュアル

(2)

0. はじめに ... 3 1. 全体構成 ... 4 1.1. 全体構成の説明 ... 4 2. amanda(サーバ)の設定 ... 5 2.1. amanda の起動・停止方法 ... 5 2.2. 「バックアップ」対象の設定 ... 5 2.3. 「バックアップ」実行 ... 6 2.4. 「バックアップ」履歴の確認 ... 7 2.5. 「バックアップ」定期実行の設定(cron の設定) ... 7 2.6. 「リストア」amanda サーバ側で実施の場合 ... 8 2.7. 「リストア」amanda クライアント側で実行する場合 ... 9 2.7.1. リストア準備 ... 9 2.7.2. リストア実行 ... 10 3. amanda(クライアント)の設定 ... 12 3.1. amanda クライアントのインストール ... 12 3.2. amanda の起動・停止方法 ... 12 3.3. amanda(クライアント)の設定 ... 13 4. rsync の設定(同期先) ... 16 4.1. rsync の起動・停止方法 ... 16 4.2. rsync(デーモンモード)の設定... 17 4.3. 同期元ホストの登録設定 ... 18 5. rsync の設定(同期元サーバ)... 20 5.1. rsync のインストール ... 20 5.2. rsync の起動スクリプト ... 20 5.3. 定期実行の設定(cron の設定) ... 21 6. ベースモデル(西日本)(CentOS 6) モジュール構成 ... 22 7. 注意事項 ... 23  ご注意 ... 23

(3)

0. はじめに

本マニュアルは、あらかじめ初期インストールされている OS や各種 OSS の環境に対する設定方法 や推奨設定への変更方法が記載されています。 初期パスワードは、ご利用の環境に対するセキュリティ強化のためにも、設定を変更されることを強く お奨めします。 本マニュアル記載の設定手順例は簡易構築に向けた基本的なものに絞っており、バックアップやフ ァイル同期の暗号化通信、バックアップファイル暗号化の例は記載しておりません。(OSS の設定に より暗号化対応することもできます。) ●ご注意 本マニュアルで記載の設定は管理者権限(root)での設定が中心になります。 前提知識として管理者コマンドに関する知識が必要です。弊社ではお客様の設定誤りによるサポー トは致しかねますので、ご注意ください。

(4)

1. 全体構成

1.1. 全体構成の説明

本マニュアルでは下記構成におけるバックアップソフト、ファイル同期ソフトの設定例を記載してい ます。各設定箇所の項番は本マニュアルの項番をマッピングしています。 ファイル同期元サーバ バックアップ元サーバ バックアップ元サーバ ファイル同期元サーバ BIGLOBE クラウドホスティング 西日本リージョン バックアップソフト amanda(サーバ) ファイル同期ソフト rsync(同期先) バックアップソフト amanda(クライアント) ファイル同期ソフト rsync(同期元) バックアップ データ (履歴保存) 同期ファイル (ディレクトリ) ファイルバックアップ 定期的なファイル同期 2.amanda(サーバ)の設定 4.rsync の設定(同期先) 3.amanda(クライアント)の設定 5.rsync の設定(同期元)

(5)

2. amanda(サーバ)の設定

2.1. amanda の起動・停止方法

amanda サーバは xinetd のデーモンの中で起動しています。 amanda サーバの起動方法(デフォルトは自動起動になっています。) amanda サーバの停止方法(他の xinetd で起動されるサービスも停止されます。)

2.2. 「バックアップ」対象の設定

事前にバックアップを行う対象のサーバのホスト名、IP アドレスを準備してください。 ① /etc/hosts へ追加 (設定例)クライアントの IP アドレスが xxx.xxx.xxx.xxx、ホスト名が backup-cl の場合 ② /etc/amanda/DailySet1/disklist を作成 (設定例)ホスト名 backup-cl の/var をバックアップ対象ディレクトリに指定する場合

# echo “backup-cl /var comp-user-tar” >> /etc/amanda/DailySet1/disklist # cat /etc/amanda/DailySet1/disklist

・・・中略・・・

backup-cl /var comp-user-tar #

# echo “xxx.xxx.xxx.xxx backup-cl” >> /etc/hosts # cat /etc/hosts ・・・中略・・・ xxx.xxx.xxx.xxx backup-cl # # /etc/init.d/xinetd stop # /etc/init.d/xinetd start

(6)

③ /etc/amanda/DailySet1/amanda.conf を設定 バックアップの世代設定や通知メールの宛先を設定します。 エディタで、/etc/amanda/DailySet1/amanda.conf に設定します。 (設定例) 通知メールの送付先:root@localhost バックアップ方式:毎日完全バックアップ、25 世代 ※メール送信を行うにはメールサーバの設定が必要になります。

2.3. 「バックアップ」実行

「3.amanda(クライアント)の設定」の完了後、バックアップの実行確認することができます。 (実行例)バックアップ対象との実行確認を行います ・・・中略・・・ mailto “root@localhost” ・・・中略・・・

dumpcycle 0 weeks # the number of days in the normal dump cycle runspercycle 0 # the number of amdump runs in dumpcycle days

# (4 weeks * 5 amdump runs per week -- just weekdays) tapecycle 25 tapes # the number of tapes in rotation

# 4 weeks (dumpcycle) times 5 tapes per week (just # the weekdays) plus a few to handle errors that # need amflush and so we do not overwrite the full # backups performed at the beginning of the previous # cycle

・・・中略・・・

(7)

(実行例)バックアップを実行してみます

2.4. 「バックアップ」履歴の確認

「3.amanda(クライアント)の設定」の完了後、バックアップが実行された後に、バックアップファ イルの履歴を確認することができます。 (実行例)クライアントの IP アドレスが xxx.xxx.xxx.xxx の場合

2.5. 「バックアップ」定期実行の設定(cron の設定)

バックアップを定期実行するために、cron の設定を行います。 エディタで、/var/spool/cron/amandabackup に実行スケジュールを設定します。 # sudo su - amandabackup $ /usr/sbin/amdump DailySet1 $ # sudo su - amandabackup $ /usr/sbin/amcheck DailySet1 ・・・中略・・・

Amanda Backup Client Hosts Check

---

Client check: 1 host checked in 2.126 seconds. 0 problems found. $

# sudo su - amandabackup

$ /usr/sbin/amadmin DailySet1 find

date host disk lv tape or file file part status 2014-01-15 18:45:11 backup-cl /var 0 DailySet1-01 1 1/1 OK 2014-01-16 18:45:11 backup-cl /var 1 DailySet1-02 1 1/1 OK 2014-01-17 18:45:11 backup-cl /var 1 DailySet1-03 1 1/1 OK 2014-01-18 18:45:11 backup-cl /var 1 DailySet1-04 1 1/1 OK #

(8)

(設定例)毎日 4:10 に amcheck、毎日 4:40 に amdump を実行する場合 ※amcheck:amanda のバックアップチェックコマンド ※amdump:amanda のバックアップ実行コマンド

2.6. 「リストア」amanda サーバ側で実施の場合

amanda サーバでバックアップしたクライアントデータのリストアを行います。 (リストア例) これでカレントのディレクトリにファイルがリストアされます。 但し、サーバ側でのリストア方式ではファイルパーミッションはリストアされません。 10 4 * * * /usr/sbin/amcheck -m DailySet1 40 4 * * * /usr/sbin/amdump DailySet1 # vi /var/spool/cron/amandabackup # sudo su - amandabackup

$ /usr/sbin/amadmin DailySet1 find

date host disk lv tape or file file part status ・・・中略・・・

2014-01-15 18:45:11 backup-cl /var 1 DailySet1-01 1 1/1 OK

$ amtape DailySet1 label DailySet1-01 ~~~~~~~~~~~

$ amrestore file:/var/lib/amanda/vtapes backup-cl /var ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^ $ tar xvf backup-cl._var.20140613094001.0.0.0000001 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ $ バックアップ済の一覧が表示されます リストアしたい時点で差分データが複数ある場 合は、レベル(lv)0→1→2・・で順番に繰り返 し差分リストアを実施します。同じレベルのもの は最新ものだけになります。 バックアップデータのパス 対象ホスト名 リストアディレクトリ リストアしたファイル名 リストアしたいバックアップデータのラベル

(9)

2.7. 「リストア」amanda クライアント側で実行する場合

2.7.1.

リストア準備

amanda クライアントのインストールされているホストからリストアを実行する場合は、amanda サー バに以下の設定が必要です。 ※amanda サーバ側への設定です。 ① /etc/hosts.allow (設定例)クライアントの IP アドレスが xxx.xxx.xxx.xxx の場合 ② /var/lib/amanda/.amandahosts (設定例)クライアントのホスト名が backup-cl の場合 ③ ipfiter

amanda クライアントは、10080/tcp ポートを使用します。初期状態では、The Internet のすべて の場所からの 10080/tcp ポートへの接続を許可していません。

エディタで /etc/sysconfig/iptables を開き、10080/tcp の記述を変更してください。 (設定例)

# echo “backup-cl root amindexd amidxtaped” >> /var/lib/amanda/.amandahosts # cat /var/lib/amanda/.amandahosts

・・・中略・・・

backup-cl root amindexd amidxtaped #

# echo “amandad: xxx.xxx.xxx.xxx” >> /etc/hosts.allow # cat /etc/hosts.allow

・・・中略・・・

amandad: xxx.xxx.xxx.xxx #

(10)

設定変更が終了したら iptables を再起動してください。

2.7.2.

リストア実行

amanda クライアントのインストールされているホストでリストアを実行します。 ※amanda クライアント側で実行します。

# /etc/init.d/iptables restart

# Firewall configuration written by system-config-securitylevel # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :RH-Firewall-1-INPUT - [0:0] -A INPUT -j RH-Firewall-1-INPUT ・・・中略・・・

-A RH-Firewall-1-INPUT -j ACCEPT -p tcp -m tcp -s xxx.xxx.xxx.xxx --dport 10080 --syn

(11)

# /usr/sbin/amrecover >listhost ※amanda サーバから登録されているホスト名一覧が表示されます >sethost ホスト名 ※リストアしたいホスト名を指定 >listdisk ※amanda サーバからバックアップされているディレクトリ一覧が表示されます >setdisk ディレクトリ名 ※リストアしたいディレクトリを指定 >add * ※リストアするディレクトリを組み込んでいく(*はすべて指定になります) >lcd リストア先のディレクトリ名 ※リストア先のローカルのディレクトリを指定 >extract

※リストア実施。(amanda サーバ側で、amtape コマンドで tape 名を指定する必要があります。) >exit

(12)

3. amanda(クライアント)の設定

amanda によるバックアップを利用するには、バックアップ対象のデータがあるホストに amanda クラ イアントのインストールが必要です。下記は amanda クライアント側の設定の一例です。さまざまな OS に対応しているので、環境にあったクライアントを選択して設定してください。 本項ではクライアントが CentOS6 の場合の設定例を記載しています。

3.1. amanda クライアントのインストール

OS に応じた amanda クライアントモジュールをダウンロードしてインストールします。 (参考) http://www.zmanda.com/download-amanda.php amanda クライアントのインストール例(CentOS6 の場合)

3.2. amanda の起動・停止方法

amanda クライアントは xinetd のデーモンの中で起動しています。 amanda クライアントの起動方法 amanda クライアントの停止方法 # /etc/init.d/xinetd start #yum install –y wget # wget

http://www.zmanda.com/downloads/community/Amanda/3.3.5/Redhat_Enterprise_6.0/amanda-back up_client-3.3.5-1.rhel6.x86_64.rpm

# yum install –y xinetd # yum install –y perl-JSON

# rpm –ivh amanda-backup_client-3.3.5-1.rhel6.x86_64.rpm #

(13)

3.3. amanda(クライアント)の設定

amanda クライアントに対して amanda サーバの情報を設定していきます。amanda サーバのホスト 名、IP アドレスを準備してください。

① /etc/hosts へ追加

(設定例)amanda サーバの IP アドレスが yyy.yyy.yyy.yyy、ホスト名が backup-sv の場合。

② /etc/hosts.allow へ追加

(設定例)amanda サーバの IP アドレスが yyy.yyy.yyy.yyy の場合。

③ Ipfiter へ追加

amanda サーバは、10080/tcp ポートを使用します。初期状態では、The Internet のすべての場 所からの 10080/tcp ポートへの接続を許可していません。

エディタで /etc/sysconfig/iptables を開き、10080/tcp の記述を変更してください。 (設定例)

# echo “amandad: yyy.yyy.yyy.yyy” >> /etc/hosts.allow # cat /etc/hosts.allow

・・・中略・・・

amandad: yyy.yyy.yyy.yyy #

# echo “yyy.yyy.yyy.yyy backup-sv” >> /etc/hosts # cat /etc/hosts

・・・中略・・・

yyy.yyy.yyy.yyy backup-sv #

(14)

設定変更が終わったら iptables を再起動してください。 ④ /var/lib/amanda/.amandahosts へ追加 (設定例)amanda サーバのホスト名が amanda-sv の場合。 ⑤ /etc/amanda/amanda-client.conf を設定 バックアップサーバの設定をします。 エディタで、/etc/amanda/amanda-client.conf に設定します。 (設定例)

# echo “amanda-sv amandabackup amdump” >> /var/lib/amanda/.amandahosts # cat /var/lib/amanda/.amandahosts

・・・中略・・・

amanda-sv amandabackup amdump #

# /etc/init.d/iptables restart

# Firewall configuration written by system-config-securitylevel # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :RH-Firewall-1-INPUT - [0:0] -A INPUT -j RH-Firewall-1-INPUT -A FORWARD -j RH-Firewall-1-INPUT -A RH-Firewall-1-INPUT -i lo -j ACCEPT ・・・中略・・・

-A RH-Firewall-1-INPUT -j ACCEPT -p tcp -m tcp -s yyy.yyy.yyy.yyy --dport 10080 --syn

COMMIT

(15)

以上でクライアント側の設定は完了です。amanda サーバ側からバックアップを実行してください。 ※ 「2.3 「バックアップ」実行 」 を参照

#

# amanda.conf - sample Amanda client configuration file. #

# This file normally goes in /etc/amanda/amanda-client.conf. #

conf "DailySet1" # your config name

index_server "backup-sv" # your amindexd server tape_server "backup-sv" # your amidxtaped server tapedev "file:/var/lib/amanda/vtapes" # 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. ・・・中略・・・

(16)

4. rsync の設定(同期先)

4.1. rsync の起動・停止方法

rsync は xinetd の上で動作していますので rsync の起動・再起動・停止は、xinetd を起動・再起動・ 停止することで実行します。

rsync の起動方法

rsync の停止方法

# /etc/init.d/xinetd stop # /etc/init.d/xinetd start

(17)

4.2. rsync(デーモンモード)の設定

同期を行うための rsync の設定を行います。事前に同期元サーバのホスト名、IP アドレスを準備し てください。 (※)バックアップのオーバーヘッドを抑えるため rsync(デーモンモード)で rsync プロトコルを利用し た同期設定例を記載しています。通信経路の暗号化が必要な場合は ssh プロトコル等を使った設 定にする必要がありますので注意してください。 ① /etc/rsyncd.conf の設定 (設定例)クライアントの IP アドレスが xxx.xxx.xxx.xxx、ホスト名が backup-cl の場合。 ② /etc/rsyncd.secrets # /etc/rsyncd.conf # # Global options # uid = root gid = wheel use chroot = no

log file = /var/log/rsyncd.log pid file = /var/run/rsyncd.pid hosts allow = xxx.xxx.xxx.xxx hosts deny = * # # Module options # [TEST]

comment = rsync backup server for CL path = /tmp/

auth users = backup

secrets file = /etc/rsyncd.secrets read only = no

# vi /etc/rsyncd.conf

Comment:コメント

Path:同期したファイルを置くディレクトリ auth users:secrets file に記載したユーザ名

(18)

(設定例)ユーザを backup、パスワードを password に設定する場合。

4.3. 同期元ホストの登録設定

事前に同期を行う対象のサーバ(同期元)のホスト名、IP アドレスを準備してください。 ① /etc/hosts へ追加 (設定例)クライアントの IP アドレスが xxx.xxx.xxx.xxx、ホスト名が backup-cl の場合 ② /etc/hosts.allow (設定例)クライアントの IP アドレスが xxx.xxx.xxx.xxx の場合 ③ Ipfiter へ追加

rsync は、873/tcp ポートを使用します。初期状態では、The Internet のすべての場所からの 873/tcp ポートへの接続を許可していません。

エディタで /etc/sysconfig/iptables を開き、873/tcp の記述を変更してください。 # echo “backup:password” >> /etc/rsyncd.secrets

# cat /etc/rsyncd.secrets backup:password

# chmod 600 /etc/rsyncd.secrets #

# echo “rsync: xxx.xxx.xxx.xxx” >> /etc/hosts.allow # cat /etc/hosts.allow

・・・中略・・・

rsync: xxx.xxx.xxx.xxx #

# echo “xxx.xxx.xxx.xxx backup-cl” >> /etc/hosts # cat /etc/hosts

・・・中略・・・

xxx.xxx.xxx.xxx backup-cl #

(19)

設定変更が終わったら iptables を再起動してください。

# /etc/init.d/iptables restart

# Firewall configuration written by system-config-securitylevel # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :RH-Firewall-1-INPUT - [0:0] -A INPUT -j RH-Firewall-1-INPUT -A FORWARD -j RH-Firewall-1-INPUT -A RH-Firewall-1-INPUT -i lo -j ACCEPT ・・・中略・・・

-A RH-Firewall-1-INPUT -j ACCEPT -p tcp -m tcp -s yyy.yyy.yyy.yyy --dport 873 --syn

(20)

5. rsync の設定(同期元サーバ)

rsync を利用してデータ同期を行うには、同期元対象のデータがあるホストに rsync をインストールす る必要があります。下記は rsync の設定の一例です。 本項ではクライアントが CentOS6 の場合の設定例を記載しています。 (※)オーバヘッドの少ない rsync プロトコルを使った例であり、通信経路の暗号化を行う場合は ssh プロトコルを使った設定が必要です。

5.1. rsync のインストール

① rsync コマンドのインストール例(CentOS6 の場合) ② /etc/rsyncd.passwd の設定 起動スクリプトで利用するパスワードファイルを作成します。rsync(同期先)側で設定した、 rsyncd.secrets のユーザ、パスワードのうち、パスワードのみを記載します。 (例)password に設定する場合。

5.2. rsync の起動スクリプト

rsync の起動スクリプトを作成して、cron 登録することで定期的に同期することができます。 rsync 起動スクリプト

# echo “password” >> /etc/rsyncd.passwd # cat /etc/rsyncd.passwd

password

# chmod 600 /etc/rsyncd.passwd #

#yum install –y rsync #

(21)

(スクリプト例)rsync(同期先)サーバの IP が xxx.xxx.xxx.xxx、同期させたいディレクトリ /var の場合

5.3. 定期実行の設定(cron の設定)

ファイル同期を定期実行するために、cron の設定を行います。 エディタで、/var/spool/cron/root に実行スケジュールを設定します。 (設定例)30 分毎に同期を実行、ログファイルを/tmp/backup.sh.log に上書きする。 ・・・中略・・・

30 * * * * /root/backup.sh > /tmp/backup.sh.log 2>&1 # vi /var/spool/cron/root

#!/bin/sh

LOCK_DIR="/tmp/backup_lock" mkdir ${LOCK_DIR}

if [ $? == 0 ];then

rsync -a -E --delete --stats --password-file=/etc/rsyncd.passwd "/var/" "rsync://backup@xxx.xxx.xxx.xxx/TEST"

else exit1 > /dev/null 2>&1 fi rmdir ${LOCK_DIR} # touch /root/backup.sh # chmod 700 /root/backup.sh # vi /root/backup.sh ■Password-file rsync(同期元)ので設定したパスワードを記載したファイル ■同期先ディレクトリの指定 rsync://ユーザ名@IP アドレス/モジュール名

ユーザ名、モジュール名は rsync(同期先)の rsyncd.conf 設定した auth users と Module options 名

(22)

6. ベースモデル(西日本)(CentOS 6) モジュール構成

初期状態のモジュール構成は以下の通りです。 インストールモジュールは「/usr/local/src/rpms_backup」に格納しています。 amanda-backup_server-3.3.5-1.rhel6.x86_64.rpm rsync-3.0.6-9.el6_4.1.x86_64.rpm xinetd-2.3.14-39.el6_4.x86_64.rpm perl-Compress-Raw-Zlib-2.021-136.el6.x86_64.rpm perl-Compress-Zlib-2.021-136.el6.x86_64.rpm perl-HTML-Parser-3.64-2.el6.x86_64.rpm perl-HTML-Tagset-3.20-4.el6.noarch.rpm perl-IO-Compress-Base-2.021-136.el6.x86_64.rpm perl-IO-Compress-Zlib-2.021-136.el6.x86_64.rpm perl-JSON-2.15-5.el6.noarch.rpm perl-libwww-perl-5.833-2.el6.noarch.rpm perl-URI-1.40-2.el6.noarch.rpm perl-XML-Parser-2.36-7.el6.x86_64.rpm perl-XML-Simple-2.18-6.el6.noarch.rpm

(23)

7. 注意事項

 ご注意

本書の内容の一部または全部を無断転載することは禁じられています。 本書の内容に関しては将来予告なしに変更することがあります。

(24)

BIGLOBE クラウドホスティング(西日本リージョン)

バックアップ構築

設定マニュアル

1.0 版 2014 年 7 月

ビッグローブ株式会社

参照

関連したドキュメント

高校生 (直営&FC) 大学生 中学生 (直営&FC)..

前年度または前年同期の為替レートを適用した場合の売上高の状況は、当年度または当四半期の現地通貨建て月別売上高に対し前年度または前年同期の月次平均レートを適用して算出してい

(※)Microsoft Edge については、2020 年 1 月 15 日以降に Microsoft 社が提供しているメジャーバージョンが 79 以降の Microsoft Edge を対象としています。2020 年 1

・ 継続企業の前提に関する事項について、重要な疑義を生じさせるような事象又は状況に関して重要な不確実性が認

を派遣しており、同任期終了後も継続して技術面での支援等を行う予定である。今年 7 月 30 日~8 月

ペトロブラスは将来同造船所を FPSO の改造施設として利用し、工事契約落札事業 者に提供することを計画している。2010 年 12 月半ばに、ペトロブラスは 2011

(注2) 営業利益 △36 △40 △3 -. 要約四半期 売上高 2,298 2,478

対象期間を越えて行われる同一事業についても申請することができます。た