关于数据库:Oracle-10g-RAC-搭建部署

57次阅读

共计 2684 个字符,预计需要花费 7 分钟才能阅读完成。

测试环境介绍

节点名称 IP 地址(公网)IP 地址(私网)
orclrac1192.168.32.141192.168.49.182
orclrac2192.168.32.142192.168.49.183

kernel.x86_64 0:3.10.0-1160.36.2.el7
kmod-oracleasm.x86_64 0:2.0.8-28.el7

搭建部署布局

部署前筹备

敞开防火墙,虚拟化设置,办法略

建设用户和组(RAC 双节点)

[root@orclrac1 ~]# groupadd -g 1001 dba
[root@orclrac1 ~]# groupadd -g 1002 oinstall
[root@orclrac1 ~]# useradd -u 1001 -g oinstall -G dba oracle
[root@orclrac1 ~]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
[root@orclrac1 ~]# id oracle
uid=1001(oracle) gid=1002(oinstall) groups=1002(oinstall),1001(dba)
[root@orclrac1 ~]# id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody)

批改 /etc/hosts 文件(RAC 双节点)

[root@orclrac1 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

# rac-public-ip
192.168.32.141 orclrac1
192.168.32.142 orclrac2

# rac-vip
192.168.32.21 orclrac1-vip
192.168.32.22 orclrac2-vip

# rac-private-ip
192.168.49.182 orclrac1-priv
192.168.49.183 orclrac2-priv

配置用户等效性,免密拜访(RAC 双节点)

orclrac1

[root@orclrac1 ~]# su – oracle
[oracle@orclrac1 ~]$ mkdir .ssh
[oracle@orclrac1 ~]$ chmod 700 .ssh
[oracle@orclrac1 ~]$ cd .ssh/
[oracle@orclrac1 .ssh]$ ssh-keygen -t rsa

orclrac2

[root@orclrac2 ~]# su – oracle
[oracle@orclrac2 ~]$ mkdir .ssh
[oracle@orclrac2 ~]$ chmod 700 .ssh
[oracle@orclrac2 ~]$ cd .ssh/
[oracle@orclrac2 .ssh]$ ssh-keygen -t rsa

建设 authorized_keys 并批改权限

[oracle@orclrac1 .ssh]$ ls
id_rsa id_rsa.pub
[oracle@orclrac1 .ssh]$ ssh orclrac1 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
[oracle@orclrac1 .ssh]$ ssh orclrac2 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
[oracle@orclrac1 .ssh]$ scp authorized_keys orclrac2:/home/oracle/.ssh/
[oracle@orclrac1 .ssh]$ chmod 600 authorized_keys
[oracle@orclrac2 .ssh]$ chmod 600 authorized_keys

验证

[oracle@orclrac1 .ssh]$ ssh orclrac1 date
Fri Jul 23 21:25:07 PDT 2021
[oracle@orclrac1 .ssh]$ ssh orclrac2 date
Fri Jul 23 21:25:12 PDT 2021

[oracle@orclrac2 .ssh]$ ssh orclrac1 date
The authenticity of host ‘orclrac1 (192.168.32.141)’ can’t be established.
ECDSA key fingerprint is SHA256:5K5+icEUX2I3C6JQ8jTgHmQRWCSnLd1VosISh0nqSWw.
ECDSA key fingerprint is MD5:29:af:9c:d1:6b:79:e9:d4:1d:71:80:52:f3:a7:4f:e5.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘orclrac1,192.168.32.141’ (ECDSA) to the list of known hosts.
Fri Jul 23 22:10:37 PDT 2021
[oracle@orclrac2 .ssh]$ ssh orclrac2 date
The authenticity of host ‘orclrac2 (192.168.32.142)’ can’t be established.
ECDSA key fingerprint is SHA256:5K5+icEUX2I3C6JQ8jTgHmQRWCSnLd1VosISh0nqSWw.
ECDSA key fingerprint is MD5:29:af:9c:d1:6b:79:e9:d4:1d:71:80:52:f3:a7:4f:e5.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘orclrac2,192.168.32.142’ (ECDSA) to the list of known hosts.
Fri Jul 23 22:10:41 PDT 2021

正文完
 0