RAC installation record-RHEL as4 RAC (ocfs2 + ASM)

Source: Internet
Author: User

 

Self-transferred personal blog http://www.inthirties.com

 

 

One customer wanted to upgrade to the RAC production system, so he forced himself to install RAC again. At the same time, he once reviewed some knowledge about RAC, I feel that my understanding of RAC is quite helpful.

The two machines are as follows:
HOST 1
Hostname: RHEL4-1
OS software RHEL4 as (2.6.9.0.78 elsmp Version)
Memory: 1024 MB

Host 2
Hostname: RHEL4-2
OS software RHEL4 as (2.6.9.0.78 elsmp Version)
Memory: 1024 MB

I did not get the production environment, so I did it in VMware first. Since it was VMWare, I had to install a virtual machine and then clone the preparation work to another system.

Step 1
First of all, install RHEL and use RHEL4 32bit on your hand.

Step 2
Two NICs are required to set the network configuration. Public, private, and virtual IP addresses are required.
This is a more careful study. We did not follow other steps to add only pri host and VIP host.
The real IP address is 192.168.2.206.
Hostname rhel4-1

192.168.3.20 6 rhel4-priv1
192.168.2.106 rhel4-vip1
VIP must be in the same IP segment as public. VIP is provided to Oracle. Here, two NICs correspond to public and private respectively.

Step 3
Create user
# Groupadd DBA
# Groupadd oinstall
# Useradd-G oinstall-g dba Oracle
# Passwd Oracle
# Mkdir/u01/APP/Oracle/product/10.2.0.2/db_1-P
Mkdir-P/u01/APP/Oracle
Chown-r ORACLE: oinstall/u01/APP/Oracle
Chmod-r 775/u01/APP/Oracle

Step 4
Modify related parameter files
Environment Variable Parameter/home/Oracle/. bash_profile

Export path
Unset Username
Export lang = zh_cn.euc
Oracle_base =/u01/APP/Oracle;
Export oracle_base
Export ORACLE_HOME = $ oracle_base/product/10.2.0.2/db_1
Export ora_crs_home = $ oracle_base/product/10.2.0.2/crs_1
Export oracle_sid = Rac1
# Export nls_lang = 'simplified chinese_china.zhs16gbk'
Path = $ ORACLE_HOME/bin:/sbin:/usr/bin:/usr/CCS/bin:/usr/local/bin:/usr/UCB;
Export path
LD_LIBRARY_PATH = $ ORACLE_HOME/lib: $ ORACLE_HOME/Network/lib: $ ORACLE_HOME/mongom/lib:/usr/local/lib:/usr/lib;
Export LD_LIBRARY_PATH
Export oracle_term = xterm
Export classpath = $ ORACLE_HOME/JRE: $ ORACLE_HOME/jlib: $ ORACLE_HOME/rdbms/jlib: $ ORACLE_HOME/Network/jlib
Export threads_flag = native
Export temp =/tmp
Export tmpdir =/tmp

Configure the Kernel Parameter/etc/sysctl. conf

Kernel. Shmall = 2097152
Kernel. shmmax = 2147483648
Kernel. shmmni = 4096
Kernel. SEM = 250 32000 100 128
FS. File-max = 65536
Net. ipv4.ip _ local_port_range = 1024 65000
Net. Core. rmem_default = 262144
Net. Core. wmem_default = 262144
Net. Core. rmem_max = 262144
Net. Core. wmem_max = 262144

#/Sbin/sysctl-P effective

Linux Account can use the number of processes and the number of opened files set limits/etc/security/limits. conf and/etc/PAM. d/login
/Etc/security/limits. conf
Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536
/Etc/PAM. d/login
Session required/lib/security/pam_limits.so

Disable SELinux/etc/grub. conf
Row after kernel/vmlinuz-2.6.9-42.ELlargesmp Ro root = label =/rhgb quiet
Join
SELinux = 0

Step 5
Load hangcheck-timer
Add/etc/rc. d/rc. Local
Modprobe hangcheck-timer hangcheck_tick = 30 hangcheck_margin = 180

Step 6
Equivalent configuration, log on with an oracle user
# Ssh-keygen-T RSA
Press ENTER
# Ssh-keygen-T DSA
Press ENTER
Keys and public keys are generated under '/. SSH
# Cat ~ /. Ssh/id_rsa.pub> ~ /. Ssh/authorized_keys
Run other machines after installation
SSH Oracle @ rhel4-2 cat ~ /. Ssh/id_rsa.pub> ~ /. Ssh/authorized_keys

Step 7 install ocfs2 and ASM
Download the ocfs2 and ASM software. The RAC plan here is ocfs2 and ASM. ASM is easier to manage than row device and has better performance than ocfs2, ocfs2 is mainly used for storage of CRS and voting disk, data files and files of other databases are stored on ASM.
Ocfs2 can be downloaded from OSS attention is the second version of the yo http://oss.oracle.com/projects/ocfs2/files/RedHat/ ocfs
ASM can download http://www.oracle.com/technology/software/tech/linux/asmlib/rhel4.html from OTN

Run uname-R to view your kernel. Find the version that is consistent with your own kernel for download.

The download here is
Ocfs2
Ocfs2-2.6.9-78.ELsmp-1.2.9-1.el4.i686.rpm
Ocfs2console-1.2.7-1.el4.i386.rpm
Ocfs2-tools-1.2.7-1.el4.i386.rpm

ASM
Oracleasm-2.6.9-78.ELsmp-2.0.5-1.el4.i686.rpm
Oracleasmlib-2.0.4-1.el4.i386.rpm
Oracleasm-support-2.1.3-1.el4.i386.rpm

Install
# Rpm-IVH ocfs2-tools-1.2.7-1.el4.i386.rpm
# Rpm-IVH ocfs2-2.6.9-78.ELsmp-1.2.9-1.el4.i686.rpm
# Rpm-IVH ocfs2-tools-1.2.7-1.el4.i386.rpm

# Rpm-IVH oracleasm-support-2.1.3-1.el4.i386.rpm
# Rpm-IVH oracleasmlib-2.0.4-1.el4.i386.rpm
# Rpm-IVH oracleasm-2.6.9-78.ELsmp-2.0.5-1.el4.i686.rpm

Step 8
Format hard disk
Add a hard drive for 10 Gb,/dev/SDB
Fdisk/dev/SDB
There are two zones. One is enough for MB for ocfs management, CRS and voting disk, and the other is ASM.

Ocfs2 deployment
# Ocfs2console
<1> On the ocfs2 console, click the "foramt" menu under "tasks" to format the partition to be formatted as an ocfs2 file system. Under the UI, select/dev/sdb1,
<2> In the ocfs2 console, select the "Configure nodes" menu under the "cluster" menu and configure the cluster nodes that use the ocfs2 file system. In the "node configuration" dialog box, click "add" to connect to the cluster node.
<3> apply. If there is an error, delete the cluster. conf file in the/etc/ocfs2 directory and create it again using the UI.
The last cluster. conf is
Node:
Ip_port = 7777
Ip_address = 192.168.3.202
Number = 0
Name = rhel4-2
Cluster = ocfs2
Node:
Ip_port = 7777
Ip_address = 192.168.3.201
Number = 1
Name = rhel4-1
Cluster = ocfs2
Cluster:
Node_count = 2
Name = ocfs2
<4> upload the configuration file to other nodes on node 1
# Ocfs2console
Select cluster> propagate Configuration
All are finished, and then file-> quit
The same cluster. conf can be seen on node 2.

<5> Configure o2cb
[Root @ rhel4-2 CRS] #/etc/init. d/o2cb enable
Writing o2cb configuration: OK
O2cb cluster ocfs2 already online

[Root @ rhel4-1 CRS] #/etc/init. d/o2cb enable
Writing o2cb configuration: OK
Starting o2cb cluster ocfs2: OK

[Root @ rhel4-2 CRS] #/etc/init. d/o2cb configure
Specify heartbeat dead threshold (> = 7) [31]: 61 set according to your own needs
Also configured on node 2.

[Root @ rhel4-2 CRS] #/etc/init. d/o2cb start

[Root @ rhel4-2 CRS] #/etc/init. d/o2cb status
Module "configfs": loaded
Filesystem "configfs": mounted
Module "ocfs2_nodemanager": loaded
Module "ocfs2_dlm": loaded
Module "ocfs2_dlmfs": loaded
Filesystem "ocfs2_dlmfs": mounted
Checking o2cb cluster ocfs2: Online
Heartbeat dead threshold: 61
Network idle Timeout: 30000
Network keepalive delay: 2000
Network reconnect delay: 2000
Checking o2cb heartbeat: Active

Load ocfs2 File System
Mount-T ocfs2-O _ netdev, datavolume, nointr/dev/sdb1/crsdata
If you have any questions, run the following command first.
Mkfs. ocfs2-B 4 K-C 32 K-N 4-l ora_home/dev/sdb1-FS-feature-level = max-compat

ASM deployment
View volumn
#/Etc/init. d/oracleasm listdisks

Configuration
#/Etc/init. d/oracleasm configure
Default User to own the driver interface []: Oracle
Default group to own the driver interface []: DBA
Other Default values

Create an ASM disk based on a file
#/Etc/init. d/oracleasm createdisk oradata/dev/sdb2-oradata disk volumn

#/Etc/init. d/oracleasm listdisks
Oradata

#/Etc/init. d/oracleasm status
Checking if ASM is loaded: Yes
Checking if/dev/oracleasm is mounted: Yes

# Mount
Oracleasmfs on/dev/oracleasm type oracleasmfs (RW)

Then you can install clusterware.

Common troubleshooting

At the end of installation, run crs_home/root. Sh as the root user,An error occurred.
PROT-1: failed to initialize ocrconfig
Failed to Upgrade Oracle cluster registry Configuration

The reason is that the mount is not good. For ocfs2, you can store, datafile, control file, redo file, archive file, CRS, and voting disk, but datavolume must be added during mount.
# Mount-T ocfs2-O datavolume/dev/sdb1/crsdata

The root. Sh is sometimes stored there.The difference is that crs and voting disk do not have a good format, format them again, and then load
# Ocfs2conosole
First umount, then format, and then load in the above method.

In root. sh install deamon, the following information is sometimes reported:
Running vipca (silent) for processing nodeapps
The given interface (s), "eth2" is not public. public interfaces shoshould be used
Configure Virtual IPS.

Run $ crs_home/bin/vipca again and set the VIP address.

Note:
Sometimes RAC installation fails. You must delete the CRS to install it. Otherwise, the OCR and votingdisk must be formatted and then mounted again.

 

========================================================== ======================================

Inthirties focuses on Oracle database maintenance, optimization, security, backup, recovery, migration, and troubleshooting

 

If you need help or want to learn with me, contact

Contact info. QQ: 370140387

QQ group: 85837884 (Note: database)

Email: dba@Inthirties.com

Website: http://www.inthirties.com

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.