Mac De Oracle - 10万円 de RAC #22 Tweet
10万円 de RACのつづき。今回は、Oracle Cluster File System (OCFS2)のインストール及び構成。その3。
- ハードウェアの価格と構成
- Linux (CentOS 4.4)のインストール
- ネットワークの構成
- Openfilerのインストール
- OpenfilerによるiSCSIボリュームの構成
- Oracle RACノードでのiSCSIボリュームの構成 その1。 その2。
- Oracle所有者と関連ディレクトリの作成及び環境変数の設定
- Oracle向けLinuxサーバーの構成(カーネルパラメータの設定)
- hangcheck-timerカーネル・モジュールの構成
- Oracle RACノード間リモートアクセスの構成
- Oracle RACノード構成ファイルの確認
- Oracle Cluster File System (OCFS2)のインストール及び構成 その1/その2/その3
- Oracle Automatic Storage Management(ASMLib 2.0)のインストール及び構成
- Oracle 10gソフトウェアのダウンロード)
- Oracle10g R2インストール事前作業
- Oracle10g Clusterwareのインストール
- Oracle10g R2 Database softwareのインストール
- Oracle10g R2 Companion CD softwareのインストール
- TNS Listenerの構成
- Oracle Cluster databaseの作成
- Oracle Net Serviceの確認
- 表領域の作成と変更
- Oralce RAC ClusterとDatabase構成の確認
- Clusterの開始と停止の確認
- 簡単なTransparent Application Failover (TAF)の確認
- PowerBook G4のJDeveloper10g/SQL Developer/SQL*Plusなどからの接続確認(Mac De Oracleではお約束!なので)
MacOSX 10.4.8(PowerPC)へのOracle10g clientインストールは特に新しいネタでもないので記事として書く予定はないが、MacOSX 10.4.8(PowerPC)のJDeveloper10g、SQL DeveloperやSQL*Plusからの接続確認等の記録は載せる予定である。
Oracle Cluster File System (OCFS2)のインストール及び構成。その3。
尚、手順はOTN USの「16. Install & Configure Oracle Cluster File System (OCFS2)」と同じなのでそちらも参照のこと。
また、各操作は、Apple PowerBook G4のTerminalから sshを利用し、Oracle RACを構成する各ノードに接続して行っている。
尚、Terminalの文字セットエンコーディングは、UTF-8にしておく。環境変数LANGは、一時的に、en_US.UTF-8に変更したり戻したりする場合があるが、その都度記述してある。
● デバイスの確認。
(この操作は、OCFS2ファイルシステムのフォーマットを実行するノードで行う。以下は、discus1から実行した例)
次のステップでOCFS2ファイルシステムのフォーマットを行うiSCSIターゲット名は、crs(CRS用に作成した論理ディスク)である。
iscsi-ls -lコマンドを実行すると、iqn.2006-01.com.openfiler:rac1.crsは、/dev/sde にマップされていることが確認できる。(起動毎にマップされるデバイスが変わってしまうことをお忘れなく!)
[root@discus1 ˜]# iscsi-ls -l
*******************************************************************************
SFNet iSCSI Driver Version ...4:0.1.11-3(02-May-2006)
*******************************************************************************
TARGET NAME : iqn.2006-01.com.openfiler:rac1.asm4
TARGET ALIAS :
HOST ID : 0
BUS ID : 0
TARGET ID : 0
TARGET ADDRESS : 192.168.2.5:3260,1
SESSION STATUS : ESTABLISHED AT 2006年 12月 29日 金曜日 22:09:40 JST
SESSION ID : ISID 00023d000001 TSIH 1600
DEVICE DETAILS:
---------------
LUN ID : 0
Vendor: Openfile Model: Virtual Model: disk Rev: 0
Type: Direct-Access ANSI SCSI revision: 04
page83 type1: 4f70656e66696c0000000000050000000b0800000e000000
page80: 0a
Device: /dev/sda
*******************************************************************************
・・・中略・・・
*******************************************************************************
TARGET NAME : iqn.2006-01.com.openfiler:rac1.crs
TARGET ALIAS :
HOST ID : 4
BUS ID : 0
TARGET ID : 0
TARGET ADDRESS : 192.168.2.5:3260,1
SESSION STATUS : ESTABLISHED AT 2006年 12月 29日 金曜日 22:09:40 JST
SESSION ID : ISID 00023d000001 TSIH 1900
DEVICE DETAILS:
---------------
LUN ID : 0
Vendor: Openfile Model: Virtual Model: disk Rev: 0
Type: Direct-Access ANSI SCSI revision: 04
page83 type1: 4f70656e66696c000000000001000000d20700000e000000
page80: 0a
Device: /dev/sde
*******************************************************************************次に、fdisk を実行する。/dev/sde1をOCFS2ファイルシステムでフォーマットする。
[root@discus1 ˜]# fdisk -l
Disk /dev/hda: 20.0 GB, 20000000000 bytes
255 heads, 63 sectors/track, 2431 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes
デバイス Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 2431 19422585 8e Linux LVM
・・・中略・・・
Disk /dev/sdd: 23.0 GB, 23085449216 bytes
64 heads, 32 sectors/track, 22016 cylinders
Units = シリンダ数 of 2048 * 512 = 1048576 bytes
デバイス Boot Start End Blocks Id System
/dev/sdd1 1 22016 22544368 83 Linux
Disk /dev/sde: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = シリンダ数 of 4154 * 512 = 2126848 bytes
デバイス Boot Start End Blocks Id System
/dev/sde1 1 1009 2095662 83 Linux
[root@discus1 ˜]#
● OCFS2ファイルシステムのフォーマット
(この操作は、Oracle RACを構成する1ノードで実施する。以下は、discus1から実行した例)
/dev/sde1をOCFS2ファイルシステムでフォーマットする。(他のパラメータは、OTN USの元記事であるOTN USの「16. Install & Configure Oracle Cluster File System (OCFS2)」と同じである。
[root@discus1 ˜]# mkfs.ocfs2 -b 4K -C 32K -N 4 -L oracrsfiles /dev/sde1
mkfs.ocfs2 1.2.1
Filesystem label=oracrsfiles
Block size=4096 (bits=12)
Cluster size=32768 (bits=15)
Volume size=2145943552 (65489 clusters) (523912 blocks)
3 cluster groups (tail covers 977 clusters, rest cover 32256 clusters)
Journal size=67108864
Initial number of node slots: 4
Creating bitmaps: done
Initializing superblock: done
Writing system files: done
Writing superblock: done
Formatting Journals: done
Writing lost+found: done
mkfs.ocfs2 successful
● OCFS2ファイルシステムのマウント
(この操作は、Oracle RACを構成する全ノードで実施、下記例は、discus1で実施した例)
[root@discus1 ˜]#
[root@discus1 ˜]# mount -t ocfs2 -o datavolume,nointr -L "oracrsfiles" /u02/oradata/orcl
[root@discus1 ˜]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/hda1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
configfs on /config type configfs (rw)
ocfs2_dlmfs on /dlm type ocfs2_dlmfs (rw)
/dev/sde1 on /u02/oradata/orcl type ocfs2 (rw,_netdev,datavolume,nointr,heartbeat=local)
[root@discus1 ˜]#
● OCFS2自動マウントの構成
(この操作は、Oracle RACを構成する全ノードで実施。下記例は、discus1で実施した例)
ja_JPだとviでの編集でカーソルがずれてしまうという現象に遭遇してまうので、環境変数LANGは、en_US.UTF-8に変更した。
[root@discus1 ˜]# export LANG=en_US.UTF-8
[root@discus1 ˜]# vi /etc/fstab
[root@discus1 ˜]# cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
LABEL=oracrsfiles /u02/oradata/orcl ocfs2 _netdev,datavolume,nointr 0 0
/dev/hdc /media/cdrom auto pamconsole,exec,noauto,managed 0 0
/dev/fd0 /media/floppy auto pamconsole,exec,noauto,managed 0 0
[root@discus1 ˜]#
特にja_JPに戻す必要性もないのだが、ja_JP.UTF-8に戻した。元ネタと違う日本語環境でやるところに意味がある!! なんてね。(笑)
[root@discus1 ˜]# export LANG=ja_JP.UTF-8
[root@discus1 ˜]# chkconfig --list o2cb
o2cb 0:off 1:off 2:on 3:on 4:on 5:on 6:off
● OCFS2ファイルシステムのパーミッション確認
(この操作は、Oracle RACを構成する全ノードで実施。下記例は、discus1で実施した例)
[root@discus1 ˜]# chown oracle:dba /u02/oradata/orcl
[root@discus1 ˜]# chmod 775 /u02/oradata/orcl
[root@discus1 ˜]# ls -ld /u02/oradata/orcl
drwxrwxr-x 3 oracle dba 4096 12月 29 22:59 /u02/oradata/orcl
[root@discus1 ˜]#
● O2CB Heartbeatのしきい値の調整
(この操作は、Oracle RACを構成する全ノードで実施。)
元ネタよりマシンスペック等が劣るため160秒になるように、O2CB_HEARTBEAT_THRESHOLDを81と設定した。[fence time in seconds] = (O2CB_HEARTBEAT_THRESHOLD - 1) * 2
[root@discus1 ˜]# cat /etc/sysconfig/o2cb
#
# This is a configuration file for automatic startup of the O2CB
# driver. It is generated by running /etc/init.d/o2cb configure.
# Please use that method to modify this file
#
# O2CB_ENABELED: 'true' means to load the driver on boot.
O2CB_ENABLED=true
# O2CB_BOOTCLUSTER: If not empty, the name of a cluster to start.
O2CB_BOOTCLUSTER=ocfs2
# O2CB_HEARTBEAT_THRESHOLD: Iterations before a node is considered dead.
O2CB_HEARTBEAT_THRESHOLD=81
[root@discus1 ˜]#変更したパラメータ値を反映させる。
[root@discus1 ˜]# umount /u02/oradata/orcl
[root@discus1 ˜]# /etc/init.d/o2cb unload
Cleaning heartbeat on ocfs2: OK
Stopping cluster ocfs2: OK
Unloading module "ocfs2": OK
Unmounting ocfs2_dlmfs filesystem: OK
Unloading module "ocfs2_dlmfs": OK
Unmounting configfs filesystem: OK
Unloading module "configfs": OK
[root@discus1 ˜]# /etc/init.d/o2cb configure
Configuring the O2CB driver.
This will configure the on-boot properties of the O2CB driver.
The following questions will determine whether the driver is loaded on
boot. The current values will be shown in brackets ('[]'). Hittingwithout typing an answer will keep that current value. Ctrl-C
will abort.
Load O2CB driver on boot (y/n) [y]: y
Cluster to start on boot (Enter "none" to clear) [ocfs2]: ocfs2
Writing O2CB configuration: OK
Loading module "configfs": OK
Mounting configfs filesystem at /config: OK
Loading module "ocfs2_nodemanager": OK
Loading module "ocfs2_dlm": OK
Loading module "ocfs2_dlmfs": OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK
Starting cluster ocfs2: OKパラメータの値が反映されているか確認する
[root@discus1 ˜]# cat /proc/fs/ocfs2_nodemanager/hb_dead_threshold
81
[root@discus1 ˜]#
最後に、boot時に自動マウントするかも確認しておく。
Oracle RACを構成する全ノードをリブートし/u02/oradata/orclがマウントされているか確認する。
[root@discus1 ˜]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/hda1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
configfs on /config type configfs (rw)
ocfs2_dlmfs on /dlm type ocfs2_dlmfs (rw)
/dev/sdd1 on /u02/oradata/orcl type ocfs2 (rw,_netdev,datavolume,nointr,heartbeat=local)
[root@discus1 ˜]# df -ah
Filesystem サイズ 使用 残り 使用% マウント位置
/dev/mapper/VolGroup00-LogVol00
17G 6.4G 9.1G 42% /
none 0 0 0 - /proc
none 0 0 0 - /sys
none 0 0 0 - /dev/pts
usbfs 0 0 0 - /proc/bus/usb
/dev/hda1 99M 9.1M 85M 10% /boot
none 252M 0 252M 0% /dev/shm
none 0 0 0 - /proc/sys/fs/binfmt_misc
sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs
configfs 0 0 0 - /config
ocfs2_dlmfs 0 0 0 - /dlm
/dev/sde1 2.0G 263M 1.8G 13% /u02/oradata/orcl
[root@discus1 ˜]#
[root@discus1 ˜]# cat /proc/fs/ocfs2_nodemanager/hb_dead_threshold
81リブートしても問題なくマウントされているようだ!(ほっ!)
おまけ。
OCFS2のバージョンを確認するには以下のようにする。
[root@discus1 ˜]# cat /proc/fs/ocfs2/version
OCFS2 1.2.3 Thu Aug 10 18:16:03 PDT 2006 (build 6b798aaadf626d3b137c3952809b2f38)
[root@discus1 ˜]#
| 固定リンク | 0
コメント