使用10gR2 CRS搭建HA環境 & 一些測試結果
本文只是簡單的功能性測試
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
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" <
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" <
exit
EOF
exit 0
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8242091/viewspace-765418/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- kaldi環境搭建 | yesno 測試
- android測試環境搭建Android
- Spark開發-HA環境的搭建Spark
- griffin環境搭建及功能測試
- 搭建自動化測試環境
- 達夢6.0試用之測試環境搭建
- 軟體測試培訓:如何搭建測試環境
- 新手搭建 kubernetes 測試環境
- 你真的會搭建測試環境嗎?
- OCM實驗-測試環境的搭建
- 搭建rac+DataGuard的測試環境
- 測試結果
- 如何搭建良好的軟體測試環境?測試環境對軟體測試起到什麼作用?
- DVWA下載、安裝、使用(漏洞測試環境搭建)教程
- PCIE XDMA 開發環境搭建以及環路測試開發環境
- fio效能測試-環境搭建,功能介紹,測試講解
- 自動化測試 selenium 環境搭建
- TestNG+Maven+IDEA環境搭建+測試MavenIdea
- 前端單元測試之Karma環境搭建前端
- WebSphere MQ傳輸環境搭建和測試WebMQ
- 使用 Karma、Mocha、Chai 搭建支援 ES6 的測試環境AI
- 結合jenkins在Linux伺服器搭建測試環境JenkinsLinux伺服器
- DataExpress測試結果Express
- 想要軟體測試效果好,搭建好測試環境是前提
- Hadoop 及Spark 分散式HA執行環境搭建HadoopSpark分散式
- lustre檔案系統環境搭建及測試
- 如何快速搭建微服務開發測試環境微服務
- jenkins+ANT+jmeter 介面測試環境搭建JenkinsJMeter
- kafka學習筆記1:測試環境搭建Kafka筆記
- MySQL InnoDB Cluster環境搭建和簡單測試MySql
- 搭建LVS負載均衡測試環境負載
- 搭建測試環境後出現的問題
- 配置開發環境、生成環境、測試環境開發環境
- 測試人員必看!!!軟體測試環境搭建有哪些原則?
- python+selenium UI自動化測試環境搭建及使用PythonUI
- 在不使用網線的mac上搭建IPv6測試環境Mac
- IOS自動化測試環境搭建(Python & Java)iOSPythonJava
- 虛擬機器搭建測試環境解決方案虛擬機