你好,游客 登录 注册 搜索
背景:
阅读新闻

OCFS2+ASM 的RAC安装文档

[日期:2011-09-11] 来源:Linux社区  作者:tianlesoftware [字体:大 中 小]

15.先格式化分区 fdisk /dev/sdb,/dev/sdc,/dev/sdd,/dev/sde,/dev/sdf.

在一个结点执行格式化就可以了,因为他们是共享的。 

[root@rac1 init.d]# fdisk /dev/sdc

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel. Changes will remain in memory only,

until you decide to write them. After that, of course, the previous

content won't be recoverable.

 

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-130, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):

Using default value 130

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

 

在用fdisk -l 就会看到新的分区sdb1,sdc1,sdd1,sde1,sdf1

 

格式化分区:

在一个 node上 mkfs.ocfs2 -b 4k -C 32k -L oradatafiles /dev/sdb1 (就是前面创建的第一个vmdk) 

 

16. 在每个node上 

mount -t ocfs2 -o datavolume /dev/sdb1 /u02/oradata/orcl

 

若在第二个结点挂不上,把系统重启一下就可以了

 

在挂载之前,/etc/init.d/o2cb status 显示为Checking O2CB heartbeat: Not active。

在格式化和挂载文件系统之前,应验证 O2CB 在两个节点上均联机;O2CB 心跳当前没有

活动,因为文件系统还没有挂载 。挂载之后就会变成active。

 

问题1:若出现这样的错误,注意检查下防火墙是否关闭,关闭防火墙在看看。

o2net_connect_expired:1664 ERROR: no connection established with node 0 after 30.0 seconds, giving up and returning errors.

关闭防火墙命令:

1) 永久性生效,重启后不会复原
开启: chkconfig iptables on
关闭: chkconfig iptables off

2) 即时生效,重启后复原
开启: service iptables start
关闭: service iptables stop 

 

参考: Build Your Own Oracle RAC 10g Release 2 Cluster on Linux and FireWire 

http://blog.csdn.net/tianlesoftware/archive/2009/11/13/4805700.aspx

 

修改参数,让ocfs2 在系统启动时自动挂共享盘

Configure OCFS to Mount Automatically at Startup

修改你的 /etc/fstab , 添加 类似这样的行 

/dev/sdb1 /u02/oradata/orcl ocfs2 _netdev,datavolume 0 0 

到这里,我们的ocfs2 for OCR, CRS voting 就OK了 

 

RAC Ocfs2文件系统常见问题解决方法 

http://blog.csdn.net/tianlesoftware/archive/2009/11/13/4805727.aspx

 

 

17. 修改 /etc/sysconfig/o2cb 

把threshhold 的 值设置成 600 

[隔离时间(秒)] = (O2CB_HEARTBEAT_THRESHOLD - 1) * 2
(301 - 1) * 2 = 600 秒

 

为什么设成600,如果时间过短,会造成ocfs不能正常挂载。

 

具体参考:

解决 OCFS2 不能自动挂载 提示 o2net_connect_expired  

 

18. 在每个node上安装 ASMLibs, tools, support 三个rpm文件 

 

# rpm -ivh *.rpm --nodeps --force

 

然后运行 /etc/init.d/oracleasm configure 

回答 oracle , dba, y, y 就可以了 

 

19. 创建ASM 

在一个node上: 

通过以 root 用户身份运行以下命令来标记由 ASMLib 使用的磁盘:/etc/init.d/oracleasm createdisk DISK_NAME device_name 

(提示:DISK_NAME 应由大写字母组成。当前版本有一个错误,即假如使用小写字母,ASM 实例将无法识别磁盘。)

 

记住,ASM在linux下面处理的对象是 partition,不是disk, 所以你那些vmdk要linux 下面partition好才能用,所以先fdisk一下在创建. 

 

/etc/init.d/oracleasm createdisk VOL3 /dev/sdc1 

/etc/init.d/oracleasm createdisk VOL2 /dev/sdd1

 

 

创建好后, 在这个node 上运行 /etc/init.d/oracleasm listdisks 查看 

 

20. 在另外一个node 上 

/etc/init.d/oracleasm scandisks 

/etc/init.d/oracleasm listdisks 查看 

 

21. 在每个node上 

Su -oracle

Cd /home/oracle

修改 oracle用户家目录下的 .bash_profile 

 

注意ORACLE_SID, 和后面建库要一致。

 

# .bash_profile 

# Get the aliases and functions 

if [ -f ~/.bashrc ]; then 

. ~/.bashrc 

fi 

# User specific environment and startup programs 

PATH=$PATH:$HOME/bin

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1

export ORA_CRS_HOME=$ORACLE_BASE/product/crs

export ORACLE_SID=rac1

export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin

export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin

export PATH=${PATH}:$ORACLE_BASE/common/oracle/bin

export ORACLE_TERM=xterm

export TNS_ADMIN=$ORACLE_HOME/network/admin

export ORA_NLS10=$ORACLE_HOME/nls/data

export LD_LIBRARY_PATH=$ORACLE_HOME/lib

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib

export CLASSPATH=$ORACLE_HOME/JRE

export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib

export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib

export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib

export THREADS_FLAG=native

export TEMP=/tmp

export TMPDIR=/tmp

 

第二个节点的 ORACLE_SID=rac2 其他都一样 

 

 

二. 安装Oracle 10gR2 clusterware

 

1. 用Xmanager 软件连上虚拟机之后运行clusterware 的安装软件, Xmanager 支持图形界面, 所以能省很多事。 

注:若出现这样:libXp.so.6: cannot open shared object file 错误,安装下libXp包就可以了

 

2.确认你的安装目录是/u01/app/oracle/product/crs 

 

3. 增加相关结点信息 

rac1 rac1-priv rac1-vip 

rac2 rac2-priv rac2-vip 

 

4.指定 eth0 的类型时public 

 

5. 指定OCR 和 Voting Disk

一般而言,如果采用存储来存放OCR和Voting Disk. 存储本身就提供了redundancy策略,此时我们可以选择External Redundancy 选项, 此时Oracle 就不在考虑软件冗余了。 如果没有使用存储设备或者存储为RAID0,那么就可以使用Oracle 自己提供的软件冗余机制 Normal Redundancy 选项,此时就会激活Mirror Location 选项. 用来指定镜像文件位置, Oracle 的Clusterware在运行时会维护这个Mirror文件的内容同步。

 

OCR 最多只有一份冗余:

/u02/oradata/orcl/OCRFile 

/u02/oradata/orcl/OCRFile_mirror 

 

Voting Disk 最多可以定义2份冗余:

/u02/oradata/orcl/VotingFile 

/u02/oradata/orcl/VotingFile_mirror1 

/u02/oradata/orcl/VotingFile_mirror2 

 

7.然后就开始安装了,结束时会提示用root在每个节点上运行orainstRoot.Sh 和 root.Sh脚本, 在第二个结点上运行root.Sh 后自动调用vipca 这个命令, 在第二个结点运行root.Sh 之前要修改一下vipca命令, 不然可能会报错。 

 

RAC安装时需要执行4个脚本及意义 http://www.linuxidc.com/Linux/2011-05/36000.htm

 

 

注意: VIPCA 命令也是用ROOT 用户来运行的, 只需要在一个结点运行就可以了。

 

进入$CRS_HOME/bin/目录, 用vi来修改vipca 和 srvctl 2个命令。 

 

问题1: vipca报错,是RedHat的bug

Running vipca(silent) for configuring nodeapps

/home/oracle/crs/oracle/product/10/crs/jdk/jre//bin/java: error while loading 

shared libraries: libpthread.so.0: cannot open shared object file: 

No such file or directory

 

解决方法:

Remember to re-edit these files on all nodes: 

<CRS_HOME>/bin/vipca 

<CRS_HOME>/bin/srvctl 

<RDBMS_HOME>/bin/srvctl 

<ASM_HOME>/bin/srvctl 

 

after applying the 10.2.0.2 or 10.2.0.3 patchsets, as these patchset will still include those settings unnecessary for OEL5 or RHEL5 or SLES10.  This issue was raised with development and is fixed in the 10.2.0.4 patchsets. 

Note that we are explicitly unsetting LD_ASSUME_KERNEL and not merely commenting out its setting to handle a case where the user has it set in their environment (login shell). 

 

$ vi vipca 

... ... 

Linux) LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:$ORACLE_HOME/srvm/lib:$LD_LIBRARY_PATH 

       export LD_LIBRARY_PATH 

        echo $LD_LIBRARY_PATH 

        echo $CLASSPATH 

       #Remove this workaround when the bug 3937317 is fixed 

       arch=`uname -m` 

       if [ "$arch" = "i686" -o "$arch" = "ia64" ] 

       then 

        # LD_ASSUME_KERNEL=2.4.19    

        # export LD_ASSUME_KERNEL  

        echo  

       fi 

       #End workaround 

 

问题2: 如果遇到这个错误:

# vipca
Error 0(Native: listNetInterfaces:[3])
[Error 0(Native: listNetInterfaces:[3])]

解决方法:

在CRS_HOME下 运行 oifcfg 命令:

在rac1:

# ./oifcfg setif -global eth0/10.85.10.119:public
# ./oifcfg setif -global eth1/192.168.1.119:cluster_interconnect
# ./oifcfg getif
eth0 10.85.10.119 global public
eth1 192.168.1.119 global cluster_interconnect

 

在rac2:

/bin # ./oifcfg setif -global eth0/10.85.10.121:public
/bin # ./oifcfg setif -global eth1/192.168.1.121:cluster_interconnect
/bin # ./oifcfg getif
eth0 10.85.10.121 global public
eth1 192.168.1.121 global cluster_interconnect

 

然后在手工运行vipca添加nodeapps resource即可。

 

 

问题3:An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0xB7503E29
Function=__libc_free+0x49
Library=/lib/tls/libc.so.6

修改主机名不正确导致的。
RHEL
/etc/sysconfig/network 主机名,如果在/etc/hosts中解析不了。就报这个错误!

 

8. clusterware 就安装好了. 

 

确认一下. 

$ /u01/app/oracle/product/crs/bin/olsnodes -n 

rac1pub 1 

rac2pub 2 

$ ls -l /etc/init.d/init.* 

-r-xr-xr-x 1 root root 1951 Oct 4 14:21 /etc/init.d/init.crs* 

-r-xr-xr-x 1 root root 4714 Oct 4 14:21 /etc/init.d/init.crsd* 

-r-xr-xr-x 1 root root 35394 Oct 4 14:21 /etc/init.d/init.cssd* 

-r-xr-xr-x 1 root root 3190 Oct 4 14:21 /etc/init.d/init.evmd* 

 

检查CRS 安装启动情况:用Root用户执行:

$CRS_HOME/bin/crsctl check crs

CSS appears healthy

CRS appears healthy

EVM appears healthy

表明CRS 安装完成,并且启动成功

 

#./crs_stat -t -v

 

注:如果clusterware 安装失败,再次运行安装程序,里面可以把之前的安装删除掉,删除之后在进行安装。

linux
相关资讯       Oracle教程 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款