本篇文章给大家分享的是有关Centos6.5 + Oracle 11g r2 + nfs如何搭建RAC环境,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。
创新互联建站是一家专注于
网站设计制作、网站设计与策划设计,平凉网站建设哪家好?
创新互联建站做网站,专注于网站建设10年,网设计领域的专业建站公司;建站业务涵盖:平凉等地区。平凉做网站价格咨询:028-86922220
1.2台系统为Centos6.5的机器,其中 1台做nfs(硬盘大小至少4T)
2. 每台机器至少2块网卡
3. 准备5个可用的IP地址(一个为scan,二台配置各配置public和private地址)
4. 内存至少2G以下内存,建议使用4G或者更高
第一台主机:rac1 网卡eth0 IP地址:172.16.0.1/24 网卡eth2地址: 192.168.1.192/24
第一台主机:rac1 网卡eth0 IP地址:172.16.0.2/24 网卡eth2: 192.168.1.193/24
虚拟IP地址:192.168.1.200
关闭服务
#/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.repo
name=CentOS-$releasever - Media
baseurl=file:///mnt/cdrom/
gpgcheck=0
enabled=1
#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 \
#vim /etc/hosts
#Public
172.16.0.1 rac1-priv
172.16.0.2 rac2-priv
#Virtual
192.168.1.194 rac1-vip
192.168.1.195 rac2-vip
#Scan
192.168.1.200 rac-scan
#NAS
192.168.1.194 nas1
#vim /etc/sysctl.conf 在最后面添加
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
#sysctl -p
#vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
vim /etc/pam.d/login 在最后添加
session required pam_limits.so
#vim /etc/profile 在最后添加
if [ $USER = "oracle" ] || [$USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
#/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
创建目录并设置相应权限
#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
#su - grid
$ vim /home/zkyg/.bash_profile
alias df='df -h'
alias du='du -sh'
alias la='ls -lha'
ORACLE_SID=NFS1; export ORACLE_SID
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/u01/app/grid; exportORACLE_BASE
ORACLE_HOME=/u01/app/11.2.0/grid; exportORACLE_HOME
ORACLE_PATH=/u01/app/oracle/common/oracle/sql;export ORACLE_PATH
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="DD-MON-YYYYHH24:MI:SS"; export NLS_DATE_FORMAT
TNS_ADMIN=$ORACLE_HOME/network/admin;export TNS_ADMIN
ORA_NLS11=$ORACLE_HOME/nls/data; exportORA_NLS11
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=${PATH}:/u01/app/common/oracle/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
alias df='df -h'
alias du='du -sh'
alias la='ls -lha'
ORACLE_SID=racdb1; export ORACLE_SID
ORACLE_UNQNAME=racdb; export ORACLE_UNQNAME
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/u01/app/oracle; exportORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1;export ORACLE_HOME
ORACLE_PATH=/u01/app/common/oracle/sql;export ORACLE_PATH
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="DD-MON-YYYYHH24:MI:SS"; export NLS_DATE_FORMAT
TNS_ADMIN=$ORACLE_HOME/network/admin;export TNS_ADMIN
ORA_NLS11=$ORACLE_HOME/nls/data; exportORA_NLS11
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=${PATH}:/u01/app/common/oracle/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
$ 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
$ssh rac1 date
$ssh rac2 date
以上操作需要在二台机器都要操作
Rac1上使用fdisk /dev/sdb 分2个区sdb1、sdb2并进行格式化
#mkfs.ext3 /dev/sdb1
#mkfs.ext3 /dev/sdb2
rac1上创建共享目录
#mkdir -p /shared_config
#mkdir -p /shared_data
#vi /etc/fstab 添加以下:
/dev/sdb1 /shared_config ext3 defaults 0 0
/dev/sdb2 /shared_data ext3 defaults 0 0
#vi /etc/exports 设置共享
/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开启nfs服务
#service nfs restart
#vi /etc/fstab添加以下开机挂载共享目录
nas1:/shared_config /u01/shared_config nfs rw,bg,hard,nointr,noac,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0
nas1:/shared_data /u01/oradata nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0
挂载相应的目录
#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
unzip grid-XXX.zip
在root下输入xhost +
#su – grid
$cd grid-XXX
$./runcluvfy.sh stage-pre crsinst -n rac1,rac2 -fixup -verbose | tee check_grid.txt
如果最后提示:集群服务设置的预检查成功.可以开始去安装 grid 否则请查看失败在什么地方解决后再次执行该命令行来检查.
运行安装目录下的runInstaller
$./ runInstaller
以上就是Centos6.5 + Oracle 11g r2 + nfs如何搭建RAC环境,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注创新互联行业资讯频道。
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
文章标题:Centos6.5+Oracle11gr2+nfs如何搭建RAC环境-创新互联
文章网址:
http://azwzsj.com/article/jpjio.html