VirtualBox2.2.4 のOracle Enterpriseで、1台のマシンに、11gRACをくんでみる(nfs) Clusterインストールまで。

ようやく、Clusterのインストールができました。
忘れないように、まとめてみる。


前に、セットアップしたVMを使用する。

VirtualBox2.2(Mac) のOracle Enterpriseに11gをいれてみる(1) - Guutaraの日記
VirtualBox2.2(Mac) のOracle Enterpriseに11gをいれてみる(2) - Guutaraの日記

  • NWは、VMの機能のうち「Host-Only Adapter」を使用する。
    • MacBook 192.168.56.1
    • VM Eth0 192.168.56.3 Eth1 19.168.56.4

MacBook側で、NFSDを動かして、VMでは、それを共有ディスクとして使用する。

  $sudo touch /etc/export
  $ sudo nfsd status
      nfsd service is disabled
      nfsd is not running
  $ sudo nfsd enable
  $ sudo nfsd status
      nfsd service is enabled
      nfsd is running (pid 397, 8 threads)
  • exportsを記入。
  $ cat /etc/exports
      /Users/oracle/Oracle_Linux  -mapall=oracle 192.168.56.3 192.168.56.4

-exportsのチェック。

  $ sudo nfsd checkexports
  • 何も、でていなければOK。

  • 再度、読み込ませる。
  $ sudo nfsd disable
  $ sudo nfsd status
     nfsd service is disabled
     nfsd is not running
  $ sudo nfsd enable
  $ sudo nfsd status
     nfsd service is enabled
     nfsd is running (pid 688, 8 threads)
  • 確認。
  $ showmount -e 192.168.56.1
      Exports list on 192.168.56.1:
      /Users/sekiya/Oracle_Linux         192.168.56.4 192.168.56.3 
  • VM側の設定。
 [oracle@rac1 ~]$ cat /etc/fstab 
      /dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
      LABEL=/boot             /boot                   ext3    defaults        1 2
      tmpfs                   /dev/shm                tmpfs   defaults        0 0
      devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
      sysfs                   /sys                    sysfs   defaults        0 0
      proc                    /proc                   proc    defaults        0 0
      /dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0

      192.168.56.1:/Users/sekiya/Oracle_Linux  /mnt/export/Oracle_Linux  nfs rw,bg,hard,nointr,noac,rsize=32768,wsize=32768

*1

  • インストール時の権限を合わせるために、ユーザのuidと、gidを、VMMacBookで同じにしておこう。MacBookでは、gidが20なので、VMのoinstallも、20に変更した。
  $ id
      uid=503(oracle) gid=20(staff) groups=20(staff),101(com.apple.sharepoint.group.1),98(_lpadmin),81(_appserveradm),  
  102(com.apple.sharepoint.group.2),79(_appserverusr),103(com.apple.sharepoint.group.3),80(admin)
  VM側
  [oracle@rac1 ~]$ id
      uid=503(oracle) gid=20(oinstall) 所属グループ=20(oinstall),502(dba)
  • VMでのインストール作業。インストールは、VMのコンソールでX画面から行う。この時に、1024の解析度でないとうまくいかなかったので、/etc/X11/xorg.confの Screenセクションを以下のように、mode追加。追加後、解析度を変更。
  Section "Screen"
          Identifier "Screen0"
          Device     "Videocard0"
          DefaultDepth     24
          SubSection "Display"
                  Viewport   0 0
                  Depth     24
          Modes   "1024x768" "800x600" "640x480"
          EndSubSection
  EndSection 
  • 環境のおさらい。sysctlの結果
  [root@localhost ~]# sysctl -p
      net.ipv4.ip_forward = 0
      net.ipv4.conf.default.rp_filter = 1
      net.ipv4.conf.default.accept_source_route = 0
      kernel.sysrq = 0
      kernel.core_uses_pid = 1
      net.ipv4.tcp_syncookies = 1
      kernel.msgmnb = 65536
      kernel.msgmax = 65536
      kernel.shmall = 268435456
      kernel.shmmax = 4294967295
      kernel.shmmni = 4096
      kernel.sem = 250        32000   100      128
      fs.file-max = 131070
      net.ipv4.ip_local_port_range = 32768    65000
      net.core.rmem_default = 4194304
      net.core.rmem_max = 4194304
      net.core.wmem_default = 262144
      net.core.wmem_max = 262144
      net.ipv4.tcp_wmem = 262144        262144   4194304
      net.ipv4.tcp_rmem = 4194304        4194304   4194304
  • SHELLの環境

[root@localhost ~]# cat /etc/profile

      # /etc/profile
      # System wide environment and startup programs, for login setup
      # Functions and aliases go in /etc/bashrc
      # Oracle Need
      if [ $USER = "oracle" ]; then
              if [ $SHELL = "/bin/ksh" ]; then
                    ulimit -p 16384
                    ulimit -n 65536
              else
                    ulimit -u 16384 -n 65536
              fi
      fi

      pathmunge () {
              if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
                 if [ "$2" = "after" ] ; then
                    PATH=$PATH:$1
                 else
                    PATH=$1:$PATH
                 fi
              fi
      }
      # ksh workaround
      if [ -z "$EUID" -a -x /usr/bin/id ]; then 
              EUID=`id -u`
              UID=`id -ru`
      fi
      # Path manipulation
      if [ "$EUID" = "0" ]; then
              pathmunge /sbin
              pathmunge /usr/sbin
              pathmunge /usr/local/sbin
      fi
      # No core files by default
      ulimit -S -c 0 > /dev/null 2>&1

      if [ -x /usr/bin/id ]; then
              USER="`id -un`"
              LOGNAME=$USER
              MAIL="/var/spool/mail/$USER"
      fi

      HOSTNAME=`/bin/hostname`
      HISTSIZE=1000

      if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
          INPUTRC=/etc/inputrc
      fi

      export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

      for i in /etc/profile.d/*.sh ; do
          if [ -r "$i" ]; then
              . $i
          fi
      done

      unset i
      unset pathmunge

[oracle@rac1 ~]$ cat ~/rac.env

      # Oracle Env
      #export LANG=ja_JP 
      export NLS_LANG=Japanese_Japan.JA16EUC 
      export ORACLE_BASE=/u01/app/oracle 
      export ORACLE_CRS_BASE=/u02/app/oracle 
      export ORACLE_HOME=$ORACLE_BASE/product/11.1.0 
      export ORA_CRS_HOME=$ORACLE_CRS_BASE/product/11.1.0/crs 
      export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:$PATH

[oracle@rac1 ~]$ cat ~/.bash_profile

      # .bash_profile

      # Get the aliases and functions
      if [ -f ~/.bashrc ]; then
              . ~/.bashrc
      fi

      #Oracle
      . ~/rac.env

      # User specific environment and startup programs

      PATH=$PATH:$HOME/bin

      export PATH
  • HostsにClusterに使用するIPとホスト名を記述しておく。

Hostsの設定
[oracle@rac1 ~]$ cat /etc/hosts

      # 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.56.3    rac1.jp.oracle.com  rac1
      192.168.56.103  rac1-vip.jp.oracle.com  rac1-vip
      192.168.56.4    rac1-priv.jp.oracle.com rac1-priv
  • SSHの設定を行う。インストール時に必要になる。


sshdの確認。

[root@rac1 ~]# pgrep sshd
      2190

設定開始。

  [oracle@rac1 ~]$ ls -al .ssh
      合計 16
      drwx------  2 oracle oracle 4096  4月  9 18:07 .
      drwx------ 19 oracle oracle 4096  6月 15 19:12 ..
      -rw-r--r--  1 oracle oracle  785  6月  2 20:56 known_hosts

  [oracle@rac1 ~]$ /usr/bin/ssh-keygen -t rsa
      Generating public/private rsa key pair.
      Enter file in which to save the key (/home/oracle/.ssh/id_rsa): 
      Enter passphrase (empty for no passphrase): 
      Enter same passphrase again: 
      Your identification has been saved in /home/oracle/.ssh/id_rsa.
      Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
      The key fingerprint is:
      64:f0:98:0c:ea:ef:59:e0:f5:81:dc:bd:29:bd:ff:f0 oracle@rac1.jp.oracle.com

  [oracle@rac1 ~]$ ssh rac1
      The authenticity of host 'rac1 (192.168.56.3)' can't be established.
      RSA key fingerprint is d4:c8:e0:5b:fd:c7:79:56:13:0f:9a:da:25:86:45:53.
      Are you sure you want to continue connecting (yes/no)? yes
      Warning: Permanently added 'rac1,192.168.56.3' (RSA) to the list of known hosts.
      oracle@rac1's password: 
      Last login: Mon Jun 15 18:49:01 2009

  [oracle@rac1 ~]$ cd .ssh
  [oracle@rac1 .ssh]$ cat id_rsa.pub >> authorized_keys
  [oracle@rac1 .ssh]$ ls
      authorized_keys  id_rsa  id_rsa.pub  known_hosts

  [oracle@rac1 .ssh]$ ssh rac1.jp.oracle.com date
      2009年  6月 19日 金曜日 19:34:03 JST
  [oracle@rac1 .ssh]$ ssh  rac1 date
      2009年  6月 19日 金曜日 19:34:16 JST
  • インストールを開始する。まずは、sshパスフレーズ入力なしの状態に持っていってから開始。
  [oracle@rac1 .ssh]$ exec /usr/bin/ssh-agent $SHELL
  [oracle@rac1 .ssh]$ /usr/bin/ssh-add
      Enter passphrase for /home/oracle/.ssh/id_rsa: 
      Identity added: /home/oracle/.ssh/id_rsa (/home/oracle/.ssh/id_rsa)
  • インストール媒体は、NFSでマウントした場所においた。そこへ移動後、まずは、チェックを走らす。
  [oracle@rac1 database]$ ./runcluvfy.sh stage -pre crsinst -n rac1.jp.oracle.com

      クラスタ・サービス設定の事前チェックを実行しています 

      ノード到達可能性をチェック中...
      ノード"rac1"からのノード到達可能性チェックに合格しました。

      ユーザー等価をチェック中...
      ユーザー"oracle"のユーザー等価チェックに合格しました。

      管理権限をチェック中...
      "oracle"のユーザーの存在チェックに合格しました。
      "oinstall"のグループの存在チェックに合格しました。
      グループ"oinstall"内のユーザー"oracle"[プライマリ]のメンバーシップ・チェックに合格しました。

      管理権限チェックに合格しました。

      ノード接続性をチェック中...

      ノードrac1を持つサブネット"192.168.56.0"のノード接続性チェックに合格しました。

      インタフェースがプライベート・インタコネクトの候補となるサブネット"192.168.56.0"で見つかりました:
      rac1 eth0:192.168.56.3

      インタフェースがプライベート・インタコネクトの候補となるサブネット"192.168.56.0"で見つかりました:
      rac1 eth1:192.168.56.4

      WARNING: 
      VIPに適したインタフェースのセットが見つかりませんでした。

      ノード接続性チェックに合格しました。


      システム要件をチェック中: 'crs'...
      メモリー合計チェックに合格しました。
      ディスク空き領域チェックに合格しました。
      スワップ領域チェックに合格しました。
      システム・アーキテクチャチェックに合格しました。
      カーネル・バージョンチェックに合格しました。
      "make-3.81"のパッケージの存在チェックに合格しました。
      "binutils-2.17.50.0.6"のパッケージの存在チェックに合格しました。
      "gcc-4.1.1"のパッケージの存在チェックに合格しました。
      "libaio-0.3.106"のパッケージの存在チェックに合格しました。
      "libaio-devel-0.3.106"のパッケージの存在チェックに合格しました。
      "libstdc++-4.1.1"のパッケージの存在チェックに合格しました。
      "elfutils-libelf-devel-0.125"のパッケージの存在チェックに合格しました。
      "sysstat-7.0.0"のパッケージの存在チェックに合格しました。
      "compat-libstdc++-33-3.2.3"のパッケージの存在チェックに合格しました。
      "libgcc-4.1.1"のパッケージの存在チェックに合格しました。
      "libstdc++-devel-4.1.1"のパッケージの存在チェックに合格しました。
      "unixODBC-2.2.11"のパッケージの存在チェックに合格しました。
      "unixODBC-devel-2.2.11"のパッケージの存在チェックに合格しました。
      "glibc-2.5-12"のパッケージの存在チェックに合格しました。
      "dba"のグループの存在チェックに合格しました。
      "oinstall"のグループの存在チェックに合格しました。
      "nobody"の既存ユーザーチェックに合格しました。

      システム要件が合格しました 'crs'

      クラスタ・サービス設定の事前チェックは成功しました。 
[oracle@rac1 database]$ ./runInstaller

Clusterをインストールすると、rootに所有者が変更されるので、別の所を指定します。

Hostsに書いてある内容でよければこのままで。

編集画面は、こんな感じ。

eth0をパブリックに指定します。

ocrって、するつもりが、crsってしちゃいました。。ま、今回は、これで勘弁しといたる。

このあと、画面表示のあるスクリプトをrootで流します。以下は、最後のスクリプト

  [root@rac1 ~]# /u02/app/oracle/product/11.1.0/crs/root.sh 
      WARNING: directory '/u02/app/oracle/product/11.1.0' is not owned by root
      WARNING: directory '/u02/app/oracle/product' is not owned by root
      WARNING: directory '/u02/app/oracle' is not owned by root
      WARNING: directory '/u02/app' is not owned by root
      Checking to see if Oracle CRS stack is already configured
      /etc/oracle does not exist. Creating it now.

      Setting the permissions on OCR backup directory
      Setting up Network socket directories
      Oracle Cluster Registry configuration upgraded successfully
      The directory '/u02/app/oracle/product/11.1.0' is not owned by root. Changing owner to root
      The directory '/u02/app/oracle/product' is not owned by root. Changing owner to root
      The directory '/u02/app/oracle' is not owned by root. Changing owner to root
      The directory '/u02/app' is not owned by root. Changing owner to root
      Successfully accumulated necessary OCR keys.
      Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
      node <nodenumber>: <nodename> <private interconnect name> <hostname>
      node 1: rac1 rac1-priv rac1
      Creating OCR keys for user 'root', privgrp 'root'..
      Operation successful.
      Now formatting voting device: /mnt/export/Oracle_Linux/vot/vot1
      Now formatting voting device: /mnt/export/Oracle_Linux/vot/vot2
      Now formatting voting device: /mnt/export/Oracle_Linux/vot/vot3
      Format of 3 voting devices complete.
      Startup will be queued to init within 30 seconds.
      Adding daemons to inittab
      Expecting the CRS daemons to be up within 600 seconds.
      Cluster Synchronization Services is active on these nodes. 
              rac1
      Cluster Synchronization Services is active on all the nodes. 
      Waiting for the Oracle CRSD and EVMD to start
      Waiting for the Oracle CRSD and EVMD to start
      Oracle CRS stack installed and running under init(1M)
      Running vipca(silent) for configuring nodeapps

      (1)ノードでVIPアプリケーション・リソースを作成しています..
      (1)ノードでGSDアプリケーション・リソースを作成しています..
      (1)ノードでONSアプリケーション・リソースを作成しています..
      (1)ノードでVIPアプリケーション・リソースを起動しています..
      (1)ノードでGSDアプリケーション・リソースを起動しています..
      (1)ノードでONSアプリケーション・リソースを起動しています..
      Done.

この後、もうひと画面あったんですが、割愛。。で、以下の画面がでたら、無事終了!!

この後、DBを作成しますが、今日はやんないよ!

*1:rw,bg,hard,nointr,noac,rsize=32768,wsize=32768 このオプションを指定しないと、インストールに失敗する。