Create: 2013/04/15
LastUpdate: 2013/04/17
下図の構成でバックアップクラスタを構築します。JobSchedulerのバージョンは "1.3.12.3072" です。
下図の詳細を知りたい場合は、上に戻ってください。
以下に、バックアップ・クラスタ構築の作業手順を紹介します。
手順は、「インストールマニュアル(PDF)」と「Reference Documentation」を参考にしました。
[ 作業手順メニュー ]
-
Strageサーバの構築
1.Strage サーバの構築
Strageサーバは、新規に作成します。デスクトップ環境なしのCentOS6.4(32bit) を入れて、MySQL と NFSサーバを導入します。
OSのインストール手順は、「 [XenServer 6.0.0] XenVM作成 - CentOS 6.0 ( 1/4 )」を参考にしてください。
ここでは、OSのインストール手順は省略します。
以下にStorageサーバの構築手順を紹介します。
各作業で、使用しているアカウントの記載がない場合は、root ユーザを使用しています。
1.1.データベースの作成
MySQLをインストールして、JobScheduler用のデータベース(scdl)とDBアカウントを作成します。
手順は、「 MySQLのインストール」と同じです。
ただし、この手順では、データベース(scdl)に接続できるのが localhost だけなので、Managerサーバからも接続できるように設定します。
以下のようにコマンドを実行して、制限なしで全てのサーバから接続できるようにします。
# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.1.67 Source distribution Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> GRANT ALL PRIVILEGES ON scdl.* TO scdl_user@'%' IDENTIFIED BY 'scdl_pass' WITH GRANT OPTION; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> ByeManageサーバ(プライマリ)で以下のようにコマンドを実行して接続できればOKです。
# mysql --user=scdl_user --password=scdl_pass --host=192.168.1.85 scdl Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6 Server version: 5.1.67 Source distribution Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> status -------------- mysql Ver 14.14 Distrib 5.1.67, for redhat-linux-gnu (i386) using readline 5.1 Connection id: 6 Current database: scdl Current user: scdl_user@192.168.1.84 SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 5.1.67 Source distribution Protocol version: 10 Connection: 192.168.1.85 via TCP/IP Server characterset: utf8 Db characterset: utf8 Client characterset: utf8 Conn. characterset: utf8 TCP port: 3306 Uptime: 30 min 10 sec Threads: 1 Questions: 26 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second avg: 0.14 -------------- mysql>
1.2.NFSサーバの設定
複数のサーバでファイルを共有する方法は、色々ありますが、今回は、NFSで共有します。
CentOS6 のデフォルトは NFSのVersion4 ですが、今回は、設定が簡単な Version3 を使用します。
まず、NFSがインストールされているか確認します。
以下のようにコマンドを実行して、何も表示されなければ NFS はインストールされていません。
# rpm -aq | grep nfs-utils以下のようにコマンドを実行して NFS をインストールします。
# yum install nfs-utils次に、共有するディレクトリを作成します。
JobScheduler用のアカウントにしている jobsユーザでディレクトリを共有したいので、jobs ユーザを作成します。
# useradd jobs # passwd jobs ユーザー jobs のパスワードを変更。 新しいパスワード: よくないパスワード: 短かすぎます よくないパスワード: 簡単すぎます 新しいパスワードを再入力してください: passwd: 全ての認証トークンが正しく更新できました。共有するディレクトリとして "/home/jobs/sos" を作成します。
# su - jobs $ mkdir sos"/etc/exports" を以下のように編集して、NFSで共有するディレクトリ(/home/jobs/sos)を設定します。
マウントオプションの説明については、「[CentOS6] NFSサーバ構築 - OSSでLinuxサーバ構築」を参照してください。
# cat /etc/exports /home/jobs/sos 192.168.1.0/24(rw,sync,no_root_squash,no_all_squash)NFSサーバ用サービスを起動します。
以下のようにコマンドを実行します。
# service rpcbind start # service nfslock start # service nfs startNFSサーバ用サービスの自動起動/停止を設定します。
# chkconfig rpcbind on # chkconfig nfslock on # chkconfig nfs onNFSでちゃんと共有できているか確認します。
以下のようにコマンドを実行して、共有したディレクトリが表示されたらOKです。
# exportfs /home/jobs/sos 192.168.1.0/24試しにマウントして、状態を確認し、赤字のように表示されたらOKです。
確認後は、アンマウントしておきます。
# mount -t nfs 192.168.1.85:/home/jobs/sos /mnt
# mount
/dev/mapper/VolGroup-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/xvda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
none on /proc/xen type xenfs (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
192.168.1.85:/home/jobs/sos on /mnt type nfs (rw,vers=4,addr=192.168.1.85,clientaddr=192.168.1.85)
# umount /mnt
赤字部分で "vers=4" と表示されているのは、NFSのVersion4 でマウントしていることを示しています。NFSクライアント側で Version を指定しないでmauntすると Version4 でマウントされます。
なので、今回のNFS設定でNFSのVersion3を使用したい場合は、NFSクライアント側で Version3 を指定してマウントする必要があります。