Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Centos6.5 + Oracle 11g R2 + nfs how to build RAC environment

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article is about Centos6.5 + Oracle 11g R2 + nfs how to build a RAC environment, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

Environmental requirements:

1.2machines with Centos6.5 system, one of which is nfs (hard disk size at least 4T)

two。 At least 2 network cards per machine

3. Prepare 5 available IP addresses (one is scan, the second is configured with public and private addresses)

4. Memory is at least 2G. 4G or higher is recommended.

Address Planning:

The first host: rac1 network card eth0 IP address: 172.16.0.1 ax 24 network card eth2 address: 192.168.1.192 Charpy 24

The first host: rac1 network card eth0 IP address: 172.16.0.2 peer24 network card eth2: 192.168.1.193 Compact 24

Virtual IP address: 192.168.1.200

Turn off ntp and configure the local source of yum

Shut down service # / etc/init.d/ntpd stop#chkconfig ntpd off#mv / etc/ntp.conf / etc/ntp.conf.org#mkdir / mnt/cdrom/#mount / dev/cdrom / mnt/cdrom/#vim / etc/yum.repos.d/CentOS-Media.reponame=CentOS-$releasever-Mediabaseurl= file:///mnt/cdrom/ gpgcheck=0enabled=1

Install dependent packages

# yum-y install binutils-2*.rpm\ compat-libstdc++-33*.rpm\ elfutils-libelf-0.*.rpm\ elfutils-libelf-devel-*.rpm\ gcc-4*.rpm\ gcc-c++-4*.rpm\ glibc-2.*.rpm\ glibc-common-2*.rpm\ glibc-devel-2*.rpm\ libaio-0*.rpmlibgcc-4*. Rpm\ libstdc++-4*.rpm\ libstdc++-devel*.rpm\ make-3*.rpm\ pdksh-*.rpm\ sysstat-7*.rpm\ libaio-devel-*.rpm\ unixODBC-2*.rpm\ unixODBC-devel-2*.rpm\

Configure the host file

# vim / etc/hosts#Public 172.16.0.1 rac1-priv 172.16.0.2 rac2-priv#Virtual 192.168.1.194 rac1-vip192.168.1.195 rac2-vip # Scan 192.168.1.200 rac-scan#NAS192.168.1.194 nas1

Modify kernel parameters

# vim / etc/sysctl.conf add fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 536870912kernel.shmmni = 4096kernel.sem = 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 = 1048576#sysctl-p at the end

Modify restrictions on file descriptors

# vi / etc/security/limits.conf oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536grid soft nproc 2047grid hard nproc 16384grid soft nofile 1024grid hard nofile 65536

Add pam_limits.so module

Vim / etc/pam.d/login adds session required pam_limits.so at the end

Add profile environment profile

# vim / etc/profile add if [$USER = "oracle"] | | [$USER = "grid"]; thenif [$SHELL = "/ bin/ksh"]; thenulimit-p 16384ulimit-n 65536elseulimit-u 16384-n 65536fiumask 022fi

Create users and groups and create corresponding passwords

# / usr/sbin/groupadd-g 501 oinstall#/usr/sbin/groupadd-g 502 dba#/usr/sbin/groupadd-g 503 oper#/usr/sbin/groupadd-g 504 asmadmin#/usr/sbin/groupadd-g 505 asmoper#/usr/sbin/groupadd-g 506 asmdba#/usr/sbin/useradd-g oinstall-Gdba,asmdba,oper oracle#/usr/sbin/useradd-g oinstall-Gasmadmin,asmdba,asmoper,oper,dba grid#passwd oracle#passwd grid

Create a directory and set the appropriate permissions

# mkdir-p / u01/app/oracle#chown-R oracle:oinstall/u01/app/oracle # chmod-R 775/u01/app/oracle # mkdir-p / u01/app/oracle/product/11.2.0/db_1#chown-R oracle:oinstall/u01/app/oracle/product/11.2.0/db_1#chmod-R 775/u01/app/oracle/product/11.2.0/db_1 # mkdir-p / u01/app/grid#chown-R grid. Oinstall/u01/app/ grid#chmod-R 775 / u01/app/grid#mkdir-p / u01/app/11.2.0/grid#chown-R grid:oinstall/u01/app/ 11.2.0/grid#chmod-R 775 / u01/app/11.2.0/grid# mkdir-p / u01/app/oraInventory#chown-R grid:oinstall/u01/app/oraInventory#chmod-R 775 / u01/app/oraInventory#mkdir-p / u01/oradata#mkdir-p / u01/shared _ config#chown-R oracle:oinstall / u01/oradata#chown-R grid:oinstall / u01/shared_config # chmod-R 775 / u01/oradata/u01/shared_config

Modify grid user environment variables

# su-grid$ vim / home/zkyg/.bash_profile alias df='df-h'alias du='du-sh'alias la='ls-lha'ORACLE_SID=NFS1; exportORACLE_ SIDJAVA_HOME=/usr/local/java; export JAVA_HOMEORACLE_BASE=/u01/app/grid; exportORACLE_BASEORACLE_HOME=/u01/app/11.2.0/grid; exportORACLE_HOMEORACLE_PATH=/u01/app/oracle/common/oracle/sql;export ORACLE_PATHORACLE_TERM=xterm; exportORACLE_ TERMNLS_DATE_FORMAT= "DD-MON-YYYYHH24:MI:SS" Export NLS_DATE_FORMATTNS_ADMIN=$ORACLE_HOME/network/admin;export TNS_ADMINORA_NLS11=$ORACLE_HOME/nls/data ExportORA_NLS11PATH=.:$ {JAVA_HOME} / bin:$ {PATH}: $HOME/bin:$ORACLE_HOME/binPATH=$ {PATH}: / usr/bin:/bin:/usr/bin/X11:/usr/local/binPATH=$ {PATH}: / u01/app/common/oracle/binexport PATHLD_LIBRARY_PATH=$ORACLE_HOME/libLD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: $ORACLE_HOME/oracm/libLD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: / lib:/usr/lib:/usr/local/ Libexport LD_LIBRARY_PATHCLASSPATH=$ORACLE_HOME/JRECLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/jlibCLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/rdbms/jlibCLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/network/jlibexport CLASSPATHTHREADS_FLAG=native Export THREADS_FLAGexport TEMP=/tmpexport TMPDIR=/tmpumask 022

Modify oracle user environment variables

Alias df='df-h'alias du='du-sh'alias la='ls-lha'ORACLE_SID=racdb1; exportORACLE_ SIDORACLE_UNQNAME=racdb; exportORACLE_ UNQNAMEJAVA_HOME=/usr/local/java; export JAVA_HOMEORACLE_BASE=/u01/app/oracle; exportORACLE_BASEORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1;export ORACLE_HOMEORACLE_PATH=/u01/app/common/oracle/sql;export ORACLE_PATHORACLE_TERM=xterm; exportORACLE_ TERMNLS_DATE_FORMAT= "DD-MON-YYYYHH24:MI:SS" Export NLS_DATE_FORMATTNS_ADMIN=$ORACLE_HOME/network/admin;export TNS_ADMINORA_NLS11=$ORACLE_HOME/nls/data ExportORA_NLS11PATH=.:$ {JAVA_HOME} / bin:$ {PATH}: $HOME/bin:$ORACLE_HOME/binPATH=$ {PATH}: / usr/bin:/bin:/usr/bin/X11:/usr/local/binPATH=$ {PATH}: / u01/app/common/oracle/binexport PATHLD_LIBRARY_PATH=$ORACLE_HOME/libLD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: $ORACLE_HOME/oracm/libLD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: / lib:/usr/lib:/usr/local/ Libexport LD_LIBRARY_PATHCLASSPATH=$ORACLE_HOME/JRECLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/jlibCLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/rdbms/jlibCLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/network/jlibexport CLASSPATHTHREADS_FLAG=native Export THREADS_FLAGexport TEMP=/tmpexport TMPDIR=/tmpumask 022

Configure ssh dual-machine trust (both for gird,oracle users) take oracle as an example

$ssh-keygen-t rsa$ ssh-keygen-t dsa $ssh-keygen-t rsa$ ssh-keygen-t dsa $cat .ssh / id_rsa.pub > > .ssh / authorized_keys$ cat .ssh / id_dsa.pub > > .ssh/authorized_keys$ ssh rac2 cat .ssh / id_rsa.pub > > .ssh / authorized_keys$ ssh rac2 cat .ssh / id_dsa.pub > > .ssh/authorized_keys$ scp.ssh/authorized_keys rac2:.ssh/authorized_keys

Test whether it is normal on two machines.

$ssh rac1 date$ssh rac2 date

The above operations need to be performed on both machines.

Configure nfs

The use of fdisk / dev/sdb on Rac1 is divided into 2 zones, sdb1, Sdb2 and format create a shared directory on # mkfs.ext3 / dev/sdb1#mkfs.ext3 / dev/sdb2rac1 # mkdir-p / shared_config#mkdir-p / shared_data#vi / etc/fstab add the following: / dev/sdb1 / shared_config ext3 defaults 0 0/dev/sdb2 / shared_data ext3 defaults 0 0#vi / etc/exports setup share / shared_config * (rw Sync,no_wdelay,insecure_locks,no_root_squash) / shared_data * (rw,sync,no_wdelay,insecure_locks,no_root_squash) # chkconfig nfs on enable nfs service # service nfs restart#vi / etc/fstab add the following boot mount the shared directory nas1:/shared_config / u01/shared_config nfs rw,bg,hard,nointr,noac,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0nas1:/shared_data / u01/oradata nfs rw,bg,hard,nointr,tcp Vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 00 mounts the corresponding directory # mount / u01/shared_config#mount / u01/oradata#chown grid:oinstall / u01/shared_config#chown oracle:oinstall / u01/oradata#chmod 775 / u01/oradata#chmod 775 / u01/app/11.2.0/grid

Install grid softwar

Unzip grid-XXX.zip enter xhost + # su-grid$cd grid-XXX$./runcluvfy.sh stage-pre crsinst-n rac1,rac2-fixup-verbose under root | tee check_grid.txt if the final prompt: the pre-check of the cluster service settings is successful. You can start installing grid or check where the failure is resolved and execute the command line again. Run the runInstaller$./ runInstaller under the installation directory above is Centos6.5 + Oracle 11g R2 + nfs how to build the RAC environment, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report