编程知识 cdmana.com

Creating Oracle RAC silent mode on alicloud

Prefabrication :

Xiaobian's success lies in Alibaba cloud To build Oracle RAC I spent it off and on 1 months , The process in the middle is painful , A lot of information on the Internet is based on graphical interface , There are also silent modes, but the steps are very rough , Maybe it takes too much time to write such a step . This article can be said to start from scratch , All the steps have screenshots . I hope I can help you . If you're just starting to touch RAC Please read every word carefully , Pay special attention to the tips , It can save you a lot of time

background :

The current database used by the company is Oracle standalone mode , To improve data availability . Need to build Oracle colony . So I started searching the Internet , build RAC There are many articles about , But most of them are based on virtual machines . The company's servers are all running in Alibaba cloud On , So we began to learn from the following great God's article , The article of Dashen is too bold and unconstrained , Details are not covered , All write this blog post

Reference documents :

https://yq.aliyun.com/articles/88303

Created on Alibaba cloud Oracle RAC- Silent mode two

Created on Alibaba cloud Oracle RAC- Silent mode three

Created on Alibaba cloud Oracle RAC- Silent mode 4

a key :

To get around Alibaba cloud Restrictions on multicast , Communication utilization of nodes in cluster N2N

step :

Resources to prepare

  a. ECS The server 2 platform , CentOS 6.8 x86-64

  b. Alibaba cloud Block storage 2 block  ( Up to now , Block storage is still in public beta , You need to submit an application to open , After I submitted my application, I waited 3 God , Let the work order be picked up later )

   20G For election ,250G For databases and Grid install

  c. Oracle as well as Grid The installation files ( edition :11g), The download address is as follows

     http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-linx8664soft-100572.html

  d. N2N Software

     https://github.com/ntop/n2n

e. ASM Software

  http://www.oracle.com/technetwork/server-storage/linux/asmlib/rhel6-1940776.html

1. Modify hostname

#vi /etc/sysconfig/network node 1# Created by anacondaNETWORKING=yesHOSTNAME=rac1NETWORKING_IPV6=noPEERNTP=noNOZEROCONF=yes node 2# Created by anacondaNETWORKING=yesHOSTNAME=rac2NETWORKING_IPV6=noPEERNTP=noNOZEROCONF=yes

 2. install Oracle Get ready , The node planning is completely copied from the reference document

Storage components are a little different from reference documents , This block must be very expensive in the future , So the production environment can be configured according to the size of the database . I am a 80*3=240G, So I applied for 250G Shared block storage for

Components

type

Volume size

ASM Volume group name

ASM redundancy

Device name

OCR/VF

ASM

5G

DG_OCR

NORMAL

/dev/vdb1,/dev/vdb2,/dev/vdb3

data & file

ASM

80G

DG_DATA

NORMAL

/dev/vdc1,/dev/vdc2,/dev/vdc3

  After the block storage is mounted :

Disk /dev/vda: 64.4 GB, 64424509440 bytes, 125829120 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0008d73a

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048   125827071    62912512   83  Linux

Disk /dev/vdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xf8683fec

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/vdc: 268.4 GB, 268435456000 bytes, 524288000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xdd02467a

   Device Boot      Start         End      Blocks   Id  System

3. install N2N Software

  # take N2N Software uploaded to Alibaba cloud The server

# Install... On both nodes N2Nunzip n2n-master.zip&nbsp;cd  n2n-mastermake # If make  Tips openssl error , install openssl( command : yum install -y openssl openssl-devel)make PREFIX=/opt/n2n install  Start after installation supernode service (N2N Support two supernode, I'm only at the node here 1 It opens up supernode)nohup /opt/n2n/sbin/supernode -l 65530 & # Use one of these nodes as N2N Of supernode, The nodes I use 1,  node 1/opt/n2n/sbin/edge -d edge0 -a 10.10.10.101 -s 255.255.255.0 -c dtstack -k dtstack -l 172.18.56.21:65530 -E -r # there 172.18.56.21 Is my ECS Server's eth0 Interface IP, That is to say supernode The real IP, If you have two supernode Can be directly in -l Add a second node to the parameter , Such as -l 172.18.56.21:65530,172.18.56.22:65530/opt/n2n/sbin/edge -d edge1 -a 192.168.100.101 -s 255.255.255.0 -c dtstack -k dtstack -l 172.18.56.21:65530 -E -r # After configuration, the node will have two more virtual network cards [root@rac1 n2n-master]# ifconfigedge0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1400        inet 10.10.10.101  netmask 255.255.255.0  broadcast 10.10.10.255        ether 4e:c7:9c:a7:73:95  txqueuelen 1000  (Ethernet)        RX packets 0  bytes 0 (0.0 B)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 0  bytes 0 (0.0 B)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 edge1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1400        inet 192.168.100.101  netmask 255.255.255.0  broadcast 192.168.100.255        ether 46:76:79:d8:1b:eb  txqueuelen 1000  (Ethernet)        RX packets 0  bytes 0 (0.0 B)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 0  bytes 0 (0.0 B)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500        inet 172.18.56.21  netmask 255.255.240.0  broadcast 172.18.63.255        ether 00:16:3e:08:48:66  txqueuelen 1000  (Ethernet)        RX packets 19861  bytes 24810887 (23.6 MiB)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 6122  bytes 2000836 (1.9 MiB)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  node 2 /opt/n2n/sbin/edge -d edge0 -a 10.10.10.102 -s 255.255.255.0 -c dtstack -k dtstack -l 172.18.56.21:65530 -E -r/opt/n2n/sbin/edge -d edge1 -a 192.168.100.102 -s 255.255.255.0 -c dtstack -k dtstack -l 172.18.56.21:65530 -E -r

4. modify /etc/hosts

 node 110.10.10.101 rac110.10.10.102 rac210.10.10.103 rac1-vip10.10.10.104 rac2-vip192.168.100.101 rac1-priv192.168.100.102 rac2-priv10.10.10.105 scan-ip#172.18.56.21 rac1 node 210.10.10.101 rac110.10.10.102 rac210.10.10.103 rac1-vip10.10.10.104 rac2-vip192.168.100.101 rac1-priv192.168.100.102 rac2-priv10.10.10.105 scan-ip#172.10.56.22 rac2

5. Modify kernel parameters

#vi /etc/sysctl.conffs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall =7864320 # Memory size /4096 Paging size  kernel.shmmax = 52451655680 # Memory size kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586vm.nr_hugepages = sga/pagesize  # Turn on hugepage,oracle Lock memory to prevent swapping out  #sysctl –p 

6. To configure NTP

#oracle rac Clock synchronization is necessary , Without clock synchronization , Configure as follows , Give Way oracle Solve it by yourself /sbin/service ntpd stopchkconfig ntpd offmv /etc/ntp.conf /etc/ntp.conf.org

7. Turn off firewall , Alibaba cloud automatic CentOS It's closed. It's fireproof , You're using a virtual machine , You need to run this step

chkconfig --list iptableschkconfig iptables offchkconfig --list iptablesservice iptables stopservice network restart close selinux/etc/selinux/configdisable

8. Modify user restrictions

#vi /etc/security/limits.conforacle           soft    nofile          4096oracle           hard   nofile          65536oracle           soft    nproc          2047oracle           hard   nproc          16384oracle           soft   stack          10240grid           soft    nofile          4096grid            hard   nofile          65536grid            soft    nproc          2047grid            hard   nproc          16384grid            soft   stack          10240*           soft   memlock         18874368*           hard   memlock          18874368

9. /etc/pam.d/login

echo "session    required     pam_limits.so" >>/etc/pam.d/login

10. Install required packages

 Generally, you need to install the following software package yum install -y compat-libstdc++-33yum install -y elfutils-libelf-develyum install -y gcc-c++yum install -y kshyum install -y libaio-develyum install -y libstdc++-develyum install -y libXpyum install -y numactl-develyum install -y unixODBCyum install -y unixODBC-develyum install -y compat-libcap1.x86_64

11. Format shared disk , This is a little different from the reference document , He is through 3 Block disk for redundancy , I draw three sections on a disk . If it's production hua Environmental Science , It is suggested to draw three plates , Divide the election disk and data disk into 3 Two different disks . Because it's a shared disk , This operation is performed on a node OK

[root@rac1 ~]# fdisk /dev/vdbWelcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them.Be careful before using the write command.  Command (m for help): nPartition type:   p   primary (0 primary, 0 extended, 4 free)   e   extendedSelect (default p): pPartition number (1-4, default 1): 1First sector (2048-41943039, default 2048): Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +5GPartition 1 of type Linux and of size 5 GiB is set Command (m for help): nPartition type:   p   primary (1 primary, 0 extended, 3 free)   e   extendedSelect (default p): pPartition number (2-4, default 2): First sector (10487808-41943039, default 10487808): Using default value 10487808Last sector, +sectors or +size{K,M,G} (10487808-41943039, default 41943039): +5GPartition 2 of type Linux and of size 5 GiB is set Command (m for help): nPartition type:   p   primary (2 primary, 0 extended, 2 free)   e   extendedSelect (default p): pPartition number (3,4, default 3): 3First sector (20973568-41943039, default 20973568): Using default value 20973568Last sector, +sectors or +size{K,M,G} (20973568-41943039, default 41943039): +5GPartition 3 of type Linux and of size 5 GiB is set Command (m for help): wThe partition table has been altered! Calling ioctl() to re-read partition table.Syncing disks.

[root@rac1 ~]# fdisk /dev/vdcWelcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them.Be careful before using the write command.  Command (m for help): nPartition type:   p   primary (0 primary, 0 extended, 4 free)   e   extendedSelect (default p): pPartition number (1-4, default 1): 1First sector (2048-524287999, default 2048): Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-524287999, default 524287999): +80GPartition 1 of type Linux and of size 80 GiB is set Command (m for help): nPartition type:   p   primary (1 primary, 0 extended, 3 free)   e   extendedSelect (default p): pPartition number (2-4, default 2): First sector (167774208-524287999, default 167774208): Using default value 167774208Last sector, +sectors or +size{K,M,G} (167774208-524287999, default 524287999): +80GPartition 2 of type Linux and of size 80 GiB is set Command (m for help): nPartition type:   p   primary (2 primary, 0 extended, 2 free)   e   extendedSelect (default p): pPartition number (3,4, default 3): First sector (335546368-524287999, default 335546368): Using default value 335546368Last sector, +sectors or +size{K,M,G} (335546368-524287999, default 524287999): +80GPartition 3 of type Linux and of size 80 GiB is set Command (m for help): wThe partition table has been altered! Calling ioctl() to re-read partition table.Syncing disks.[root@iZwz9igcce8m634htwm1xwZ ~]# fdisk -l Disk /dev/vda: 64.4 GB, 64424509440 bytes, 125829120 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x0008d73a    Device Boot      Start         End      Blocks   Id  System/dev/vda1   *        2048   125827071    62912512   83  Linux Disk /dev/vdb: 21.5 GB, 21474836480 bytes, 41943040 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0xf8683fec    Device Boot      Start         End      Blocks   Id  System/dev/vdb1            2048    10487807     5242880   83  Linux/dev/vdb2        10487808    20973567     5242880   83  Linux/dev/vdb3        20973568    31459327     5242880   83  Linux Disk /dev/vdc: 268.4 GB, 268435456000 bytes, 524288000 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0xdd02467a    Device Boot      Start         End      Blocks   Id  System/dev/vdc1            2048   167774207    83886080   83  Linux/dev/vdc2       167774208   335546367    83886080   83  Linux/dev/vdc3       335546368   503318527    83886080   83  Linux[root@rac1~]# 

12. install ASM, The installation here will upgrade kernel To el7( use CentOS 7 It should be better to install the cluster )

yum install -y http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.4-1.el6.x86_64.rpm

yum install -y http://oss.oracle.com/projects/oracleasm-support/dist/files/RPMS/rhel6/amd64/2.1.8/oracleasm-support-2.1.8-1.el6.x86_64.rpm

13. establish grid,oracle user (grid It's mainly used to manage clusters ,oracle It is mainly used to manage database , So I'll configure it later ASM Set the user to grid, Otherwise, there will be disk permission problems later )

/usr/sbin/groupadd -g 501 oinstall/usr/sbin/groupadd -g 502 asmadmin/usr/sbin/groupadd -g 503 dba/usr/sbin/groupadd -g 504 oper/usr/sbin/groupadd -g 505 asmdba/usr/sbin/groupadd -g 506 asmoper/usr/sbin/useradd -u 501 -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid/usr/sbin/useradd -u 502 -g oinstall -G dba,asmdba,oper oracle # Configure environment variables #Grid#vi /home/grid/.bash_profileumask 022export ORACLE_BASE=/u01/app/grid_baseexport ORACLE_HOME=/u01/app/grid_homeexport ORACLE_SID=+ASM1  # Second node +ASM2export PATH=/usr/sbin:$PATHexport PATH=$ORACLE_HOME/bin:$PATH #Oracle#vi /home/oracle/.bash_profileumask 022export ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1export ORA_GRID_HOME=/u01/app/grid_homeexport ORACLE_UNQNAME=OAODZ1  # Second node orcl2export ORACLE_SID=OAODZ1 # Second node orcl2export PATH=/usr/sbin:$PATHexport PATH=$ORACLE_HOME/bin:$PATHexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:/usr/libexport CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlibexport NLS_LANG=AMERICAN_AMERICA.ZHS16GBKexport NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"export TNS_ADMIN=$ORACLE_HOME/network/adminexport LANG=en_US.UTF-8

Is too long. , Go to the next one

版权声明
本文为[noosphere]所创,转载请带上原文链接,感谢
https://cdmana.com/2021/01/20210131193431235r.html

Scroll to Top