Solaris10下安裝Oracle10203RAC環境(一)

yangtingkun發表於2007-04-02

前一陣剛剛才測試環境下裝完Solaris 8下的ORACLE RAC。結果發現這次採購的F490硬體居然不支援Solaris 8。只好將作業系統升級到Solaris 10

前面已經對Solaris 8下的安裝進行了比較詳細的描述,這裡只是簡單記錄一下Solaris 10下的安裝步驟。和8類似的步驟會簡單帶過。


首先是建立使用者:

在第一個節點:

root@ahrac1 # groupadd oinstall
root@ahrac1 # groupadd dba
root@ahrac1 # mkdir -p /export/home/oracle
root@ahrac1 # useradd -g oinstall -G dba -d /export/home/oracle oracle
root@ahrac1 # chown oracle:oinstall /export/home/oracle
root@ahrac1 # mkdir /data
root@ahrac1 # chown oracle:oinstall /data
root@ahrac1 # passwd oracle

root@ahrac1 # id nobody
uid=60001(nobody) gid=60001(nobody)
root@ahrac1 # id oracle
uid=101(oracle) gid=101(oinstall)
root@ahrac1 # more /etc/group
root::0:
other::1:root
bin::2:root,daemon
sys::3:root,bin,adm
adm::4:root,daemon
uucp::5:root
mail::6:root
tty::7:root,adm
lp::8:root,adm
nuucp::9:root
staff::10:
daemon::12:root
sysadmin::14:
smmsp::25:
gdm::50:
webservd::80:
nobody::60001:
noaccess::60002:
nogroup::65534:
test::100:
oinstall::101:
dba::102:oracle

在節點二:

root@ahrac2 # groupadd -g 101 oinstall
root@ahrac2 # groupadd -g 102 dba
root@ahrac2 # mkdir -p /export/home/oracle
root@ahrac2 # useradd -u 101 -g oinstall -G dba -d /export/home/oracle oracle
root@ahrac2 # chown oracle:oinstall /export/home/oracle
root@ahrac2 # mkdir /data
root@ahrac2 # chown oracle:oinstall /data
root@ahrac2 # id nobody
uid=60001(nobody) gid=60001(nobody)
root@ahrac2 # passwd oracle

設定兩個節點的環境變數,注意節點二的環境變數中的ORACLE_SIDtradedb2

# su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ vi .profile
umask 022
ORACLE_SID=tradedb1
export ORACLE_SID
ORACLE_BASE=/data/oracle
export ORACLE_BASE
ORACLE_HOME=/data/oracle/product/10.2/database
export ORACLE_HOME
NLS_LANG='SIMPLIFIED CHINESE_CHINA.ZHS16GBK'
export NLS_LANG
PATH=$PATH:$ORACLE_HOME/bin
export PATH
DISPLAY=172.25.6.201:1.0
export DISPLAY

再上一篇文章中,介紹了透過rcp的方式配置遠端訪問方式,這篇給出配置ssh的方式。首先在兩個節點上執行下面的操作,產生ssh命令所需的key檔案:

# su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ mkdir .ssh
$ chmod 700 .ssh
$ /usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/oracle/.ssh/id_rsa.
Your public key has been saved in /export/home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
64:0a:45:ce:a6:de:8b:f7:ba:b3:15:87:38:46:f6:c7 oracle@ahrac1
$ /usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_rsa):
/export/home/oracle/.ssh/id_rsa already exists.
Overwrite (yes/no)? no
$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/oracle/.ssh/id_dsa.
Your public key has been saved in /export/home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
4f:58:55:da:5a:f1:11:3c:07:bb:84:44:1b:23:96:f0 oracle@ahrac1

$ touch .ssh/authorized_keys
$ cd .ssh
$ ls
authorized_keys id_dsa id_dsa.pub id_rsa id_rsa.pub

產生了key之後,利用ssh命令將key新增到authorized_keys檔案中,並複製到節點二:

$ ssh ahrac1 cat /export/home/oracle/.ssh/id_rsa.pub >> authorized_keys
The authenticity of host 'ahrac1 (172.25.198.42)' can't be established.
RSA key fingerprint is 29:d2:ab:dc:ff:a3:24:70:14:7a:8e:70:01:f7:be:46.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ahrac1,172.25.198.42' (RSA) to the list of known hosts.
Password:
$ ssh ahrac1 cat /export/home/oracle/.ssh/id_dsa.pub >> authorized_keys
Enter passphrase for key '/export/home/oracle/.ssh/id_rsa':
$ ssh ahrac2 cat /export/home/oracle/.ssh/id_rsa.pub >> authorized_keys
The authenticity of host 'ahrac2 (172.25.198.43)' can't be established.
RSA key fingerprint is 74:55:ef:49:2b:f4:a0:2c:52:44:83:09:ac:fb:b1:1b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ahrac2,172.25.198.43' (RSA) to the list of known hosts.
Password:
$ ssh ahrac2 cat /export/home/oracle/.ssh/id_dsa.pub >> authorized_keys
Password:
$ scp authorized_keys ahrac2:/export/home/oracle/.ssh/
Enter passphrase for key '/export/home/oracle/.ssh/id_rsa':
authorized_keys 100% |*********************************************************************************| 1652 00:00

操作完成後,在節點二上重複這個步驟,將最終的authorized_keys複製回節點一。

然後在兩個節點上分別修改authorized_keys的檔案屬性:

$ chmod 600 authorized_keys

為了ssh命令執行的時候不輸入密碼驗證,在需要啟動安裝程式的節點進行如下的設定(這個操作在重啟後失效,需要重啟系統後手工執行這個步驟)

$ exec /usr/bin/ssh-agent $SHELL
$ /usr/bin/ssh-add
Enter passphrase for /export/home/oracle/.ssh/id_rsa:
Identity added: /export/home/oracle/.ssh/id_rsa (/export/home/oracle/.ssh/id_rsa)
Enter passphrase for /export/home/oracle/.ssh/id_dsa:
Identity added: /export/home/oracle/.ssh/id_dsa (/export/home/oracle/.ssh/id_dsa)

下面可以驗證一下是否不需要輸入密碼執行ssh命令:

$ ssh ahrac1 date
Mon Mar 26 15:56:06 CST 2007
$ ssh ahrac2 date
Mon Mar 26 15:55:13 CST 2007

網路配置部分完成,下面檢查系統的硬體是否滿足安裝需要:

root@ahrac1 # /usr/sbin/prtconf | grep "Memory size"
Memory size: 32768 Megabytes
root@ahrac1 # /usr/sbin/swap -s
total: 298240k bytes allocated + 60184k reserved = 358424k used, 60398552k available
root@ahrac1 # df -k /tmp
Filesystem kbytes used avail capacity Mounted on
swap 60397080 224 60396856 1% /tmp
root@ahrac1 # /bin/isainfo -kv
64-bit sparcv9 kernel modules

內容需要1G以上,如果記憶體小於2G,則swap空間至少是記憶體的1.5倍,記憶體大於2G,則swap空間最小和記憶體大小相同。/tmp目錄需要至少400M空間。安裝Oracle的目錄至少需要5.2G以上的空間。使用isainfo檢查系統的架構,當前晶片是64SPARC

在兩個節點下分別0修改/etc/hosts檔案,新增public ipprivate ip,和vip

root@ahrac1 # vi /etc/hosts
#
# Internet host table
#
127.0.0.1 localhost
172.25.198.42 ahrac1 loghost
172.25.198.44 ahrac1-vip
10.0.0.3 ahrac1-priv
172.25.198.43 ahrac2
172.25.198.45 ahrac2-vip
10.0.0.4 ahrac2-priv

在兩個節點上新增預設的路由:

vi /etc/defaultrouter
172.25.2.1

新增主鍵的PRIVATE IP

root@ahrac1 # ifconfig ce1 plumb
root@ahrac1 # ifconfig ce1 10.0.0.3 netmask 255.255.255.0 broadcast 10.0.0.255 up
root@ahrac1 # vi /etc/hostname.ce1
ahrac1-priv

另一個節點執行類似的操作,新增其PRIVATE IP

修改兩個節點的預設子網掩碼,將第二IP的掩碼資訊加入:

root@ahrac2 # vi /etc/netmasks
"/etc/netmasks" [Read only] 15 lines, 379 characters
#
# The netmasks file associates Internet Protocol (IP) address
# masks with IP network numbers.
#
# network-number netmask
#
# The term network-number refers to a number obtained from the Internet Network
# Information Center.
#
# Both the network-number and the netmasks are specified in
# "decimal dot" notation, e.g:
#
# 128.32.0.0 255.255.255.0
#
172.25.0.0 255.255.0.0
10.0.0.0 255.255.255.0

檢查ncsd程式已經啟動:

root@ahrac1 # ps -ef|grep nscd
root 164 1 0 Mar 23 ? 0:10 /usr/sbin/nscd
root 16748 29168 0 16:24:45 pts/2 0:00 grep nscd

如果沒有啟動,可以使用/etc/init.d/nscd start來啟動。

下面檢查系統的軟體是否滿足安裝RAC的需要,檢查系統包是否安裝完畢:

root@ahrac1 # uname -a
SunOS ahrac1 5.10 Generic_118833-33 sun4u sparc SUNW,Sun-Fire-V490

root@ahrac1 # pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibC SUNWlibm SUNWlibms SUNWsprot SUNWtoo SUNWi1of SUNWxwfnt
system SUNWarc Lint Libraries (usr)
system SUNWbtool CCS tools bundled with SunOS
system SUNWhea SunOS Header Files
system SUNWi1of ISO-8859-1 (Latin-1) Optional Fonts
system SUNWlibC Sun Workshop Compilers Bundled libC
system SUNWlibm Math & Microtasking Library Headers & Lint Files (Usr)
system SUNWlibms Math & Microtasking Libraries (Usr)
system SUNWsprot Solaris Bundled tools
system SUNWtoo Programming Tools
system SUNWxwfnt X Window System platform required fonts

下面配置系統的核心引數,在兩個節點上修改/etc/system檔案:

root@ahrac1 # vi /etc/system

set noexec_user_stack=1
set semsys:seminfo_semmni=100
set semsys:seminfo_semmns=1024
set semsys:seminfo_semmsl=256
set semsys:seminfo_semvmx=32767
set shmsys:shminfo_shmmax=21474836479
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10

下面檢查UDP協議的配置:

root@ahrac1 # ndd /dev/udp udp_xmit_hiwat
57344
root@ahrac1 # ndd /dev/udp udp_recv_hiwat
57344

Solaris在這裡進行了最佳化,這個值已經很接近Oracle的推薦值了,這裡就不修改了。

下面重啟系統,安裝的準備工作到此結束。

root@ahrac1 # init 6

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/4227/viewspace-69227/,如需轉載,請註明出處,否則將追究法律責任。

相關文章