主机1进入到grid 用户:
在家目录下创建.ssh
[grid@RAC01 ~]$ mkdir .ssh
[grid@RAC01 ~]$ ll -a
total 9
drwx------ 4 grid oinstall 1024 May 1 16:46 .
drwxr-xr-x 5 root root 1024 May 1 14:23 ..
-rw------- 1 grid oinstall 123 May 1 15:15 .bash_history
-rw-r--r-- 1 grid oinstall 33 May 1 14:22 .bash_logout
-rw-r--r-- 1 grid oinstall 421 May 1 14:44 .bash_profile
-rw-r--r-- 1 grid oinstall 124 May 1 14:22 .bashrc
drwxr-xr-x 4 grid oinstall 1024 May 1 14:22 .mozilla
drwxr-xr-x 2 grid oinstall 1024 May 1 16:46 .ssh
[grid@RAC01 ~]$ cd .ssh/
[grid@RAC01 .ssh]$ touch authorized_keys
[grid@RAC01 .ssh]$ ll
total 0
-rw-r--r-- 1 grid oinstall 0 May 1 16:46 authorized_keys
[grid@RAC01 ~]$ chmod -R 700 .ssh
创建公钥和私钥:
[grid@RAC01 .ssh]$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/grid/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/grid/.ssh/id_dsa.
Your public key has been saved in /home/grid/.ssh/id_dsa.pub.
The key fingerprint is:
d2:3b:0e:fc:39:25:f3:57:82:a6:da:73:f8:f2:44:99 grid@RAC01
主机2同样配置:
[grid@RAC02 ~]$ mkdir .ssh
[grid@RAC02 ~]$ ls
[grid@RAC02 ~]$ ll -a
total 9
drwx------ 4 grid oinstall 1024 May 1 16:51 .
drwxr-xr-x 5 root root 1024 May 1 14:23 ..
-rw------- 1 grid oinstall 123 May 1 15:15 .bash_history
-rw-r--r-- 1 grid oinstall 33 May 1 14:22 .bash_logout
-rw-r--r-- 1 grid oinstall 421 May 1 14:44 .bash_profile
-rw-r--r-- 1 grid oinstall 124 May 1 14:22 .bashrc
drwxr-xr-x 4 grid oinstall 1024 May 1 14:22 .mozilla
drwxr-xr-x 2 grid oinstall 1024 May 1 16:51 .ssh
[grid@RAC02 ~]$ chmod 700 .ssh/
[grid@RAC02 ~]$ cd .ssh/
[grid@RAC02 .ssh]$ ls
[grid@RAC02 .ssh]$ touch authorized_keys
[grid@RAC02 .ssh]$ ll
total 0
-rw-r--r-- 1 grid oinstall 0 May 1 16:52 authorized_keys
[grid@RAC02 .ssh]$ chmod 700 authorized_keys
[grid@RAC02 .ssh]$ ll
total 0
-rwx------ 1 grid oinstall 0 May 1 16:52 authorized_keys
[grid@RAC02 .ssh]$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/grid/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/grid/.ssh/id_dsa.
Your public key has been saved in /home/grid/.ssh/id_dsa.pub.
The key fingerprint is:
71:34:96:66:03:9b:b6:1b:6e:43:81:a8:45:1f:f6:df grid@RAC02
两台主机都生成密钥后分发: 主机一分发操作:
[grid@RAC01 .ssh]$ cat id_dsa.pub >> authorized_keys
[grid@RAC01 .ssh]$ cat authorized_keys
ssh-dss AAAAB3NzaC1kc3MAAACBAPkZ9UVhXMqD+QET8IT5dT071YK/wS0jaKoFV2GGNMZIpTj/R98bg0zQJPkLqr6fHr7+qLG8zXdudA0k6BxjSOgAC0N21la2pYVNW6BLv4DSJL20XiTrzCdxQQChs5QnG+mfWVxeqMLdQnjNqrqO5Wmli1oni8/rnshdABpfmf3FAAAAFQDoomOjXgzvdh62iU3xR84eukbr+QAAAIBaj1vMnw9vlHu8dO2lzPwdb6nhYRzNR7+Kj28FTS7C32LaUZPGXf7XXF+d1zpOH98oSnE3mPSwDzNe4FeA1+il6BKkPl/cF8k3W+O39aDUApABTgOmZ6VWl42Q/p7CCfI+6dpS09fI4BVno9IoUpi2fhKd0O1mzq1dLnv+/s8R1QAAAIARscho8jZfNXxvMt1w8Yqpqsj/KXlpnCeaJQU3KzAnyAcT3X0Fr3Mn5lex4Rl06IZWHpR8Tm22NHG6yP/GDl+27hgqAUaR9mLCdlN+OO9JmSiCx83pzahWAaV/6B2ZAdJk9wWY5ANaYpWaAipeoTdOe3xyAajz2QFsOw9fGYW5yw== grid@RAC01
[grid@RAC01 .ssh]$ ssh RAC02 cat .ssh/id_dsa.pub >> authorized_keys
The authenticity of host 'rac02 (10.10.1.112)' can't be established.
RSA key fingerprint is 4e:86:06:c5:5d:de:e6:2e:79:1a:c2:64:a7:c5:60:82.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac02,10.10.1.112' (RSA) to the list of known hosts.
grid@rac02's password:
[grid@RAC01 .ssh]$
[grid@RAC01 .ssh]$
[grid@RAC01 .ssh]$ ls
authorized_keys id_dsa id_dsa.pub known_hosts
[grid@RAC01 .ssh]$ cat authorized_keys
ssh-dss AAAAB3NzaC1kc3MAAACBAPkZ9UVhXMqD+QET8IT5dT071YK/wS0jaKoFV2GGNMZIpTj/R98bg0zQJPkLqr6fHr7+qLG8zXdudA0k6BxjSOgAC0N21la2pYVNW6BLv4DSJL20XiTrzCdxQQChs5QnG+mfWVxeqMLdQnjNqrqO5Wmli1oni8/rnshdABpfmf3FAAAAFQDoomOjXgzvdh62iU3xR84eukbr+QAAAIBaj1vMnw9vlHu8dO2lzPwdb6nhYRzNR7+Kj28FTS7C32LaUZPGXf7XXF+d1zpOH98oSnE3mPSwDzNe4FeA1+il6BKkPl/cF8k3W+O39aDUApABTgOmZ6VWl42Q/p7CCfI+6dpS09fI4BVno9IoUpi2fhKd0O1mzq1dLnv+/s8R1QAAAIARscho8jZfNXxvMt1w8Yqpqsj/KXlpnCeaJQU3KzAnyAcT3X0Fr3Mn5lex4Rl06IZWHpR8Tm22NHG6yP/GDl+27hgqAUaR9mLCdlN+OO9JmSiCx83pzahWAaV/6B2ZAdJk9wWY5ANaYpWaAipeoTdOe3xyAajz2QFsOw9fGYW5yw== grid@RAC01
ssh-dss AAAAB3NzaC1kc3MAAACBAOJ9k9apcFIEs5g4nwhu2ZbsTsToDziruqCjwJC0OHvJt/89m7cJzfReRQOJw/mGmHUP1oG9iXn0bClQX4uAnJUut32EiKWKYo/orxWfnnzCQI20ovluWb/At5gk6/+V4PjjqpKkOihPS5BNjzO10hb7mm5zf6U9u4Og6Z8xXzEZAAAAFQC049s3KmjeJfQmmW6Xdd1UUqg7ZQAAAIEAwLSMX8nRV7/hFuP3J9jjjaScqqjKY855LzYmZcRwK+8fatIgTMdvzbtCQ8v0o4XgkxBVjmTpcoN3h8B8XudhCqtvGdjUTtPxRGoP71nw4gbXOlGLdbAuo+xIZ2pqpTNIs1itv/94J2tS9Dr6KhRJyEAbfpjUU+iawIcyX0MG6ksAAACBAKyDdSGIxNxUuEo2TqHSMtMpr/Wx2QYiz2VrevSeLv4W4UPrHPWGs1wjdon4ZB7E5XSXmRhzHxKBHz4ra6j0gZGsbRcWW2cmSlpOSI2FpYPv3s0Q4ck7br+eLRNL71JNopYNeXVMO1D4cDUhaFbtBMx8g1w5Bkf78GyOnfdPaETx grid@RAC02
主机2 分发操作:直接用scp 将auth文件拷贝过去
[grid@RAC01 .ssh]$ scp authorized_keys RAC02:~/.ssh
grid@rac02's password:
authorized_keys 100% 1200 1.2KB/s 00:00
[grid@RAC01 .ssh]$
主机2中文件内容变成和主机1中的一样:
配置完成后相互连接第一次需要输入yes,如果下一次不用 配置正确
[grid@RAC01 .ssh]$ ssh RAC02 date
Sun May 1 17:04:10 CST 2016
[grid@RAC01 .ssh]$ ssh RAC01 date
The authenticity of host 'rac01 (10.10.1.111)' can't be established.
RSA key fingerprint is 4e:86:06:c5:5d:de:e6:2e:79:1a:c2:64:a7:c5:60:82.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac01,10.10.1.111' (RSA) to the list of known hosts.
Sun May 1 17:04:16 CST 2016
[grid@RAC01 .ssh]$ ssh RAC01 date
Sun May 1 17:04:49 CST 2016
[grid@RAC01 .ssh]$ ssh RAC02 date
Sun May 1 17:04:52 CST 2016
[grid@RAC01 ~]$ ssh RAC02
[grid@RAC02 ~]$ ssh RAC01 date
Sun May 1 17:04:35 CST 2016
[grid@RAC02 ~]$ ssh RAC02 date
The authenticity of host 'rac02 (10.10.1.112)' can't be established.
RSA key fingerprint is 4e:86:06:c5:5d:de:e6:2e:79:1a:c2:64:a7:c5:60:82.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac02,10.10.1.112' (RSA) to the list of known hosts.
Sun May 1 17:04:39 CST 2016
[grid@RAC02 ~]$ ssh RAC02 date
Sun May 1 17:04:43 CST 2016
[grid@RAC02 ~]$ ssh RAC01 date
Sun May 1 17:04:45 CST 2016
RAC01priv RAC02priv 私有地址也需要认证一次
[grid@RAC02 .ssh]$ ssh RAC01priv date
The authenticity of host 'rac01priv (172.16.3.111)' can't be established.
RSA key fingerprint is 4e:86:06:c5:5d:de:e6:2e:79:1a:c2:64:a7:c5:60:82.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac01priv,172.16.3.111' (RSA) to the list of known hosts.
Sun May 1 17:15:06 CST 2016
[grid@RAC02 .ssh]$ ssh RAC02priv date
The authenticity of host 'rac02priv (172.16.3.112)' can't be established.
RSA key fingerprint is 4e:86:06:c5:5d:de:e6:2e:79:1a:c2:64:a7:c5:60:82.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac02priv,172.16.3.112' (RSA) to the list of known hosts.
Sun May 1 17:15:12 CST 2016
Grid 用户配置ssh完成。
ORACLE用户同样配置:
Su oracle:
配置和上面一样的ssh
上传 3个软件包:
root@RAC01 tmp]# ll li*
-rw-r--r-- 1 root root 1239269270 May 1 17:23 linux.x64_11gR2_database_1of2.zip
-rw-r--r-- 1 root root 1111416131 May 1 17:22 linux.x64_11gR2_database_2of2.zip
-rw-r--r-- 1 root root 1052897657 May 1 17:24 linux.x64_11gR2_grid.zip
解压grid软件,解压后移动到/u01目录下:
在grid用户下运行测试脚本:
[grid@RAC01 g]$ ./runcluvfy.sh stage -pre crsinst -n RAC01,RAC02 -fixup –verbose
检查结果有没有faile的 有的话修正后再安装。
提示我没有安装这个libaio这个包 安装即可:
缺的依赖关系包是 unixODBC-libs-2.2.11-10.el5.i386.rpm
[root@RAC02 Server]# rpm -ivh unixODBC-libs-2.2.11-10.el5.i386.rpm
warning: unixODBC-libs-2.2.11-10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:unixODBC-libs ########################################### [100%]
[root@RAC02 Server]# rpm -ivh unixODBC-2.2.11-10.el5.i386.rpm
warning: unixODBC-2.2.11-10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:unixODBC ########################################### [100%]
根据hosts文件里的vip 设置:如下
Ssh测试:输入密码 test 如果测试成功可以继续:
在主机1上先执行两个脚本,其他可以并行执行,最后一个和第一个主机需要单独执行:
如下为执行的输出:
[root@RAC01 grid]# ./root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
2016-05-02 13:01:33: Parsing the host name
2016-05-02 13:01:33: Checking for super user privileges
2016-05-02 13:01:33: User has super user privileges
Using configuration parameter file: /u01/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
root wallet
root wallet cert
root cert export
peer wallet
profile reader wallet
pa wallet
peer wallet keys
pa wallet keys
peer cert request
pa cert request
peer cert
pa cert
peer root cert TP
profile reader root cert TP
pa root cert TP
peer pa cert TP
pa peer cert TP
profile reader pa cert TP
profile reader peer cert TP
peer user cert
pa user cert
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
acfsroot: ACFS-9301: ADVM/ACFS installation can not proceed:
acfsroot: ACFS-9302: No installation files found at /u01/grid/install/usm/EL5/x86_64/2.6.18-8/2.6.18-8.el5uek-x86_64/bin.
CRS-2672: Attempting to start 'ora.gipcd' on 'rac01'
CRS-2672: Attempting to start 'ora.mdnsd' on 'rac01'
CRS-2676: Start of 'ora.gipcd' on 'rac01' succeeded
CRS-2676: Start of 'ora.mdnsd' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'rac01'
CRS-2676: Start of 'ora.gpnpd' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac01'
CRS-2676: Start of 'ora.cssdmonitor' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'rac01'
CRS-2672: Attempting to start 'ora.diskmon' on 'rac01'
CRS-2676: Start of 'ora.diskmon' on 'rac01' succeeded
CRS-2676: Start of 'ora.cssd' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'rac01'
CRS-2676: Start of 'ora.ctssd' on 'rac01' succeeded
ASM created and started successfully.
DiskGroup DATA created successfully.
clscfg: -install mode specified
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-2672: Attempting to start 'ora.crsd' on 'rac01'
CRS-2676: Start of 'ora.crsd' on 'rac01' succeeded
CRS-4256: Updating the profile
Successful addition of voting disk 434720e0bacb4fa7bfccc12497d3e54e.
Successfully replaced voting disk group with +DATA.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 434720e0bacb4fa7bfccc12497d3e54e (ORCL:DISK1) [DATA]
Located 1 voting disk(s).
CRS-2673: Attempting to stop 'ora.crsd' on 'rac01'
CRS-2677: Stop of 'ora.crsd' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac01'
CRS-2677: Stop of 'ora.asm' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac01'
CRS-2677: Stop of 'ora.ctssd' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'rac01'
CRS-2677: Stop of 'ora.cssdmonitor' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac01'
CRS-2677: Stop of 'ora.cssd' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac01'
CRS-2677: Stop of 'ora.gpnpd' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'rac01'
CRS-2677: Stop of 'ora.gipcd' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac01'
CRS-2677: Stop of 'ora.mdnsd' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.mdnsd' on 'rac01'
CRS-2676: Start of 'ora.mdnsd' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.gipcd' on 'rac01'
CRS-2676: Start of 'ora.gipcd' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'rac01'
CRS-2676: Start of 'ora.gpnpd' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac01'
CRS-2676: Start of 'ora.cssdmonitor' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'rac01'
CRS-2672: Attempting to start 'ora.diskmon' on 'rac01'
CRS-2676: Start of 'ora.diskmon' on 'rac01' succeeded
CRS-2676: Start of 'ora.cssd' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'rac01'
CRS-2676: Start of 'ora.ctssd' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'rac01'
CRS-2676: Start of 'ora.asm' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'rac01'
CRS-2676: Start of 'ora.crsd' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.evmd' on 'rac01'
CRS-2676: Start of 'ora.evmd' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'rac01'
CRS-2676: Start of 'ora.asm' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.DATA.dg' on 'rac01'
CRS-2676: Start of 'ora.DATA.dg' on 'rac01' succeeded
rac01 2016/05/02 13:07:25 /u01/grid/cdata/rac01/backup_20160502_130725.olr
Preparing packages for installation...
cvuqdisk-1.0.7-1
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
Updating inventory properties for clusterware
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 5999 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/oraInventory
'UpdateNodeList' was successful.
[root@RAC01 grid]#
点击ok继续执行:
Ins-20802错误没有关系,不影响使用
到此grid 软件安装完成:
使用如下命令检查运行情况:
Root用户下: ps –ef | grep grid
Grid 用户下执行:
[grid@RAC01 ~]$ crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
[grid@RAC01 ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.DATA.dg ora....up.type 0/5 0/ ONLINE ONLINE rac01
ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE rac01
ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac01
ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE rac01
ora.eons ora.eons.type 0/3 0/ ONLINE ONLINE rac01
ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE
ora....network ora....rk.type 0/5 0/ ONLINE ONLINE rac01
ora.oc4j ora.oc4j.type 0/5 0/0 OFFLINE OFFLINE
ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE rac01
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac01
ora....01.lsnr application 0/5 0/0 ONLINE ONLINE rac01
ora.rac01.gsd application 0/5 0/0 OFFLINE OFFLINE
ora.rac01.ons application 0/3 0/0 ONLINE ONLINE rac01
ora.rac01.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac01
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac02
ora....02.lsnr application 0/5 0/0 ONLINE ONLINE rac02
ora.rac02.gsd application 0/5 0/0 OFFLINE OFFLINE
ora.rac02.ons application 0/3 0/0 ONLINE ONLINE rac02
ora.rac02.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac02
ora.scan1.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac01
完成安装。
完成软件安装。
数据库安装完成。主机1为racdb1 主机2 为racdb2.
./crsctl stop cluster -all
./crsctl start cluster -all
启动关闭数据库:
srvctl start database -d racdb
srvctl stop database -d racdb
RAC状态巡检:
crsctl query css votedisk
srvctl status asm -a
crs_stat -t -v
如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!
赞0
添加新评论0 条评论