赞
踩
1.公共网络:(Public IP )公共网络用于连接客户端和应用程序到数据库服务。在Oracle RAC中,公共网络通常使用标准的TCP/IP协议,通过标准的以太网交换机进行通信。公共网络可以使用单独的物理网卡或者虚拟网络接口(VNIC)实现。
2.专用网络:(Private IP)专用网络用于连接Oracle RAC集群中的各个节点之间。在Oracle RAC中,专用网络通常使用InfiniBand或者其他高速互连技术,以实现低延迟、高带宽的数据传输。专用网络可以使用单独的物理网卡或者虚拟网络接口(VNIC)实现。
[root@localhost ~]# hostnamectl set-hostname rac1 #rac也修改名称
[root@localhost ~]# vi /etc/hosts
rac2重复操作并把rac1中的hosts文件拷贝过来
修改(private ip)内部网络配置文件
rac1和rac2都操作,修改完成之后,重启网卡
[root@localhost ~]# ifdown ens256
Device 'ens256' successfully disconnected.
[root@localhost ~]# ifup ens256
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5)
/usr/sbin/groupadd -g 54321 oinstall /usr/sbin/groupadd -g 54322 dba /usr/sbin/groupadd -g 54323 oper /usr/sbin/groupadd -g 54324 backupdba /usr/sbin/groupadd -g 54325 dgdba /usr/sbin/groupadd -g 54326 kmdba /usr/sbin/groupadd -g 54327 asmdba /usr/sbin/groupadd -g 54328 asmoper /usr/sbin/groupadd -g 54329 asmadmin /usr/sbin/groupadd -g 54330 racdba /usr/sbin/useradd -u 54321 -g oinstall -G dba,asmdba,oper oracle /usr/sbin/useradd -u 54322 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,asmoper,asmadmin,racdba grid echo "oracle" | passwd --stdin oracle echo "grid" | passwd --stdin grid
mkdir -p /u01/app/19.3.0/grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle/product/19.3.0/db_1
chown -R grid:oinstall /u01
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/
systemctl stop firewalld.service
systemctl disable firewalld.service
sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config #关闭selinux
systemctl stop chronyd
systemctl disable chronyd
移除chrony配置文件:(必须移除,否则校验NTP失败)
mv /etc/chrony.conf /etc/chrony.conf.bak
systemctl stop avahi-daemon
systemctl disable avahi-daemon
vim /home/oracle/.bash_profile ORACLE_SID=cndba1;export ORACLE_SID ORACLE_UNQNAME=cndba;export ORACLE_UNQNAME JAVA_HOME=/usr/local/java; export JAVA_HOME ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/19.3.0/db_1; export ORACLE_HOME ORACLE_TERM=xterm; export ORACLE_TERM NLS_DATE_FORMAT="YYYY:MM:DDHH24:MI:SS"; export NLS_DATE_FORMAT NLS_LANG=american_america.ZHS16GBK; export NLS_LANG TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11 PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib export CLASSPATH THREADS_FLAG=native; export THREADS_FLAG export TEMP=/tmp export TMPDIR=/tmp umask 022
vim /home/grid/.bash_profile
PATH=$PATH:$HOME/bin
export ORACLE_SID=+ASM1
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/19.3.0/grid
export PATH=$ORACLE_HOME/bin:$PATH:/usr/local/bin/:.
export TEMP=/tmp
export TMP=/tmp
export TMPDIR=/tmp
umask 022
export PATH
cat >> /etc/security/limits.conf <<EOF grid soft nproc 2047 grid hard nproc 16384 grid soft nofile 1024 grid hard nofile 65536 grid soft stack 10240 grid hard stack 32768 oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 32768 oracle soft memlock 3145728 oracle hard memlock 3145728 EOF
cat >> /etc/pam.d/login <<EOF
session required pam_limits.so
EOF
echo "NOZEROCONF=yes" >>/etc/sysconfig/network
cat >> /etc/sysctl.d/sysctl.conf <<EOF fs.file-max = 6815744 kernel.sem = 250 32000 100 128 kernel.shmmni = 4096 kernel.shmall = 1073741824 kernel.shmmax = 4398046511104 kernel.panic_on_oops = 1 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576 net.ipv4.conf.all.rp_filter = 2 net.ipv4.conf.default.rp_filter = 2 fs.aio-max-nr = 1048576 net.ipv4.ip_local_port_range = 9000 65500 EOF sysctl -p
[root@localhost ~]# mkdir /yums [root@localhost ~]# cd /run/media/root/CentOS\ 7\ x86_64/Packages/ [root@localhost Packages]# cp * /yums [root@localhost Packages]# cd /yums [root@localhost yums]# createrepo . Spawning worker 0 with 1006 pkgs Spawning worker 1 with 1005 pkgs Spawning worker 2 with 1005 pkgs Spawning worker 3 with 1005 pkgs Workers Finished Saving Primary metadata Saving file lists metadata Saving other metadata Generating sqlite DBs Sqlite DBs complete [root@localhost yums]# cd /etc/yum.repos.d/ [root@localhost yum.repos.d]# rm -rf * [root@localhost yum.repos.d]# vim yum.local.repo [local] name=yum local repo baseurl=file:///yums gpgcheck=0 enable=1 [root@localhost yum.repos.d]# yum clean all Loaded plugins: fastestmirror, langpacks Cleaning repos: local Cleaning up list of fastest mirrors
下载需要的包
yum install -y bc yum install -y compat-libcap1* yum install -y compat-libcap* yum install -y binutils yum install -y compat-libstdc++-33 yum install -y elfutils-libelf yum install -y elfutils-libelf-devel yum install -y gcc yum install -y gcc-c++ yum install -y glibc-2.5 yum install -y glibc-common yum install -y glibc-devel yum install -y glibc-headers yum install -y ksh libaio yum install -y libaio-devel yum install -y libgcc yum install -y libstdc++ yum install -y libstdc++-devel yum install -y make yum install -y sysstat yum install -y unixODBC yum install -y unixODBC-devel yum install -y binutils* yum install -y compat-libstdc* yum install -y elfutils-libelf* yum install -y gcc* yum install -y glibc* yum install -y ksh* yum install -y libaio* yum install -y libgcc* yum install -y libstdc* yum install -y make* yum install -y sysstat* yum install -y libXp* yum install -y glibc-kernheaders yum install -y net-tools-*
compat-libstdc+±33-3.2.3-72.el7.x86_64、oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm这个包需要单独下载
[root@localhost opt]# ll total 131220 -rw-rw-rw-. 1 root root 195388 Jun 10 11:34 compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm -rw-rw-rw-. 1 root root 113475584 Jun 10 11:34 LINUX.X64_193000_db_home.zip -rw-rw-rw-. 1 root root 18204 Jun 10 11:34 oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm.rpm drwxr-xr-x. 2 root root 6 Oct 31 2018 rh [root@localhost opt]# rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm warning: compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:compat-libstdc++-33-3.2.3-72.el7 ################################# [100%] [root@localhost opt]# rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm.rpm warning: oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ################################# [100%] Updating / installing... 1:oracle-database-preinstall-19c-1.################################# [100%]
root账户
ssh-copy-id rac1
ssh-copy-id rac2
grid账户
ssh-copy-id rac1
ssh-copy-id rac2
oracle账户
ssh-copy-id rac1
ssh-copy-id rac2
lsblk查看磁盘情况
生成asm命名的磁盘
使用udev配置Asm磁盘
vi asm.sh //编辑脚本 #!/bin/bash for i in b c d e f g ; do echo "KERNEL==\"sd*\",ENV{DEVTYPE}==\"disk\",SUBSYSTEM==\"block\",PROGRAM==\"/usr/lib/udev/scsi_id -g -u -d \$devnode\",RESULT==\"`/usr/lib/udev/scsi_id -g -u /dev/sd$i`\", RUN+=\"/bin/sh -c 'mknod /dev/asmdisk$i b \$major \$minor; chown grid:asmadmin /dev/asmdisk$i; chmod 0660 /dev/asmdisk$i'\"" done chmod +x asm.sh ./asm.sh //运行脚本 KERNEL=="sd*",ENV{DEVTYPE}=="disk",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",RESULT=="36000c29726af9e28f0fff1eb68332efe", RUN+="/bin/sh -c 'mknod /dev/asmdiskb b $major $minor; chown grid:asmadmin /dev/asmdiskb; chmod 0660 /dev/asmdiskb'" KERNEL=="sd*",ENV{DEVTYPE}=="disk",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",RESULT=="36000c29489b1433445c0e319c861b453", RUN+="/bin/sh -c 'mknod /dev/asmdiskc b $major $minor; chown grid:asmadmin /dev/asmdiskc; chmod 0660 /dev/asmdiskc'" KERNEL=="sd*",ENV{DEVTYPE}=="disk",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",RESULT=="36000c29860c1a4c08b7344006cdf81bb", RUN+="/bin/sh -c 'mknod /dev/asmdiskd b $major $minor; chown grid:asmadmin /dev/asmdiskd; chmod 0660 /dev/asmdiskd'" KERNEL=="sd*",ENV{DEVTYPE}=="disk",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",RESULT=="36000c295280791ed04403e7f5fe4222a", RUN+="/bin/sh -c 'mknod /dev/asmdiske b $major $minor; chown grid:asmadmin /dev/asmdiske; chmod 0660 /dev/asmdiske'" KERNEL=="sd*",ENV{DEVTYPE}=="disk",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",RESULT=="36000c29b55e4b3acd130917d38bf2154", RUN+="/bin/sh -c 'mknod /dev/asmdiskf b $major $minor; chown grid:asmadmin /dev/asmdiskf; chmod 0660 /dev/asmdiskf'" KERNEL=="sd*",ENV{DEVTYPE}=="disk",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",RESULT=="36000c29fd176d048954f94dbd82bc1fd", RUN+="/bin/sh -c 'mknod /dev/asmdiskg b $major $minor; chown grid:asmadmin /dev/asmdiskg; chmod 0660 /dev/asmdiskg'" vi /etc/udev/rules.d/99-oracle-asmdevices.rules //把上面的运行脚本之后生成的内容复制到这个规则 udevadm control --reload //udevadm配置重载生效 udevadm trigger ll /dev/asm* ##两个节点是一样的哦~
上传安装包,修改权限
chown -R grid:oinstall LINUX.X64_193000_grid_home.zip
切换grid用户
安装cvuqdisk 两个节点都安装
节点一操作: ##root用户安装
cd /u01/app/19.3.0/grid/cv/rpm
rpm -ivh cvuqdisk-1.0.10-1.rpm
scp -p /u01/app/19.3.0/grid/cv/rpm/cvuqdisk-1.0.10-1.rpm rac2:/opt/
节点二操作:
cd /opt/
rpm -ivh cvuqdisk-1.0.10-1.rpm
运行安装脚本gridSetup.sh
配置集群的名称
scan name必须和 /etc/hosts里面scan的名字一样,cluster name 可以不改
添加节点2
保证心跳ip之间可以ping通
网段选择
一般的话会有一个virbr0网卡,自行百度删掉即可,或者在Use for中选择不使用选项
选择asm磁盘组
关于DNS的问题可以忽略,若是其他问题需要关注,否则后续会出现问题
当出现弹窗时,开始root用户执行脚本,先在rac1执行,然后在rac2执行,一共两个脚本,按照顺序,第二个脚本执行的比较慢,稍安勿躁
脚本执行结束之后,点击ok,安装,时间还是很漫长
有一个报错,能ping通scan ip就可以忽略
root用户修改db压缩包的属主属组
oracle用户解压压缩包
unzip LINUX.X64_193000_db_home.zip -d /u01/app/oracle/product/19.3.0/db_1/
出现弹窗执行脚本,按照顺序来执行
/u01/app/oracle/product/19.3.0/db_1/root.sh
在oracle账户下执行dbca
注意:数据库名称可以写别的,但是SID必须写和你设置的Oracle用户环境变量里边的ORACLE_SID一致!
勾选快速回复 开启归档日志
查看集群状态
使用客户端工具测试,连接正常
参考文档:
https://blog.csdn.net/weixin_36065860/article/details/105772692
https://www.cndba.cn/dave/article/4073
https://oracle-base.com/articles/19c/oracle-db-19c-rac-installation-on-oracle-linux-7-using-virtualbox
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。