ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 使用10gR2 CRS搭建HA环境 & 一些测试结果

使用10gR2 CRS搭建HA环境 & 一些测试结果

原创 Linux操作系统 作者:westzq1984 时间:2013-07-03 17:08:03 0 删除 编辑
本文只是简单的功能性测试

1.1根心跳线
断了就发生驱逐,磁盘心跳不足以支撑集群

2.2根心跳线
只要有1个通就OK,可以配置多个心跳,所有网络设置为cluster_interconnect

3.public网卡宕
资源飘到正常节点

4.单实例是否依赖CRS
DB软件在rac_on模式需要,rac_off模式不需要

5.如何设置资源的主节点
-p favored -h "nodename"
 
6.如何设置资源在主节点恢复后,自动飘回来
-o ap=1

7.PUBLIC添加备份网卡
原生的VIP可以添加,Define VIP with multiple interfaces to allow the failover capability [ID 783633.1]
自己添加的HAIP资源如何搞,还需要研究

8.脚本配置注意
stop资源的脚本,必须要确保返回为0
否则资源将进入unknow的状态,需要人工介入

/u01/app/oracle/product/crs/bin/crs_profile -create db01vip -t application -a /u01/app/oracle/product/crs/bin/usrvip -o i=eth1,ov=83.16.16.33,on=255.255.255.0
/u01/app/oracle/product/crs/bin/crs_register db01vip
/u01/app/oracle/product/crs/bin/crs_setperm db01vip -o root
/u01/app/oracle/product/crs/bin/crs_setperm db01vip -u user:oracle:r-x
/u01/app/oracle/product/crs/bin/crs_start db01vip

/u01/app/oracle/product/crs/bin/crs_profile -create fs_database1 -t application -d "Filesystem data1" -r db01vip -a /u01/app/oracle/product/crs/crs/public/action_FS_database1.scr -o ci=5,ra=60
/u01/app/oracle/product/crs/bin/crs_register fs_database1
/u01/app/oracle/product/crs/bin/crs_setperm fs_database1 -o root
/u01/app/oracle/product/crs/bin/crs_setperm fs_database1 -u user:oracle:r-x
/u01/app/oracle/product/crs/bin/crs_start fs_database1

/u01/app/oracle/product/crs/bin/crs_profile -create oradb01 -t application -d "Oracle instance 01" -r "db01vip fs_database1" -a /u01/app/oracle/product/crs/crs/public/action_DB_db01.scr -h "westzq3" -p favored -o ci=5,ra=60,ap=1
/u01/app/oracle/product/crs/bin/crs_register oradb01
/u01/app/oracle/product/crs/bin/crs_setperm oradb01 -o root
/u01/app/oracle/product/crs/bin/crs_setperm oradb01 -u user:oracle:r-x
/u01/app/oracle/product/crs/bin/crs_start oradb01

[root@westzq3 public]# cat action_FS_database1.scr
#!/bin/sh
# *****************************************************************
# *                                                               *
# *    Copyright (c) 2002, 2003 Oracle Corporation.               *
# *         All rights reserved.                                  *
# *                                                               *
# *    Copyright (c) 1991, 1999, 2002 Digital Equipment           *
# *                  Corporation                                  *
# *                                                               *
# *                                                               *
# *   All Rights Reserved.  Unpublished rights  reserved  under   *
# *   the copyright laws of the United States.                    *
# *                                                               *
# *   The software contained on this media  is  proprietary  to   *
# *   and  embodies  the  confidential  technology  of  Digital   *
# *   Equipment Corporation and Oracle Corporation.  Possession,  *
# *   use, duplication or dissemination of the software           *
# *   and media is authorized only pursuant to a valid written    *
# *   license from Digital Equipment Corporation and Oracle       *
# *   Corporation                                                 *
# *                                                               *
# *   RESTRICTED RIGHTS LEGEND   Use, duplication, or disclosure  *
# *   by the U.S. Government is subject to restrictions  as  set  *
# *   forth in Subparagraph (c)(1)(ii)  of  DFARS  252.227-7013,  *
# *   or  in  FAR 52.227-19, as applicable.                       *
# *                                                               *
# *                                                               *
# *****************************************************************
#

SCRIPT=$0
ACTION=$1                     # Action (start, stop or check)

#########################################################################
#
# Main section of Action Script. - starts, stops, or checks an application
#       
# This script. is invoked by CRS when managing the application associated
# with this script.
#
# Argument:  $1 - start | stop | check
#
# Returns:   0 - successful start, stop, or check
#            1 - error
#
#########################################################################

#
# Start section - start the process and report results
#
# If the Application Startup Commands (see description above) were used,
# little, if any modifications are needed in this section.  If not used,
# you may replace most of the contents in this section with your own
# start procedure code.
#

case $1 in
'start')
    /bin/mount /dev/mapper/oravg-lv_db01 /database1
    exit $?
    ;;

#
# Stop section - stop the process and report results
#
# If the Application Stop Commands or Associated Processes (see descriptions
# above) were used,little, if any modifications are needed in this section.
# If not used, you may replace most of the contents in this section with
# your own stop procedure code.
#

'stop')
    umount /database1
    exit $?
    ;;

#
# Check section - check the process and report results
#
#
# Your application might allow you to implement more accurate process
# checking.  If so, you may choose to implement that code here. 
#
'check')
    if [[ `/bin/mount|grep database1|wc -c` -eq 0 ]]
    then
       exit 1
    else
       exit 0
    fi
    ;;

*)
    echo "usage: $0 {start stop check}"
    ;;

esac

exit 0

[root@westzq3 public]# cat action_DB_db01.scr
#!/bin/sh
# *****************************************************************
# *                                                               *
# *    Copyright (c) 2002, 2003 Oracle Corporation.               *
# *         All rights reserved.                                  *
# *                                                               *
# *    Copyright (c) 1991, 1999, 2002 Digital Equipment           *
# *                  Corporation                                  *
# *                                                               *
# *                                                               *
# *   All Rights Reserved.  Unpublished rights  reserved  under   *
# *   the copyright laws of the United States.                    *
# *                                                               *
# *   The software contained on this media  is  proprietary  to   *
# *   and  embodies  the  confidential  technology  of  Digital   *
# *   Equipment Corporation and Oracle Corporation.  Possession,  *
# *   use, duplication or dissemination of the software           *
# *   and media is authorized only pursuant to a valid written    *
# *   license from Digital Equipment Corporation and Oracle       *
# *   Corporation                                                 *
# *                                                               *
# *   RESTRICTED RIGHTS LEGEND   Use, duplication, or disclosure  *
# *   by the U.S. Government is subject to restrictions  as  set  *
# *   forth in Subparagraph (c)(1)(ii)  of  DFARS  252.227-7013,  *
# *   or  in  FAR 52.227-19, as applicable.                       *
# *                                                               *
# *                                                               *
# *****************************************************************
#

SCRIPT=$0
ACTION=$1                     # Action (start, stop or check)

#########################################################################
#
# Main section of Action Script. - starts, stops, or checks an application
#       
# This script. is invoked by CRS when managing the application associated
# with this script.
#
# Argument:  $1 - start | stop | check
#
# Returns:   0 - successful start, stop, or check
#            1 - error
#
#########################################################################

#
# Start section - start the process and report results
#
# If the Application Startup Commands (see description above) were used,
# little, if any modifications are needed in this section.  If not used,
# you may replace most of the contents in this section with your own
# start procedure code.
#

case $1 in
'start')
    su - oracle -c "/u01/app/oracle/product/crs/crs/public/start_db.sh"
    exit $?
    ;;

#
# Stop section - stop the process and report results
#
# If the Application Stop Commands or Associated Processes (see descriptions
# above) were used,little, if any modifications are needed in this section.
# If not used, you may replace most of the contents in this section with
# your own stop procedure code.
#

'stop')
    su - oracle -c "/u01/app/oracle/product/crs/crs/public/stop_db.sh"
    exit $?
    ;;

#
# Check section - check the process and report results
#
#
# Your application might allow you to implement more accurate process
# checking.  If so, you may choose to implement that code here. 
#
'check')
    if [[ `/bin/ps -ef|grep ora_smon_db01|grep -v grep|wc -c` -eq 0 ]]
    then
       exit 1
    else
       exit 0
    fi
    ;;

*)
    echo "usage: $0 {start stop check}"
    ;;

esac

exit 0


[root@westzq3 public]# cat st
start_db.sh  stop_db.sh  
[root@westzq3 public]# cat start_db.sh
lsnrctl start
export ORACLE_SID=db01
sqlplus "/as sysdba" <startup
exit
EOF
if [[ $? -eq 1 ]]
then
  exit 0
else
  exit 1
fi
[root@westzq3 public]# cat stop_db.sh
lsnrctl stop
export ORACLE_SID=db01
sqlplus "/as sysdba" <shutdown immediate
exit
EOF
exit 0

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8242091/viewspace-765418/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-04-06

  • 博文量
    251
  • 访问量
    965355