oracle19c rac, nfs deployment tutorial

This article is based on 19c deployment, using centos7.9, nfs as shared storage
1. First, network planning and configuration
There are three machines in this experiment, one is nfs, and the other two are rac
1. Each machine has at least 2 network cards, network card The names must be the same (publicip and VIP use the same network card, and privilegeip is another network card to change the ip, only for the connection between racs, you can add the route from the ip) 2. Prepare 5 available IP addresses (one is
scan , scan a configuration database will prompt warning information, and configure public and private addresses for each of the two configurations)
3. It is recommended to have a memory of 4G or more and a core of 4 cores or more (the experiment uses 4c8G to install and the system overhead is very high at the end)

4. Modify the hostname of the two hosts
[root@rac1] hostnamectl set-hostname rac1
[root@rac1] hostnamectl set-hostname rac2

5. Two machines add
10.8.88.210 rac1
10.8.88.211 rac2 in /etc/hosts

10.8.88.212 rac1-vip
10.8.88.213 rac2-vip

192.168.1.2 rac1-at
192.168.1.3 rac2-at

10.8.88.214 rac-scan

6. At this time, the private ip between the two machines is unreachable. Add a host route to achieve intercommunication
[root@rac1] route add -host 192.168.1.3 dev ens224
[root@rac2] route add -host 192.168.1.2 dev ens224

2. Install dependent packages (operate on both)
yum install -y bc binutils elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libXrender libX11 libXau libXi libXtst libgcc libnsl librdmacm libstdc++ lib stdc+±devel libxcb libibverbs make smartmontools sysstat nfs-utils net-tools xterm xclock
If you use asmlib for disk management, you need to install:
–Install the asm support package
yum -y install oracleasm-support --nogpgcheck
–Install the kernel module
yum -y install kmod-oracleasm --nogpgcheck
– Install the oracle asm library package (this package needs to be downloaded separately)
rpm -ivh oracleasmlib-2.0.12-1.el7.x86_64.rpm

3. Create users and user groups (operate on both)
create GRID groups
groupadd asmadmin
groupadd asmoper
groupadd asmdba

Create database groups
groupadd dba
groupadd oper
groupadd oinstall
groupadd backupdba
groupadd dgdba
groupadd kmdba
groupadd racdba

Create oracle user
useradd -g oinstall -G dba,oper,asmdba,backupdba,dgdba,kmdba,racdba oracle

Create grid user
useradd -g oinstall -G asmadmin,asmdba,asmoper,dba,racdba grid

Specify passwords for two users
echo oracle_4U |passwd --stdin oracle
echo grid_4U|passwd --stdin grid

4. Basic environment configuration (operate on both)

If you don’t delete it, you may get a network connection error during installation:
[INS-06006] Passwordless SSH connectivity not set up between the following node(s)
1. ifconfig virbr0 down
2. brctl delbr virbr0
3. systemctl disable libvirtd
4. Restart the virtual machine
5. Delete the original rm -rf /home/grid/.ssh file, re-Setup, Test

After the OS is installed by default, transparent huge page memory is used, as follows:
[root@dbserver ~]# cat /proc/meminfo |grep HugePages
AnonHugePages: 32768 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0

Modify the /etc/default/grub file, add transparent_hugepage=never at the end of the GRUB_CMDLINE_LINUX line, after modification, the others do not need to be moved
insert image description here

Modify kernel parameters:
vim /etc/sysctl.conf
kernel.shmmax = 8589934592 (this value can refer to 80%-90% of the actual memory)
kernel.shmmni = 4096
kernel.shmall = 2097152 (kernel.shmmax/kernel.shmmni)
kernel .sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 1048576
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
fs.file-max = 6815744
fs.aio-max-nr = 3145728

sysctl -p takes effect

Modify system limits:

vim /etc/security/limits.conf
grid soft nproc 8192
grid hard nproc 16384
grid soft nofile 8192
grid hard nofile 65536
grid soft stack 10240
oracle soft nproc 8192
oracle hard nproc 16384
oracle soft nofile 8192
oracle hard nofile 65536
oracle soft stack 10240

vim /etc/pam.d/login
session required /usr/lib64/security/pam_limits.so

5. Create user environment variables (operate on both)
su - grid
vim .bash_profile

export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/19.10.0/grid
export ORACLE_SID=+ASM1 (in rac1 /2 respectively set 1/2)
export PATH= ORACLEHOME / bin : ORACLE_HOME/bin:ORACLEHOMR / bin:PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib

su - oracle
vim .bash_profile
...
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME= ORACLEBASE/product/19.10.0/db 1 export ORACLESID=orclcdb 1 (set 1/2 on rac 1/2 respectively) export PATH=ORACLE_BASE /product/19.10.0/db_1 export ORACLE_SID=orclcdb1 set 1/2 respectively on rac1/2) export PATH=ORACLEBASE/product/19.10.0/db1exportORACLESID=orc l c d b 1 sets 1/2 on r a c 1/2 respectively ) e x p or tP A T H=ORACLE_HOME/bin: P A T H e x p o r t L D L I B R A R Y P A T H = PATH export LD_LIBRARY_PATH= PATHexportLDLIBRARYPATH=ORACLE_HOME/lib

– Create GI base directory
mkdir -p /u01/app/grid

– Create the main directory of GI
mkdir -p /u01/app/19.10.0/grid

– Create the database home directory
mkdir -p /u01/app/oracle/product/19.10.0/db_1

–Modify directory belongs to group
chown -R grid:oinstall /u01/app/
chown -R oracle:oinstall /u01/app/oracle

– Modify directory permissions
chmod -R 775 /u01/app

6. Install nfs to prepare shared storage
1. Execute yum install nfs-utils -y on the nfs server
2. [root@localhost ~]# more /etc/exports
/data *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
3 、 systemctl status nfs-server.service && systemctl enable nfs-server.service

4. Execute showmount -e xxx.xxx.xxx.xx on the rac machine to verify whether the mount directory can be seen normally

5. echo 'xxx.xxx.xxx.xxx:/data /data nfs rw,bg,hard,nointr,noac,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0 ' >> /etc/fstab && mount -a (do both)

6、准备文件(一台执行)
dd if=/dev/zero of=/data/asm1 bs=1024k count=15000
dd if=/dev/zero of=/data/asm2 bs=1024k count=15000
dd if=/dev/zero of=/data/asm3 bs=1024k count=15000
dd if=/dev/zero of=/data/asm4 bs=1024k count=15000
dd if=/dev/zero of=/data/asm5 bs=1024k count=15000
dd if=/dev/zero of=/data/asm6 bs=1024k count=15000

chown grid.asmadmin /data/*
chmod 777 /data/*

七、asmlib初始化
[root@rac1 ~]# oracleasm configure -i
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets (‘[]’). Hitting without typing an
answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface [grid]:
Default group to own the driver interface [asmadmin]:
Start Oracle ASM library driver on boot (y/n) [y]:
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done

[root@rac1 ~]# oracleasm init do an initialization

8. Grid installation
1. Grid users upload and decompress the grid installation package to $ORACLE_HOME
2. Install through xmanager or vnc
cd $ORACLE_HOME && ./gridSetup.sh
insert image description here
to create an independent cluster
Create a standalone cluster
Note that the scan-name here must be the same as The name of scan-ip in /etc/hosts should be the same.
insert image description here
Here I want to click Add to add rac2, then fill in the user’s password, click setup and test it (if it is different, delete the content in knowhost and try it out) here will be asm and
insert image description here
priip Use a network card
insert image description here
and choose asm for storage management.
insert image description here
It is recommended not to choose it for testing here. It is recommended to choose it for production. The MGMTDB database automatically managed by the cluster will be generated. Here,
insert image description here
choose external storage redundancy and pay attention to modifying the path of the storage file. Here, it refers to the creation of nfs sharing. The file is ready
insert image description here
, choose a unified password here,
insert image description here
and you don’t need to choose ipmi and oemcc in the last two steps

The asm user group
insert image description here
will be automatically filled according to the environment variable settings.
insert image description here
When installing, you need to use root privileges to execute some scripts, and you can directly write the root plane.
insert image description here
Finally, if there is a dns or scan-ip error, you can ignore it.

[grid@rac1 app]$ crsctl stat res -t Use this command to check whether the cluster installation is normal

9. Disk group addition
Execute asmca as grid user in xmanager or vnc,
select asm3/4 to create disk group DATA, and asm5/6 to create disk group FRA
[grid@rac1 app]$
insert image description here
After asmca is completed, you can see the disk group
insert image description here
here, pay attention to modify the grid user oracle belongs to the group, otherwise the oracle installation database cannot see the disk group
[grid@rac1 bin]$ ll ORACLEHOME / bin / oracle − rwsr − s − − x 1 gridoinstall 418591368 J un 1515 : 12 / u 01 / app / 19.10 .0 /grid/bin/oracle [ grid @ rac 1 bin ] ORACLE_HOME/bin/oracle -rwsr-s--x 1 grid oinstall 418591368 Jun 15 15:12 /u01/app/19.10.0/grid/bin/oracle [grid@rac1 bin]ORACLEHOME/bin/oracler w srsx1gridoinstall418591368Jun1515:12/u01/app/19.10.0/grid/bin/oracle[grid@rac1bin] chown grid.asmadmin $ORACLE_HOME/bin/oracle

For subsequent oracle database deployment steps, please refer to oracle 19c deployment

Guess you like

Origin blog.csdn.net/qq_39412605/article/details/131222962