您好,登錄后才能下訂單哦!
HA(High Available)即由兩臺計算機組成并對外提供一組相同的服務,也叫做一主一備模式。正常情況下由主服務器提供服務,備服務器處于待機備用,備機可以隨時接替主服務器的工作。也就是當主服務器宕機或所提供的服務不可用時,備用服務器會主動激活并且替換主服務器繼續提供服務,這時主服務器上的服務資源包括網絡(IP)、存儲、服務(Web/數據庫)就會轉移到備機接管,從而提供不間斷的服務。基于此,便可以將服務器的宕機時間減少到最低,對業務實現不中斷或短暫中斷。
由一組計算機(多臺)組成一個整體并向用戶提供相同的網絡資源或服務,這種模式叫做HA集群(High Available Cluster)。
Oracle HA高可用,又叫做雙機熱備,一般用于關鍵性業務。
Oracle雙機熱備模式
常用的有Data Guard、RAC(Real Application Clusters)、基于HA軟件實現的雙機熱備。
l Data Guard采用重做日志復制技術,對主業務數據進行實時的異步同步備份,有一主一備、一主多備模式,一般常用于容災(異地備份、災難恢復);存儲獨立、數據完整備份;備機可以做數據分析、報表統計等;主備自由切換,能實現自動快速故障轉移;備用角色強制轉換為主用角色會破環Data Guard架構;設計復雜、維護難度大
l RAC多個實例同時運行,無主備概念,有集群負載功能,其中某一臺down機,不影響整體服務,不存在故障切換時間,可以提供高性能服務;存儲共享,由ASM管理存儲;硬件成本低;設計簡單、維護難度大
l HA雙機熱備可以提供高可用性,保證業務的持續穩定運行,可以實現自動快速故障轉移,存在短暫的切換時間(10-30s)。一般用于關鍵性業務;存儲共享;有商業的HA方案,也可以使用開源的高可用軟件keepalved、heartbeat搭建實現HA方案;設計復雜、維護難度小
l HA雙機和Data Guard
l Data Guard和RAC
l Oracle HA雙機熱備+Keepalived
l Oracle HA雙機+DataGuard+Keepalived集群
軟件版本:
Orace 11g R2
Keepalived 1.3.2
主服務器: DB1
備服務器: DB2
Hostname | IP | OS | Role |
hmdg-db1 | 172.16.10.25 | CentOS6.9 | MASTER |
hmdg-db2 | 172.16.10.26 | CentOS6.9 | BACKUP |
VIP | 172.16.10.130、172.16.10.131 | ||
Share Disk | /dev/sdb1 mount on /oradata | ||
ORACLE_BASE | /u01/app/oracle | ||
ORACLE_HOME | /u01/app/oracle/product/11.2.0/db_1 | ||
ORACLE_SID | HMODB | ||
Datadir | /oradata/HMODB | ||
Controlfiles | /oradata/HMODB/control01.ctl, /u01/app/oracle/flash_recovery_area/HMODB/control02.ctl, /home/oracle/rman/HMODB/control03.ctl |
1、 同時在主備上安裝Oracle數據庫軟件,數據庫的安裝目錄和環境變量保持一致
2、 僅在主服務器上建立數據庫實例(主服務器上掛載共享存儲并使用DBCA新建庫)
3、 主服務創建數據庫實例后,將主庫上的控制文件、參數文件(SPFILE)、以及密碼文件傳輸到備用服務器上相應的目錄
l 備用服務器DB2
##創建對應的數據庫文件目錄 [root@hmdg-db2 ~]# su - oracle [oracle@hmdg-db2 ~]$ mkdir /u01/app/oracle/admin/HMODB [oracle@hmdg-db2 ~]$ mkdir /u01/app/oracle/admin/HMODB/{adump,dpdump,pfile} [oracle@hmdg-db2 ~]$ mkdir /u01/app/oracle/flash_recovery_area/HMODB ##密碼文件 [oracle@hmdg-db2 ~]$ scp oracle@hmdg-db1:/u01/app/oracle/product/11.2.0/db_1/dbs/orapwHMODB /u01/app/oracle/product/11.2.0/db_1/dbs/orapwHMODB ##SPFILE參數文件 [oracle@hmdg-db2 ~]$ scp oracle@hmdg-db1:/u01/app/oracle/product/11.2.0/db_1/dbs/spfileHMODB.ora /u01/app/oracle/product/11.2.0/db_1/dbs/spfileHMODB.ora ##控制文件,僅需要將位于非共享存儲的數據目錄下的控制文件傳輸到其他磁盤或目錄位置下 [oracle@hmdg-db2 ~]$ scp oracle@hmdg-db1:/u01/app/oracle/flash_recovery_area/HMODB/control02.ctl /u01/app/oracle/flash_recovery_area/HMODB/control02.ctl [oracle@hmdg-db2 ~]$cp /u01/app/oracle/flash_recovery_area/HMODB/control02.ctl /home/oracle/rman/HMODB/control03.ctl
1、 主服務器上關閉數據庫實例
2、 主服務器上卸載共享存儲
3、 備服務器上掛載共享存儲
4、 備服務器上啟動監聽
5、 備服務器上啟動數據庫實例
注意:不要同時掛載共享存儲啟動數據庫實例,否則會導致數據不一致
l 主服務器DB1
##關閉數據庫實例 [oracle@hmdg-db1 ~]$ sqlplus / as sysdba SQL> shutdown immediate ##關閉數據庫監聽 [oracle@hmdg-db1 ~]$ lsnrctl stop ##卸載共享存儲 [oracle@hmdg-db1 ~]$ umount /oradata
l 備服務器DB2
##掛載/dev/sdb1共享存儲到/oradta下 [root@hmdg-db2 ~]# mount /dev/sdb1 /oradata/ ##啟動數據庫監聽 [oracle@hmdg-db2 ~]$ lsnrctl start [oracle@hmdg-db2 ~]$ export ORACLE_SID=HMODB ##啟動數據庫實例 [oracle@hmdg-db2 ~]$ sqlplus / as sysdba SQL> startup ORACLE instance started. Total System Global Area 1603411968 bytes Fixed Size 2213776 bytes Variable Size 1056966768 bytes Database Buffers 536870912 bytes Redo Buffers 7360512 bytes Database mounted. Database opened. SQL> ##檢驗數據庫 SQL> SHOW PARAMETER DB_NAME NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_name string HMODB SQL> SELECT OPEN_MODE,NAME,DATABASE_ROLE FROM V$DATABASE; OPEN_MODE NAME DATABASE_ROLE -------------------- --------- ---------------- READ WRITE HMODB PRIMARY
由于安裝數據庫實例時,創建了多個控制文件,并且這些控制文件都保存在不同的磁盤上,在主備進行切換的時,位于非共享存儲的控制文件需要手動進行同步。這是由于在關閉數據庫實例時Oracle同時將當前數據庫狀態信息記錄到控制文件中,在沒有啟動數據庫實例的備機就無法同步自身的其他的控制文件。這時就需要使用共享存儲里的控制文件進行恢復。
1、 在DB2關閉正在運行數據庫實例
##DB2: [oracle@hmdg-db2 ~]$ sqlplus / as sysdba SQL> shutdown immediate [root@hmdg-db2 ~]# umount /oradata/
2、在DB1上進行恢復啟動數據庫實例
##DB1: [root@hmdg-db1 ~]# mount /dev/sdb1 /oradata/ [oracle@hmdg-db1 ~]$ export ORACLE_SID=HMODB [oracle@hmdg-db1 ~]$ sqlpus / as sysdba SQL> startup nomount SQL> alter database mount; SQL> alter database open;
如果控制文件在不同的磁盤目錄,那么就需要執行這一步恢復控制文件
[oracle@hmdg-db1 ~]$ rman target / RMAN> restore controlfile from '/oradata/HMODB/control01.ctl';
啟動數據庫監聽
[oracle@hmdg-db1 ~]$ lsnrctl start
或者直接只有操作系統的cp、scp等命令進行拷貝恢復
[oracle@hmdg-db1 ~]$ cp /oradata/HMODB/control01.ctl /u01/app/oracle/flash_recovery_area/HMODB/control02.ctl SQL> SELECT NAME,OPEN_MODE,NAME,DATABASE_ROLE FROM V$DATABASE; NAME OPEN_MODE NAME DATABASE_ROLE --------- -------------------- --------- ---------------- HMODB READ WRITE HMODB PRIMARY
配置oracle用戶的ssh密鑰,用于主備通過oracle身份自動檢測對方的數據共享存儲狀態。在keepalived腳本管理中自動檢查對方的掛載狀態,并在主備切換的過程中,待接管的服務器等待對方umount共享存儲之后,正常啟動數據庫實例。(如果主服務異常關機或網絡中斷,不需要等待對方umount存儲,主服務器異常關機時keepalived會即時檢測到并自動切換到備機上)
[oracle@hmdg-db1 ~]$ ssh-keygen -t rsa -b 2048 [oracle@hmdg-db1 ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub oracle@hmdg-db2 [oracle@hmdg-db2 ~]$ ssh-keygen -t rsa -b 2048 [oracle@hmdg-db2 ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub oracle@hmdg-db1
添加主備防火墻互通規則
# iptables -I INPUT -p tcp -s 172.16.10.0/24 -j ACCEPT # iptables -I INPUT -p udp -s 172.16.10.0/24 -j ACCEPT
主服務器的keepalived配置,備用服務器需要做相應的修改
! Configuration File for keepalived global_defs { notification_email { mail@huangming.org } notification_email_from Alexandre.Cassen@firewall.loc smtp_server 127.0.0.1 smtp_connect_timeout 30 router_id ORACLE_HA_MASTER #backup為ORACLE_HA_BACKUP !vrrp_skip_check_adv_addr } vrrp_sync_group ORACLE_HA_GROUP { group { Oracle_HA_1 #定義一個vrrp實例組 } } vrrp_script monitor_oracle_status { #oracle數據庫服務器狀態檢查腳本 script "/usr/local/keepalived/scripts/monitor.sh" interval 10 #腳本執行時間間隔 fall 3 #腳本執行的最大失敗次數 rise 1 #腳本執行成功一次則返回正常狀態 weight 20 #腳本執行成功時的附加權值 } vrrp_script change_monitor_status { #服務器狀態監控并修改主備檢查腳本 script "/usr/local/keepalived/scripts/change_monitor_status.sh" interval 2 } vrrp_instance Oracle_HA_1 { state BACKUP #主備都設置為BACKUP interface eth2 #綁定vip的網絡接口 virtual_router_id 200 #主備保存一致 priority 100 #備為90 advert_int 2 #主備狀態同步時間間隔 nopreempt #主設置為不搶占模式 authentication { auth_type PASS auth_pass 11112222 } virtual_ipaddress { 172.16.10.130/24 dev eth2 #需要綁定的VIP 172.16.10.131/24 dev eth2 } track_script { monitor_oracle_status change_monitor_status } track_interface { eth0 #同時監控檢測其他的網接口 } notify_master "/usr/local/keepalived/scripts/keepalived_notify.sh master" notify_backup "/usr/local/keepalived/scripts/keepalived_notify.sh backup" notify_fault "/usr/local/keepalived/scripts/keepalived_notify.sh fault" notify_stop "/usr/local/keepalived/scripts/keepalived_notify.sh stop" ! notify管理腳本的定義 ! 分別對應keepalived轉換為master、backup、fault、stop狀態時執行的腳本 ! 在oracle的雙機管理中主要是依賴這些腳本實現資源的接管 }
[root@hmdg-db1 scripts]# ls -l /usr/local/keepalived/scripts/ -rwxr-xr-x 1 root root 818 Apr 14 20:13 change_monitor_status.sh -rw-r--r-- 1 root root 57 Apr 14 20:13 Controlfile.sql -rw-r--r-- 1 root root 1308 Apr 14 20:13 keepalived -rwxr-xr-x 1 root root 10549 Apr 14 23:18 keepalived_notify.sh -rwxr-xr-x 1 root root 926 Apr 14 23:12 monitor_primary_oracle.sh -rwxr-xr-x 1 root root 895 Apr 15 16:46 monitor.sh -rwxr-xr-x 1 root root 895 Apr 14 20:13 monitor_standby_oracle.sh -rw-r--r-- 1 root root 1657 Apr 15 15:13 oracle_init.sh -rwxr-xr-x 1 root root 8441 Apr 14 20:13 notify.sh_20180413
關于這些keepalived腳本,由于篇幅有限我沒有全部貼到本文中,大家可以訪問我的Github倉庫找到:https://github.com/hmlinux/oracle-keepalived
l keepalived_notify.sh #keepalived的notify腳本,用于實現主備的資源自動切換
l monitor.sh #keepalved的監控腳本,監控oracle數據庫運行狀態、共享存儲狀態
l change_monitor_status.sh #異常或正常檢測腳本,當備服務器處于正常運行狀態,并且處于keepalived的BACKUP狀態時,將自身的監控腳本修改為在備機就緒時執行都返回正常結果,主要作用時讓正常的備機可以隨時接管主服務器的資源
l monitor_primary_oracle.sh #處于MASTER狀態時的服務器監控腳本
l monitor_standby_oracle.sh #處于BACKUP狀態時的服務器監控腳本
l oracle_init.sh #notify腳本調用oracle啟動、停止、狀態檢測命令
keepalived_notify.sh
#!/bin/bash # author: hm@huangming.org # keepalived notify script #bind vip interface interface="eth2" #keepalived virtual_ipaddress virtual_ipaddress="172.16.10.130","172.16.10.131" MASTER_HOSTNAME="hmdg-db1" #DB1 BACKUP_HOSTNAME="hmdg-db2" #DB2 LOGDIR="/usr/local/keepalived/log" LOGFILE="$LOGDIR/keepalived_haswitch.log" TMPLOG=/tmp/notify_.log sharedisk="/dev/sdb1" sharedisk_mount_point="/oradata" # oracle_datadir="/oradata/path/HMODB" oracle_datadir="/oradata" # Source oracle database instance startup/shutdown script . /usr/local/keepalived/scripts/oracle_init.sh control_files="/$oracle_datadir/$ORACLE_SID/control01.ctl","/u01/app/oracle/flash_recovery_area/$ORACLE_SID/control02.ctl","/home/oracle/rman/$ORACLE_SID/control03.ctl" RETVAL=0 OLD_IFS="$IFS" IFS="," [ -d $LOGDIR ] || mkdir $LOGDIR controlfile_backpath="/backup/oracle/control" controlfile_back=$controlfile_backpath/control_$(date '+%Y%d%m%H%M%S') [ -d $controlfile_backpath ] || mkdir -p $controlfile_backpath && chown -R oracle:oinstall $controlfile_backpath info_log() { printf "$(date '+%b %d %T %a') $HOSTNAME [keepalived_notify]: $1" } control01_ctl=`printf ${control_files[0]}` backup_controlfile() { su - oracle << EOF export ORACLE_SID=$ORACLE_SID $ORACLE_HOME/bin/sqlplus -S "/ as sysdba" alter database backup controlfile to '$controlfile_back'; exit EOF } #runuser -l oracle -c "export ORACLE_SID=$ORACLE_SID;rman target / cmdfile=/usr/scripts/ControlfileRestore.sql" restore_controlfile() { su - oracle << EOF export ORACLE_SID=$ORACLE_SID $ORACLE_HOME/bin/rman target / nocatalog RESTORE CONTROLFILE FROM '$control01_ctl'; exit EOF } ssh_p=$(netstat -ntp | awk '/sshd/{print $4}' | awk -F':' '{print $2}' | head -1) chk_remote_node_sharedisk() { if [ $(hostname) == $MASTER_HOSTNAME ];then if ping -c1 -w2 $BACKUP_HOSTNAME &>/dev/null;then runuser -l oracle -c "ssh -p$ssh_p $BACKUP_HOSTNAME 2>/dev/null df | grep $sharedisk | wc -l" fi fi if [ $(hostname) == $BACKUP_HOSTNAME ];then if ping -c1 -w2 $MASTER_HOSTNAME &>/dev/null;then runuser -l oracle -c "ssh -p$ssh_p $MASTER_HOSTNAME 2>/dev/null df | grep $sharedisk | wc -l" fi fi } master() { info_log "Database Switchover To MASTER\n" info_log "Check remote node sharedisk mounted.\n" i=1 while (($i<=30)) do chk_status=$(chk_remote_node_sharedisk) if [ $chk_status -ge 1 ];then info_log "$sharedisk is already mounted on remote node or busy. checking [$i]...\n" else info_log "$sharedisk check passed.\n" break fi if [ $i -eq 20 ];then info_log "Disk status abnormal.\n" exit 1 fi sleep 1 i=$(($i+1)) done ismount=$(df -h | grep $sharedisk | grep $sharedisk_mount_point | wc -l) if [ $ismount -eq 0 ];then info_log "mount $sharedisk on $sharedisk_mount_point\n" mount $sharedisk $sharedisk_mount_point RETVAL=$? if [ $RETVAL -eq 0 ];then #shutdown_instance info_log "restore controlfile 1\n" startup_nomount restore_controlfile else info_log "Error: $sharedisk cannot mount or $sharedisk_mount_point busy\n" exit $RETVAL fi else disk=$(df -h | grep $sharedisk_mount_point | awk '{print $1}') if [ $disk == $sharedisk ];then info_log "mount: $sharedisk is already mounted on $sharedisk_mount_point\n" else info_log "Warning: $sharedisk already mounted on $disk\n" fi fi status=$(check_instance_status | grep -Eio -e "\bOPEN\b" -e "\bMOUNTED\b" -e "\bSTARTED\b") if [ "$status" == "OPEN" ];then info_log "a database already open by the instance.\n" elif [ "$status" == "MOUNTED" ];then info_log "re-open database instance\n" open_instance | tee $TMPLOG opened=$(cat $TMPLOG | grep -Eio "\bDatabase altered\b") if [ "$opened" != "Database altered" ];then info_log "Error: database instance open fail!\n" exit 2 fi elif [ "$status" == "STARTED" ];then info_log "alter database to mount\n" mount_instance | tee $TMPLOG mounted=$(cat $TMPLOG | grep -Eio "\bDatabase altered\b") if [ "$mounted" == "Database altered" ];then info_log "alter database to open\n" open_instance | tee $TMPLOG opened=$(cat $TMPLOG | grep -Eio "\bDatabase altered\b") if [ "$opened" == "Database altered" ];then info_log "Database opened.\n" else info_log "Database open failed\n" exit 4 fi else info_log "Database mount failed\n" exit 3 fi else info_log "Startup database and open instance\n" shutdown_instance &>/dev/null startup_instance | tee $TMPLOG started=$(cat $TMPLOG | grep -Eio "\bDatabase opened\b") if [ "$started" != "Database opened" ];then info_log "Database instance open fail.\n" info_log "restore controlfile 2\n" shutdown_instance | tee $TMPLOG startup_nomount | tee $TMPLOG restore_controlfile shutdown_instance | tee $TMPLOG startup_instance | tee $TMPLOG started=$(cat $TMPLOG | grep -Eio "\bDatabase opened\b") if [ "$started" != "Database opened" ];then info_log "Database restore fail!\n" exit 5 else info_log "Database opened.\n" fi else info_log "Database opened.\n" fi fi info_log "Startup listener\n" runuser -l oracle -c "lsnrctl status &>/dev/null" if [ $? -eq 0 ];then info_log "listener already started.\n" else info_log "starting listener...\n" runuser -l oracle -c "lsnrctl start &>/dev/null" if [ $? -eq 0 ];then info_log "The listener startup successfully\n" else info_log "Listener start failure!\n" fi fi echo } backup() { info_log "Database Switchover To BACKUP\n" ismount=$(df -h | grep $sharedisk | grep $sharedisk_mount_point | wc -l) if [ $ismount -ge 1 ];then disk=$(df -h | grep $sharedisk_mount_point | awk '{print $1}') if [ $disk == $sharedisk ];then status=$(check_instance_status | grep -Eio -e "\bOPEN\b" -e "\bMOUNTED\b" -e "\bSTARTED\b") if [ "$status" == "OPEN" -o "$status" == "MOUNTED" ];then info_log "Database instance state is mounted\n" info_log "Backup current controlfile.\n" echo -e "\nSQL> alter database backup controlfile to '$controlfile_back';\n" backup_controlfile info_log "Shutdown database instance, please wait...\n" shutdown_instance | tee $TMPLOG shuted=$(cat $TMPLOG | grep -Eio "\binstance shut down\b") if [ "$shuted" == "instance shut down" ];then info_log "Database instance shutdown successfully.\n" else info_log "Database instance shutdown failed.\n" info_log "shutdown abort.\n" shutdown_abort fi elif [ "$status" == "STARTED" ];then info_log "Database instance state is STARTED\n" info_log "Shutdown database instance, please wait...\n" shutdown_instance | tee $TMPLOG shuted=$(cat $TMPLOG | grep -Eio "\binstance shut down\b") if [ "$shuted" == "instance shut down" ];then info_log "Database instance shutdown successfully.\n" else info_log "Database instance shutdown failed.\n" info_log "shutdown abort.\n" shutdown_abort fi else shutdown_instance | tee $TMPLOG info_log "Database instance not available.\n" fi echo info_log "umount sharedisk\n" echo umount $sharedisk_mount_point && RETVAL=$? if [ $RETVAL -eq 0 ];then info_log "umount $sharedisk_mount_point success.\n" else info_log "umount $sharedisk_mount_point fail!\n" fi else info_log "$sharedisk is not mount on $sharedisk_mount_point or busy.\n" fi else info_log "$sharedisk_mount_point is no mount\n" fi info_log "stopping listener...\n" runuser -l oracle -c "lsnrctl status" &>/dev/null RETVAL=$? if [ $RETVAL -eq 0 ];then runuser -l oracle -c "lsnrctl stop" &>/dev/null RETVAL=$? if [ $RETVAL -eq 0 ];then info_log "The listener stop successfully\n" else info_log "Listener stop failure!\n" fi else info_log "listener is not started.\n" fi echo } notify_master() { echo -e "\n-------------------------------------------------------------------------------" echo "`date '+%b %d %T %a'` $(hostname) [keepalived_notify]: Transition to $1 STATE"; echo "`date '+%b %d %T %a'` $(hostname) [keepalived_notify]: Setup the VIP on $interface $virtual_ipaddress"; } notify_backup() { echo -e "\n-------------------------------------------------------------------------------" echo "`date '+%b %d %T %a'` $HOSTNAME [keepalived_notify]: Transition to $1 STATE"; echo "`date '+%b %d %T %a'` $HOSTNAME [keepalived_notify]: removing the VIP on $interface for $virtual_ipaddress"; } case $1 in master) notify_master MASTER | tee -a $LOGFILE master | tee -a $LOGFILE ;; backup) notify_backup BACKUP | tee -a $LOGFILE backup | tee -a $LOGFILE ;; fault) notify_backup FAULT | tee -a $LOGFILE backup | tee -a $LOGFILE ;; stop) notify_backup STOP | tee -a $LOGFILE /etc/init.d/keepalived start #sleep 6 && backup | tee -a $LOGFILE ;; *) echo "Usage: `basename $0` {master|backup|fault|stop}" RETVAL=1 ;; esac exit $RETVAL
l 將主服務器切換為BACKUP狀態
執行./keepalived_notify.sh backup
[root@hmdg-db1 scripts]# ./keepalived_notify.sh backup ------------------------------------------------------------------------------- Apr 15 17:23:05 Sun hmdg-db1 [keepalived_notify]: Transition to BACKUP STATE Apr 15 17:23:05 Sun hmdg-db1 [keepalived_notify]: removing the VIP on eth2 for 172.16.10.130,172.16.10.131 Apr 15 17:23:05 Sun hmdg-db1 [keepalived_notify]: Database Switchover To BACKUP Apr 15 17:23:05 Sun hmdg-db1 [keepalived_notify]: /oradata is no mount Apr 15 17:23:05 Sun hmdg-db1 [keepalived_notify]: stopping listener... Apr 15 17:23:05 Sun hmdg-db1 [keepalived_notify]: listener is not started.
觀察執行腳本的輸出結果,這是由于在本機上并沒有啟動oracle實例,所以腳本最終提示本機并沒有啟動oracle數據庫實例
l 將主服務器切換為MASTER狀態
執行./keepalived_notify.sh master
[root@hmdg-db1 scripts]# ./keepalived_notify.sh master ------------------------------------------------------------------------------- Apr 15 17:23:43 Sun hmdg-db1 [keepalived_notify]: Transition to MASTER STATE Apr 15 17:23:43 Sun hmdg-db1 [keepalived_notify]: Setup the VIP on eth2 172.16.10.130,172.16.10.131 Apr 15 17:23:43 Sun hmdg-db1 [keepalived_notify]: Database Switchover To MASTER Apr 15 17:23:43 Sun hmdg-db1 [keepalived_notify]: Check remote node sharedisk mounted. Apr 15 17:23:43 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 check passed. Apr 15 17:23:43 Sun hmdg-db1 [keepalived_notify]: mount /dev/sdb1 on /oradata Apr 15 17:23:43 Sun hmdg-db1 [keepalived_notify]: restore controlfile 1 ORACLE instance started. Total System Global Area 1603411968 bytes Fixed Size 2213776 bytes Variable Size 1056966768 bytes Database Buffers 536870912 bytes Redo Buffers 7360512 bytes Recovery Manager: Release 11.2.0.1.0 - Production on Sun Apr 15 17:23:44 2018 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: HMODB (not mounted) using target database control file instead of recovery catalog RMAN> Starting restore at 15-APR-18 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=572 device type=DISK channel ORA_DISK_1: copied control file copy output file name=/oradata/HMODB/control01.ctl output file name=/u01/app/oracle/flash_recovery_area/HMODB/control02.ctl output file name=/home/oracle/rman/HMODB/control03.ctl Finished restore at 15-APR-18 RMAN> Recovery Manager complete. Apr 15 17:23:46 Sun hmdg-db1 [keepalived_notify]: alter database to mount Database altered. Apr 15 17:23:50 Sun hmdg-db1 [keepalived_notify]: alter database to open Database altered. Apr 15 17:23:57 Sun hmdg-db1 [keepalived_notify]: Database opened. Apr 15 17:23:57 Sun hmdg-db1 [keepalived_notify]: Startup listener Apr 15 17:23:57 Sun hmdg-db1 [keepalived_notify]: starting listener... Apr 15 17:23:57 Sun hmdg-db1 [keepalived_notify]: The listener startup successfully
觀察執行腳本的輸出結果
1、腳本接收轉換到MASTER信息
2、首先提示綁定的VIP
3、然后檢測遠程備用節點的磁盤是否掛載,或本機是否掛載了磁盤,檢測成功則把磁盤掛載
4、啟動數據庫到nomount狀態,并恢復控制文件
5、啟動數據庫實例到open狀態
6、啟動數據庫監聽,切換完成
注意:如果使用系統命令手動切換,應該要保證正在運行oracle服務的主節點先正常關閉,并且卸載共享存儲之后,再啟動備用節點的oracle服務(即不能同時掛載共享存儲)
l 再次將主服務器切換到BACKUP狀態
執行./keepalived_notify.sh backup
[root@hmdg-db1 scripts]# ./keepalived_notify.sh backup ------------------------------------------------------------------------------- Apr 15 17:34:54 Sun hmdg-db1 [keepalived_notify]: Transition to BACKUP STATE Apr 15 17:34:54 Sun hmdg-db1 [keepalived_notify]: removing the VIP on eth2 for 172.16.10.130,172.16.10.131 Apr 15 17:34:54 Sun hmdg-db1 [keepalived_notify]: Database Switchover To BACKUP Apr 15 17:34:55 Sun hmdg-db1 [keepalived_notify]: Database instance state is mounted Apr 15 17:34:55 Sun hmdg-db1 [keepalived_notify]: Backup current controlfile. SQL> alter database backup controlfile to '/backup/oracle/control/control_20181504173454'; Database altered. Apr 15 17:34:55 Sun hmdg-db1 [keepalived_notify]: Shutdown database instance, please wait... Database closed. Database dismounted. ORACLE instance shut down. Apr 15 17:35:04 Sun hmdg-db1 [keepalived_notify]: Database instance shutdown successfully. Apr 15 17:35:04 Sun hmdg-db1 [keepalived_notify]: umount sharedisk Apr 15 17:35:05 Sun hmdg-db1 [keepalived_notify]: umount /oradata success. Apr 15 17:35:05 Sun hmdg-db1 [keepalived_notify]: stopping listener... Apr 15 17:35:08 Sun hmdg-db1 [keepalived_notify]: The listener stop successfully
觀察執行腳本的輸出結果
1、 腳本接收轉換到BACKUP信息
2、 首先移除VIP(由keepalived綁定到主機上浮動IP地址,同時也是對外提供服務的IP地址),實際上是由keepalived檢測到異常或本身的服務器不可用時自動剔除VIP
3、 備份控制文件到/backup/oracle/control/目錄下
4、 正常關閉數據庫實例
5、 卸載共享存儲
6、 關閉數據庫監聽程序
l notify腳本切換演示
如果備機主動切換到MASTER狀態時,腳本首先或檢測對方磁盤是否umount,如果沒有則最多等待20秒,提示異常并正常推出切換到MASTER的請求
[root@hmdg-db1 scripts]# ./keepalived_notify.sh master ------------------------------------------------------------------------------- Apr 15 17:40:08 Sun hmdg-db1 [keepalived_notify]: Transition to MASTER STATE Apr 15 17:40:08 Sun hmdg-db1 [keepalived_notify]: Setup the VIP on eth2 172.16.10.130,172.16.10.131 Apr 15 17:40:08 Sun hmdg-db1 [keepalived_notify]: Database Switchover To MASTER Apr 15 17:40:08 Sun hmdg-db1 [keepalived_notify]: Check remote node sharedisk mounted. Apr 15 17:40:08 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [1]... Apr 15 17:40:09 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [2]... Apr 15 17:40:10 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [3]... Apr 15 17:40:12 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [4]... Apr 15 17:40:13 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [5]... Apr 15 17:40:14 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [6]... Apr 15 17:40:15 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [7]... Apr 15 17:40:16 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [8]... Apr 15 17:40:17 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [9]... Apr 15 17:40:18 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [10]... Apr 15 17:40:20 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [11]... Apr 15 17:40:21 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [12]... Apr 15 17:40:22 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [13]... Apr 15 17:40:23 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [14]... Apr 15 17:40:24 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [15]... Apr 15 17:40:25 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [16]... Apr 15 17:40:26 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [17]... Apr 15 17:40:27 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [18]... Apr 15 17:40:29 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [19]... Apr 15 17:40:30 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [20]... Apr 15 17:40:30 Sun hmdg-db1 [keepalived_notify]: Disk status abnormal.
這時如果需要手動切換,則需要先將遠程備用節點的服務關閉并umount存儲之后,才能正常切換
[root@hmdg-db1 scripts]# ./keepalived_notify.sh master ------------------------------------------------------------------------------- Apr 15 17:45:29 Sun hmdg-db1 [keepalived_notify]: Transition to MASTER STATE Apr 15 17:45:29 Sun hmdg-db1 [keepalived_notify]: Setup the VIP on eth2 172.16.10.130,172.16.10.131 Apr 15 17:45:29 Sun hmdg-db1 [keepalived_notify]: Database Switchover To MASTER Apr 15 17:45:29 Sun hmdg-db1 [keepalived_notify]: Check remote node sharedisk mounted. Apr 15 17:45:29 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [1]... Apr 15 17:45:30 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [2]... Apr 15 17:45:31 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [3]... Apr 15 17:45:32 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [4]... Apr 15 17:45:33 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [5]... Apr 15 17:45:35 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [6]... Apr 15 17:45:36 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [7]... Apr 15 17:45:37 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [8]... Apr 15 17:45:38 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [9]... Apr 15 17:45:39 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [10]... Apr 15 17:45:40 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [11]... Apr 15 17:45:41 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [12]... Apr 15 17:45:42 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [13]... Apr 15 17:45:44 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 check passed. Apr 15 17:45:44 Sun hmdg-db1 [keepalived_notify]: mount /dev/sdb1 on /oradata Apr 15 17:45:44 Sun hmdg-db1 [keepalived_notify]: restore controlfile 1 ORACLE instance started. Total System Global Area 1603411968 bytes Fixed Size 2213776 bytes Variable Size 1056966768 bytes Database Buffers 536870912 bytes Redo Buffers 7360512 bytes Recovery Manager: Release 11.2.0.1.0 - Production on Sun Apr 15 17:45:45 2018 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: HMODB (not mounted) using target database control file instead of recovery catalog RMAN> Starting restore at 15-APR-18 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=572 device type=DISK channel ORA_DISK_1: copied control file copy output file name=/oradata/HMODB/control01.ctl output file name=/u01/app/oracle/flash_recovery_area/HMODB/control02.ctl output file name=/home/oracle/rman/HMODB/control03.ctl Finished restore at 15-APR-18 RMAN> Recovery Manager complete. Apr 15 17:45:46 Sun hmdg-db1 [keepalived_notify]: alter database to mount Database altered. Apr 15 17:45:51 Sun hmdg-db1 [keepalived_notify]: alter database to open Database altered. Apr 15 17:45:58 Sun hmdg-db1 [keepalived_notify]: Database opened. Apr 15 17:45:58 Sun hmdg-db1 [keepalived_notify]: Startup listener Apr 15 17:45:58 Sun hmdg-db1 [keepalived_notify]: starting listener... Apr 15 17:45:58 Sun hmdg-db1 [keepalived_notify]: The listener startup successfully
啟動keepalived服務時,keepalived首先進行資源檢測,并根據權值設定MASTER角色
keepalived接管的資源:Oracle實例、存儲、VIP
1、啟動主服務器DB1的keepalived
##啟動keepalived [root@hmdg-db1 scripts]# /etc/init.d/keepalived start ##設置開機啟動 [root@hmdg-db1 scripts]# chkconfig keepalived on
2、查看主服務器的keepalived系統日志
[root@hmdg-db1 scripts]# tail -f /var/log/messages Apr 15 17:51:25 hmdg-db1 Keepalived_vrrp[82072]: Registering Kernel netlink reflector Apr 15 17:51:25 hmdg-db1 Keepalived_vrrp[82072]: Registering Kernel netlink command channel Apr 15 17:51:25 hmdg-db1 Keepalived_vrrp[82072]: Registering gratuitous ARP shared channel Apr 15 17:51:25 hmdg-db1 Keepalived_healthcheckers[82071]: Using LinkWatch kernel netlink reflector... Apr 15 17:51:25 hmdg-db1 Keepalived_vrrp[82072]: Opening file '/usr/local/keepalived/etc/keepalived/keepalived.conf'. Apr 15 17:51:25 hmdg-db1 Keepalived_vrrp[82072]: VRRP_Instance(Oracle_HA_1) removing protocol VIPs. Apr 15 17:51:25 hmdg-db1 Keepalived_vrrp[82072]: SECURITY VIOLATION - scripts are being executed but script_security not enabled. Apr 15 17:51:25 hmdg-db1 Keepalived_vrrp[82072]: Sync group ORACLE_HA_GROUP has only 1 virtual router(s) - removing Apr 15 17:51:25 hmdg-db1 Keepalived_vrrp[82072]: Using LinkWatch kernel netlink reflector... Apr 15 17:51:25 hmdg-db1 Keepalived_vrrp[82072]: VRRP_Instance(Oracle_HA_1) Entering BACKUP STATE Apr 15 17:51:25 hmdg-db1 Keepalived_vrrp[82072]: VRRP sockpool: [ifindex(3), proto(112), unicast(0), fd(10,11)] Apr 15 17:51:25 hmdg-db1 Keepalived_vrrp[82072]: VRRP_Script(change_monitor_status) succeeded Apr 15 17:51:25 hmdg-db1 Keepalived_vrrp[82072]: VRRP_Script(monitor_oracle_status) succeeded Apr 15 17:51:27 hmdg-db1 Keepalived_vrrp[82072]: VRRP_Instance(Oracle_HA_1) Changing effective priority from 100 to 120 Apr 15 17:51:31 hmdg-db1 Keepalived_vrrp[82072]: VRRP_Instance(Oracle_HA_1) Transition to MASTER STATE Apr 15 17:51:33 hmdg-db1 Keepalived_vrrp[82072]: VRRP_Instance(Oracle_HA_1) Entering MASTER STATE Apr 15 17:51:33 hmdg-db1 Keepalived_vrrp[82072]: VRRP_Instance(Oracle_HA_1) setting protocol VIPs. Apr 15 17:51:33 hmdg-db1 Keepalived_vrrp[82072]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 17:51:33 hmdg-db1 Keepalived_healthcheckers[82071]: Netlink reflector reports IP 172.16.10.130 added Apr 15 17:51:33 hmdg-db1 Keepalived_healthcheckers[82071]: Netlink reflector reports IP 172.16.10.131 added Apr 15 17:51:33 hmdg-db1 Keepalived_vrrp[82072]: VRRP_Instance(Oracle_HA_1) Sending/queueing gratuitous ARPs on eth2 for 172.16.10.130 Apr 15 17:51:33 hmdg-db1 Keepalived_vrrp[82072]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 17:51:33 hmdg-db1 Keepalived_vrrp[82072]: VRRP_Instance(Oracle_HA_1) Sending/queueing gratuitous ARPs on eth2 for 172.16.10.131 Apr 15 17:51:33 hmdg-db1 Keepalived_vrrp[82072]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 17:51:33 hmdg-db1 Keepalived_vrrp[82072]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 17:51:33 hmdg-db1 Keepalived_vrrp[82072]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 17:51:33 hmdg-db1 Keepalived_vrrp[82072]: Sending gratuitous ARP on eth2 for 172.16.10.131
3、啟動備服務器DB2的keepalived
##啟動keepalived [root@hmdg-db2 scripts]# /etc/init.d/keepalived start ##設置開機啟動 [root@hmdg-db2 scripts]# chkconfig keepalived on
4、查看備服務器的keepalived系統日志
Apr 15 17:51:41 hmdg-db2 Keepalived[71709]: Starting Keepalived v1.3.2 (04/14,2018) Apr 15 17:51:41 hmdg-db2 Keepalived[71709]: WARNING - default user 'keepalived_script' for script execution does not exist - please create. Apr 15 17:51:41 hmdg-db2 Keepalived[71709]: Opening file '/usr/local/keepalived/etc/keepalived/keepalived.conf'. Apr 15 17:51:41 hmdg-db2 Keepalived[71710]: Starting Healthcheck child process, pid=71711 Apr 15 17:51:41 hmdg-db2 Keepalived[71710]: Starting VRRP child process, pid=71712 Apr 15 17:51:41 hmdg-db2 Keepalived_healthcheckers[71711]: Netlink reflector reports IP 192.168.6.26 added Apr 15 17:51:41 hmdg-db2 Keepalived_healthcheckers[71711]: Netlink reflector reports IP 172.16.10.26 added Apr 15 17:51:41 hmdg-db2 Keepalived_healthcheckers[71711]: Netlink reflector reports IP fe80::20c:29ff:fedd:d175 added Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: Netlink reflector reports IP 192.168.6.26 added Apr 15 17:51:41 hmdg-db2 Keepalived_healthcheckers[71711]: Netlink reflector reports IP fe80::20c:29ff:fedd:d17f added Apr 15 17:51:41 hmdg-db2 Keepalived_healthcheckers[71711]: Netlink reflector reports IP fe80::20c:29ff:fedd:d189 added Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: Netlink reflector reports IP 172.16.10.26 added Apr 15 17:51:41 hmdg-db2 Keepalived_healthcheckers[71711]: Netlink reflector reports IP fe80::20c:29ff:fedd:d193 added Apr 15 17:51:41 hmdg-db2 Keepalived_healthcheckers[71711]: Registering Kernel netlink reflector Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: Netlink reflector reports IP fe80::20c:29ff:fedd:d175 added Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: Netlink reflector reports IP fe80::20c:29ff:fedd:d17f added Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: Netlink reflector reports IP fe80::20c:29ff:fedd:d189 added Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: Netlink reflector reports IP fe80::20c:29ff:fedd:d193 added Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: Registering Kernel netlink reflector Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: Registering Kernel netlink command channel Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: Registering gratuitous ARP shared channel Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: Opening file '/usr/local/keepalived/etc/keepalived/keepalived.conf'. Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: VRRP_Instance(Oracle_HA_1) removing protocol VIPs. Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: SECURITY VIOLATION - scripts are being executed but script_security not enabled. Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: Sync group ORACLE_HA_GROUP has only 1 virtual router(s) - removing Apr 15 17:51:41 hmdg-db2 Keepalived_healthcheckers[71711]: Registering Kernel netlink command channel Apr 15 17:51:41 hmdg-db2 Keepalived_healthcheckers[71711]: Opening file '/usr/local/keepalived/etc/keepalived/keepalived.conf'. Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: Using LinkWatch kernel netlink reflector... Apr 15 17:51:41 hmdg-db2 Keepalived_healthcheckers[71711]: Using LinkWatch kernel netlink reflector... Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: VRRP_Instance(Oracle_HA_1) Entering BACKUP STATE Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: VRRP sockpool: [ifindex(3), proto(112), unicast(0), fd(10,11)] Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: pid 71721 exited with status 1 Apr 15 17:51:41 hmdg-db2 Keepalived_vrrp[71712]: VRRP_Script(change_monitor_status) succeeded Apr 15 17:52:01 hmdg-db2 Keepalived_vrrp[71712]: VRRP_Script(monitor_oracle_status) succeeded Apr 15 17:52:01 hmdg-db2 Keepalived_vrrp[71712]: VRRP_Instance(Oracle_HA_1) Changing effective priority from 90 to 110
5、主備Oracle、VIP、磁盤服務狀態檢查
##DB1 [root@hmdg-db1 scripts]# ps -ef | grep ora_ oracle 82439 1 0 17:51 ? 00:00:00 ora_pmon_HMODB oracle 82441 1 0 17:51 ? 00:00:00 ora_vktm_HMODB oracle 82445 1 0 17:51 ? 00:00:00 ora_gen0_HMODB oracle 82447 1 0 17:51 ? 00:00:00 ora_diag_HMODB oracle 82449 1 0 17:51 ? 00:00:00 ora_dbrm_HMODB oracle 82451 1 0 17:51 ? 00:00:00 ora_psp0_HMODB oracle 82453 1 0 17:51 ? 00:00:00 ora_dia0_HMODB oracle 82455 1 0 17:51 ? 00:00:00 ora_mman_HMODB oracle 82457 1 0 17:51 ? 00:00:00 ora_dbw0_HMODB oracle 82459 1 0 17:51 ? 00:00:00 ora_lgwr_HMODB oracle 82461 1 0 17:51 ? 00:00:00 ora_ckpt_HMODB oracle 82463 1 0 17:51 ? 00:00:00 ora_smon_HMODB oracle 82465 1 0 17:51 ? 00:00:00 ora_reco_HMODB oracle 82467 1 0 17:51 ? 00:00:00 ora_mmon_HMODB oracle 82469 1 0 17:51 ? 00:00:00 ora_mmnl_HMODB oracle 82471 1 0 17:51 ? 00:00:00 ora_d000_HMODB oracle 82473 1 0 17:51 ? 00:00:00 ora_s000_HMODB oracle 82638 1 0 17:51 ? 00:00:00 ora_arc0_HMODB oracle 82653 1 0 17:51 ? 00:00:00 ora_arc1_HMODB oracle 82655 1 0 17:51 ? 00:00:00 ora_arc2_HMODB oracle 82657 1 0 17:51 ? 00:00:00 ora_arc3_HMODB oracle 82755 1 0 17:51 ? 00:00:00 ora_qmnc_HMODB oracle 82807 1 0 17:51 ? 00:00:00 ora_cjq0_HMODB oracle 82835 1 0 17:51 ? 00:00:00 ora_vkrm_HMODB oracle 82863 1 0 17:51 ? 00:00:00 ora_q000_HMODB oracle 82865 1 0 17:51 ? 00:00:00 ora_q001_HMODB oracle 84099 1 1 17:54 ? 00:00:00 ora_j000_HMODB oracle 84101 1 0 17:54 ? 00:00:00 ora_j001_HMODB root 84268 3823 0 17:54 pts/2 00:00:00 grep ora_ [root@hmdg-db1 scripts]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/sda3 ext4 50G 19G 29G 40% / tmpfs tmpfs 3.9G 909M 3.0G 24% /dev/shm /dev/sda1 ext4 190M 40M 141M 22% /boot /dev/sdb1 ext4 30G 6.0G 22G 22% /oradata [root@hmdg-db1 scripts]# ip addr show dev eth2 3: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:59:d5:91 brd ff:ff:ff:ff:ff:ff inet 172.16.10.25/24 brd 172.16.10.255 scope global eth2 inet 172.16.10.130/24 scope global secondary eth2 inet 172.16.10.131/24 scope global secondary eth2 inet6 fe80::20c:29ff:fe59:d591/64 scope link valid_lft forever preferred_lft forever ##DB2 [root@hmdg-db2 scripts]# ps -ef | grep ora_ root 73251 31390 0 17:55 pts/2 00:00:00 grep ora_ [root@hmdg-db2 scripts]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/sda3 ext4 50G 18G 30G 37% / tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm /dev/sda1 ext4 190M 40M 141M 22% /boot [root@hmdg-db2 scripts]# ip addr show dev eth2 3: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:dd:d1:7f brd ff:ff:ff:ff:ff:ff inet 172.16.10.26/24 brd 172.16.10.255 scope global eth2 inet6 fe80::20c:29ff:fedd:d17f/64 scope link valid_lft forever preferred_lft forever
停止或重啟主服務器的keepalibed服務
主服務器DB1
##系統日志 Apr 15 18:08:02 hmdg-db1 Keepalived[89311]: Stopping Apr 15 18:08:02 hmdg-db1 Keepalived_healthcheckers[89313]: Stopped Apr 15 18:08:02 hmdg-db1 Keepalived_vrrp[89314]: VRRP_Instance(Oracle_HA_1) sent 0 priority Apr 15 18:08:02 hmdg-db1 Keepalived_vrrp[89314]: VRRP_Instance(Oracle_HA_1) removing protocol VIPs. Apr 15 18:08:03 hmdg-db1 Keepalived_vrrp[89314]: Stopped Apr 15 18:08:03 hmdg-db1 Keepalived[89311]: Stopped Keepalived v1.3.2 (04/14,2018) ##nitify腳本的輸出日志 ------------------------------------------------------------------------------- Apr 15 18:08:03 Sun hmdg-db1 [keepalived_notify]: Transition to STOP STATE Apr 15 18:08:03 Sun hmdg-db1 [keepalived_notify]: removing the VIP on eth2 for 172.16.10.130,172.16.10.131 Apr 15 18:08:09 Sun hmdg-db1 [keepalived_notify]: Database Switchover To BACKUP Apr 15 18:08:09 Sun hmdg-db1 [keepalived_notify]: Database instance state is mounted Apr 15 18:08:09 Sun hmdg-db1 [keepalived_notify]: Backup current controlfile. SQL> alter database backup controlfile to '/backup/oracle/control/control_20181504180803'; Database altered. Apr 15 18:08:09 Sun hmdg-db1 [keepalived_notify]: Shutdown database instance, please wait... Database closed. Database dismounted. ORACLE instance shut down. Apr 15 18:08:18 Sun hmdg-db1 [keepalived_notify]: Database instance shutdown successfully. Apr 15 18:08:18 Sun hmdg-db1 [keepalived_notify]: umount sharedisk Apr 15 18:08:18 Sun hmdg-db1 [keepalived_notify]: umount /oradata success. Apr 15 18:08:18 Sun hmdg-db1 [keepalived_notify]: stopping listener... Apr 15 18:08:19 Sun hmdg-db1 [keepalived_notify]: The listener stop successfully ##服務資源檢查 [root@hmdg-db1 scripts]# ps -ef | grep ora_ root 90758 2451 0 18:09 pts/0 00:00:00 grep ora_ [root@hmdg-db1 scripts]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/sda3 ext4 50G 19G 29G 40% / tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm /dev/sda1 ext4 190M 40M 141M 22% /boot [root@hmdg-db1 scripts]# ip addr show dev eth2 3: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:59:d5:91 brd ff:ff:ff:ff:ff:ff inet 172.16.10.25/24 brd 172.16.10.255 scope global eth2 inet6 fe80::20c:29ff:fe59:d591/64 scope link valid_lft forever preferred_lft forever
由于主服務的keepalived異常,keepalived實例組將會重新分配MASTER角色,并將資源轉移到BACKUP上(即重新選舉后新的MASTER)
備服務器DB2
##系統日志 Apr 15 18:08:03 hmdg-db2 Keepalived_vrrp[77811]: VRRP_Instance(Oracle_HA_1) Transition to MASTER STATE Apr 15 18:08:05 hmdg-db2 Keepalived_vrrp[77811]: VRRP_Instance(Oracle_HA_1) Entering MASTER STATE Apr 15 18:08:05 hmdg-db2 Keepalived_vrrp[77811]: VRRP_Instance(Oracle_HA_1) setting protocol VIPs. Apr 15 18:08:05 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:08:05 hmdg-db2 Keepalived_vrrp[77811]: VRRP_Instance(Oracle_HA_1) Sending/queueing gratuitous ARPs on eth2 for 172.16.10.130 Apr 15 18:08:05 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:08:05 hmdg-db2 Keepalived_vrrp[77811]: VRRP_Instance(Oracle_HA_1) Sending/queueing gratuitous ARPs on eth2 for 172.16.10.131 Apr 15 18:08:05 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:08:05 hmdg-db2 Keepalived_healthcheckers[77810]: Netlink reflector reports IP 172.16.10.130 added Apr 15 18:08:05 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:08:05 hmdg-db2 Keepalived_healthcheckers[77810]: Netlink reflector reports IP 172.16.10.131 added Apr 15 18:08:05 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:08:05 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:08:05 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:08:05 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:08:05 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:08:05 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:08:10 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:08:10 hmdg-db2 Keepalived_vrrp[77811]: VRRP_Instance(Oracle_HA_1) Sending/queueing gratuitous ARPs on eth2 for 172.16.10.130 Apr 15 18:08:10 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:08:10 hmdg-db2 Keepalived_vrrp[77811]: VRRP_Instance(Oracle_HA_1) Sending/queueing gratuitous ARPs on eth2 for 172.16.10.131 Apr 15 18:08:10 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:08:10 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:08:10 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:08:10 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:08:10 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:08:10 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:08:10 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:08:10 hmdg-db2 Keepalived_vrrp[77811]: Sending gratuitous ARP on eth2 for 172.16.10.131 ##notify腳本日志 ------------------------------------------------------------------------------- Apr 15 18:08:05 Sun hmdg-db2 [keepalived_notify]: Transition to MASTER STATE Apr 15 18:08:05 Sun hmdg-db2 [keepalived_notify]: Setup the VIP on eth2 172.16.10.130,172.16.10.131 Apr 15 18:08:05 Sun hmdg-db2 [keepalived_notify]: Database Switchover To MASTER Apr 15 18:08:05 Sun hmdg-db2 [keepalived_notify]: Check remote node sharedisk mounted. Apr 15 18:08:05 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [1]... Apr 15 18:08:06 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [2]... Apr 15 18:08:08 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [3]... Apr 15 18:08:09 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [4]... Apr 15 18:08:10 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [5]... Apr 15 18:08:11 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [6]... Apr 15 18:08:12 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [7]... Apr 15 18:08:13 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [8]... Apr 15 18:08:14 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [9]... Apr 15 18:08:15 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [10]... Apr 15 18:08:17 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [11]... Apr 15 18:08:18 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [12]... Apr 15 18:08:19 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 check passed. Apr 15 18:08:19 Sun hmdg-db2 [keepalived_notify]: mount /dev/sdb1 on /oradata Apr 15 18:08:19 Sun hmdg-db2 [keepalived_notify]: restore controlfile 1 ORACLE instance started. Total System Global Area 1603411968 bytes Fixed Size 2213776 bytes Variable Size 1056966768 bytes Database Buffers 536870912 bytes Redo Buffers 7360512 bytes Recovery Manager: Release 11.2.0.1.0 - Production on Sun Apr 15 18:08:20 2018 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: HMODB (not mounted) using target database control file instead of recovery catalog RMAN> Starting restore at 15-APR-18 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=572 device type=DISK channel ORA_DISK_1: copied control file copy output file name=/oradata/HMODB/control01.ctl output file name=/u01/app/oracle/flash_recovery_area/HMODB/control02.ctl output file name=/home/oracle/rman/HMODB/control03.ctl Finished restore at 15-APR-18 RMAN> Recovery Manager complete. Apr 15 18:08:22 Sun hmdg-db2 [keepalived_notify]: alter database to mount Database altered. Apr 15 18:08:26 Sun hmdg-db2 [keepalived_notify]: alter database to open Database altered. Apr 15 18:08:33 Sun hmdg-db2 [keepalived_notify]: Database opened. Apr 15 18:08:33 Sun hmdg-db2 [keepalived_notify]: Startup listener Apr 15 18:08:33 Sun hmdg-db2 [keepalived_notify]: starting listener... Apr 15 18:08:33 Sun hmdg-db2 [keepalived_notify]: The listener startup successfully ##服務檢查 [root@hmdg-db2 scripts]# ps -ef | grep ora_ oracle 78632 1 0 18:08 ? 00:00:00 ora_pmon_HMODB oracle 78634 1 0 18:08 ? 00:00:00 ora_vktm_HMODB oracle 78638 1 0 18:08 ? 00:00:00 ora_gen0_HMODB oracle 78640 1 0 18:08 ? 00:00:00 ora_diag_HMODB oracle 78642 1 0 18:08 ? 00:00:00 ora_dbrm_HMODB oracle 78644 1 0 18:08 ? 00:00:00 ora_psp0_HMODB oracle 78646 1 0 18:08 ? 00:00:00 ora_dia0_HMODB oracle 78648 1 0 18:08 ? 00:00:00 ora_mman_HMODB oracle 78650 1 0 18:08 ? 00:00:00 ora_dbw0_HMODB oracle 78652 1 0 18:08 ? 00:00:00 ora_lgwr_HMODB oracle 78654 1 0 18:08 ? 00:00:00 ora_ckpt_HMODB oracle 78656 1 0 18:08 ? 00:00:00 ora_smon_HMODB oracle 78658 1 0 18:08 ? 00:00:00 ora_reco_HMODB oracle 78660 1 0 18:08 ? 00:00:00 ora_mmon_HMODB oracle 78662 1 0 18:08 ? 00:00:00 ora_mmnl_HMODB oracle 78664 1 0 18:08 ? 00:00:00 ora_d000_HMODB oracle 78666 1 0 18:08 ? 00:00:00 ora_s000_HMODB oracle 78844 1 0 18:08 ? 00:00:00 ora_arc0_HMODB oracle 78847 1 0 18:08 ? 00:00:00 ora_arc1_HMODB oracle 78849 1 0 18:08 ? 00:00:00 ora_arc2_HMODB oracle 78851 1 0 18:08 ? 00:00:00 ora_arc3_HMODB oracle 78879 1 0 18:08 ? 00:00:00 ora_qmnc_HMODB oracle 78968 1 0 18:08 ? 00:00:00 ora_cjq0_HMODB oracle 79031 1 0 18:08 ? 00:00:00 ora_vkrm_HMODB oracle 79059 1 0 18:08 ? 00:00:00 ora_q000_HMODB oracle 79061 1 0 18:08 ? 00:00:00 ora_q001_HMODB oracle 81652 1 0 18:13 ? 00:00:00 ora_smco_HMODB oracle 81667 1 0 18:13 ? 00:00:00 ora_w000_HMODB root 81808 31390 0 18:13 pts/2 00:00:00 grep ora_ [root@hmdg-db2 scripts]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/sda3 ext4 50G 18G 30G 37% / tmpfs tmpfs 3.9G 909M 3.0G 24% /dev/shm /dev/sda1 ext4 190M 40M 141M 22% /boot /dev/sdb1 ext4 30G 6.0G 22G 22% /oradata [root@hmdg-db2 scripts]# ip addr show dev eth2 3: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:dd:d1:7f brd ff:ff:ff:ff:ff:ff inet 172.16.10.26/24 brd 172.16.10.255 scope global eth2 inet 172.16.10.130/24 scope global secondary eth2 inet 172.16.10.131/24 scope global secondary eth2 inet6 fe80::20c:29ff:fedd:d17f/64 scope link valid_lft forever preferred_lft forever
首先將DB1的Keepalived服務啟動
Apr 15 18:15:14 hmdg-db1 Keepalived_vrrp[90792]: Opening file '/usr/local/keepalived/etc/keepalived/keepalived.conf'. Apr 15 18:15:14 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Instance(Oracle_HA_1) removing protocol VIPs. Apr 15 18:15:14 hmdg-db1 Keepalived_vrrp[90792]: SECURITY VIOLATION - scripts are being executed but script_security not enabled. Apr 15 18:15:14 hmdg-db1 Keepalived_vrrp[90792]: Sync group ORACLE_HA_GROUP has only 1 virtual router(s) - removing Apr 15 18:15:14 hmdg-db1 Keepalived_vrrp[90792]: Using LinkWatch kernel netlink reflector... Apr 15 18:15:14 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Instance(Oracle_HA_1) Entering BACKUP STATE Apr 15 18:15:14 hmdg-db1 Keepalived_vrrp[90792]: VRRP sockpool: [ifindex(3), proto(112), unicast(0), fd(10,11)] Apr 15 18:15:14 hmdg-db1 Keepalived_vrrp[90792]: pid 90794 exited with status 1 Apr 15 18:15:14 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Script(change_monitor_status) succeeded Apr 15 18:15:34 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Script(monitor_oracle_status) succeeded Apr 15 18:15:34 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Instance(Oracle_HA_1) Changing effective priority from 100 to 120
停止備服務器的keepalived服務
##系統日志 Apr 15 18:16:24 hmdg-db2 Keepalived_vrrp[83304]: VRRP_Instance(Oracle_HA_1) Entering BACKUP STATE Apr 15 18:16:24 hmdg-db2 Keepalived_vrrp[83304]: VRRP sockpool: [ifindex(3), proto(112), unicast(0), fd(10,11)] Apr 15 18:16:24 hmdg-db2 Keepalived_vrrp[83304]: VRRP_Script(change_monitor_status) succeeded Apr 15 18:16:25 hmdg-db2 Keepalived_vrrp[83304]: VRRP_Script(monitor_oracle_status) succeeded Apr 15 18:16:26 hmdg-db2 Keepalived_vrrp[83304]: VRRP_Instance(Oracle_HA_1) Changing effective priority from 90 to 110 ##notify日志 ------------------------------------------------------------------------------- Apr 15 18:16:24 Sun hmdg-db2 [keepalived_notify]: Transition to STOP STATE Apr 15 18:16:24 Sun hmdg-db2 [keepalived_notify]: removing the VIP on eth2 for 172.16.10.130,172.16.10.131 ------------------------------------------------------------------------------- Apr 15 18:16:24 Sun hmdg-db2 [keepalived_notify]: Transition to BACKUP STATE Apr 15 18:16:24 Sun hmdg-db2 [keepalived_notify]: removing the VIP on eth2 for 172.16.10.130,172.16.10.131 Apr 15 18:16:24 Sun hmdg-db2 [keepalived_notify]: Database Switchover To BACKUP Apr 15 18:16:24 Sun hmdg-db2 [keepalived_notify]: Database instance state is mounted Apr 15 18:16:25 Sun hmdg-db2 [keepalived_notify]: Backup current controlfile. SQL> alter database backup controlfile to '/backup/oracle/control/control_20181504181624'; Database altered. Apr 15 18:16:25 Sun hmdg-db2 [keepalived_notify]: Shutdown database instance, please wait... Database closed. Database dismounted. ORACLE instance shut down. Apr 15 18:16:34 Sun hmdg-db2 [keepalived_notify]: Database instance shutdown successfully. Apr 15 18:16:34 Sun hmdg-db2 [keepalived_notify]: umount sharedisk Apr 15 18:16:34 Sun hmdg-db2 [keepalived_notify]: umount /oradata success. Apr 15 18:16:34 Sun hmdg-db2 [keepalived_notify]: stopping listener... Apr 15 18:16:38 Sun hmdg-db2 [keepalived_notify]: The listener stop successfully ##服務狀態 [root@hmdg-db2 scripts]# ps -ef | grep ora_ root 84619 31390 0 18:18 pts/2 00:00:00 grep ora_ [root@hmdg-db2 scripts]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/sda3 ext4 50G 18G 30G 37% / tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm /dev/sda1 ext4 190M 40M 141M 22% /boot [root@hmdg-db2 scripts]# ip addr show dev eth2 3: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:dd:d1:7f brd ff:ff:ff:ff:ff:ff inet 172.16.10.26/24 brd 172.16.10.255 scope global eth2 inet6 fe80::20c:29ff:fedd:d17f/64 scope link valid_lft forever preferred_lft forever
檢查DB1是否轉換為MASTER并接管服務資源
##DB1的系統日志 Apr 15 18:15:14 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Script(change_monitor_status) succeeded Apr 15 18:15:34 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Script(monitor_oracle_status) succeeded Apr 15 18:15:34 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Instance(Oracle_HA_1) Changing effective priority from 100 to 120 Apr 15 18:16:23 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Instance(Oracle_HA_1) Transition to MASTER STATE Apr 15 18:16:25 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Instance(Oracle_HA_1) Entering MASTER STATE Apr 15 18:16:25 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Instance(Oracle_HA_1) setting protocol VIPs. Apr 15 18:16:25 hmdg-db1 Keepalived_vrrp[90792]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:16:25 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Instance(Oracle_HA_1) Sending/queueing gratuitous ARPs on eth2 for 172.16.10.130 Apr 15 18:16:25 hmdg-db1 Keepalived_vrrp[90792]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:16:25 hmdg-db1 Keepalived_healthcheckers[90790]: Netlink reflector reports IP 172.16.10.130 added Apr 15 18:16:25 hmdg-db1 Keepalived_healthcheckers[90790]: Netlink reflector reports IP 172.16.10.131 added Apr 15 18:16:25 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Instance(Oracle_HA_1) Sending/queueing gratuitous ARPs on eth2 for 172.16.10.131 Apr 15 18:16:25 hmdg-db1 Keepalived_vrrp[90792]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:16:25 hmdg-db1 Keepalived_vrrp[90792]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:16:25 hmdg-db1 Keepalived_vrrp[90792]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:16:25 hmdg-db1 Keepalived_vrrp[90792]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:16:25 hmdg-db1 Keepalived_vrrp[90792]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:16:25 hmdg-db1 Keepalived_vrrp[90792]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:16:25 hmdg-db1 Keepalived_vrrp[90792]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:16:25 hmdg-db1 Keepalived_vrrp[90792]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:16:30 hmdg-db1 Keepalived_vrrp[90792]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:16:30 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Instance(Oracle_HA_1) Sending/queueing gratuitous ARPs on eth2 for 172.16.10.130 Apr 15 18:16:30 hmdg-db1 Keepalived_vrrp[90792]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:16:30 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Instance(Oracle_HA_1) Sending/queueing gratuitous ARPs on eth2 for 172.16.10.131 Apr 15 18:16:30 hmdg-db1 Keepalived_vrrp[90792]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:16:30 hmdg-db1 Keepalived_vrrp[90792]: Sending gratuitous ARP on eth2 for 172.16.10.131 ##DB1的notify腳本日志 ------------------------------------------------------------------------------- Apr 15 18:16:25 Sun hmdg-db1 [keepalived_notify]: Transition to MASTER STATE Apr 15 18:16:25 Sun hmdg-db1 [keepalived_notify]: Setup the VIP on eth2 172.16.10.130,172.16.10.131 Apr 15 18:16:25 Sun hmdg-db1 [keepalived_notify]: Database Switchover To MASTER Apr 15 18:16:25 Sun hmdg-db1 [keepalived_notify]: Check remote node sharedisk mounted. Apr 15 18:16:26 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [1]... Apr 15 18:16:27 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [2]... Apr 15 18:16:28 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [3]... Apr 15 18:16:29 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [4]... Apr 15 18:16:30 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [5]... Apr 15 18:16:31 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [6]... Apr 15 18:16:32 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [7]... Apr 15 18:16:34 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [8]... Apr 15 18:16:35 Sun hmdg-db1 [keepalived_notify]: /dev/sdb1 check passed. Apr 15 18:16:35 Sun hmdg-db1 [keepalived_notify]: mount /dev/sdb1 on /oradata Apr 15 18:16:35 Sun hmdg-db1 [keepalived_notify]: restore controlfile 1 ORACLE instance started. Total System Global Area 1603411968 bytes Fixed Size 2213776 bytes Variable Size 1056966768 bytes Database Buffers 536870912 bytes Redo Buffers 7360512 bytes Recovery Manager: Release 11.2.0.1.0 - Production on Sun Apr 15 18:16:38 2018 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: HMODB (not mounted) using target database control file instead of recovery catalog RMAN> Starting restore at 15-APR-18 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=572 device type=DISK channel ORA_DISK_1: copied control file copy output file name=/oradata/HMODB/control01.ctl output file name=/u01/app/oracle/flash_recovery_area/HMODB/control02.ctl output file name=/home/oracle/rman/HMODB/control03.ctl Finished restore at 15-APR-18 RMAN> Recovery Manager complete. Apr 15 18:16:40 Sun hmdg-db1 [keepalived_notify]: alter database to mount Database altered. Apr 15 18:16:44 Sun hmdg-db1 [keepalived_notify]: alter database to open Database altered. Apr 15 18:16:50 Sun hmdg-db1 [keepalived_notify]: Database opened. Apr 15 18:16:50 Sun hmdg-db1 [keepalived_notify]: Startup listener Apr 15 18:16:50 Sun hmdg-db1 [keepalived_notify]: starting listener... Apr 15 18:16:50 Sun hmdg-db1 [keepalived_notify]: The listener startup successfully ##服務狀態 [root@hmdg-db1 scripts]# ps -ef | grep ora_ oracle 91765 1 0 18:16 ? 00:00:00 ora_pmon_HMODB oracle 91767 1 0 18:16 ? 00:00:00 ora_vktm_HMODB oracle 91771 1 0 18:16 ? 00:00:00 ora_gen0_HMODB oracle 91773 1 0 18:16 ? 00:00:00 ora_diag_HMODB oracle 91775 1 0 18:16 ? 00:00:00 ora_dbrm_HMODB oracle 91777 1 0 18:16 ? 00:00:00 ora_psp0_HMODB oracle 91779 1 0 18:16 ? 00:00:00 ora_dia0_HMODB oracle 91781 1 0 18:16 ? 00:00:00 ora_mman_HMODB oracle 91783 1 0 18:16 ? 00:00:00 ora_dbw0_HMODB oracle 91785 1 0 18:16 ? 00:00:00 ora_lgwr_HMODB oracle 91787 1 0 18:16 ? 00:00:00 ora_ckpt_HMODB oracle 91789 1 0 18:16 ? 00:00:00 ora_smon_HMODB oracle 91791 1 0 18:16 ? 00:00:00 ora_reco_HMODB oracle 91793 1 0 18:16 ? 00:00:00 ora_mmon_HMODB oracle 91795 1 0 18:16 ? 00:00:00 ora_mmnl_HMODB oracle 91797 1 0 18:16 ? 00:00:00 ora_d000_HMODB oracle 91799 1 0 18:16 ? 00:00:00 ora_s000_HMODB oracle 91965 1 0 18:16 ? 00:00:00 ora_arc0_HMODB oracle 91967 1 0 18:16 ? 00:00:00 ora_arc1_HMODB oracle 91969 1 0 18:16 ? 00:00:00 ora_arc2_HMODB oracle 91971 1 0 18:16 ? 00:00:00 ora_arc3_HMODB oracle 91999 1 0 18:16 ? 00:00:00 ora_qmnc_HMODB oracle 92090 1 0 18:16 ? 00:00:00 ora_cjq0_HMODB oracle 92105 1 0 18:16 ? 00:00:00 ora_vkrm_HMODB oracle 92181 1 0 18:16 ? 00:00:00 ora_q000_HMODB oracle 92183 1 0 18:16 ? 00:00:00 ora_q001_HMODB oracle 93817 1 0 18:20 ? 00:00:00 ora_j000_HMODB oracle 93819 1 0 18:20 ? 00:00:00 ora_j001_HMODB root 94030 2451 0 18:20 pts/0 00:00:00 grep ora_ [root@hmdg-db1 scripts]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/sda3 ext4 50G 19G 29G 40% / tmpfs tmpfs 3.9G 909M 3.0G 24% /dev/shm /dev/sda1 ext4 190M 40M 141M 22% /boot /dev/sdb1 ext4 30G 6.0G 22G 22% /oradata [root@hmdg-db1 scripts]# ip addr show dev eth2 3: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:59:d5:91 brd ff:ff:ff:ff:ff:ff inet 172.16.10.25/24 brd 172.16.10.255 scope global eth2 inet 172.16.10.130/24 scope global secondary eth2 inet 172.16.10.131/24 scope global secondary eth2 inet6 fe80::20c:29ff:fe59:d591/64 scope link valid_lft forever preferred_lft forever
1、手動關閉DB1的數據庫實例
[oracle@hmdg-db1 ~]$ export ORACLE_SID=HMODB [oracle@hmdg-db1 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 15 18:21:52 2018 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> SELECT OPEN_MODE,NAME,DATABASE_ROLE FROM V$DATABASE; OPEN_MODE NAME DATABASE_ROLE -------------------- --------- ---------------- READ WRITE HMODB PRIMARY SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down.
2、查看keepalived日志
## Apr 15 18:23:34 hmdg-db1 Keepalived_vrrp[90792]: pid 96098 exited with status 2 Apr 15 18:23:48 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Instance(Oracle_HA_1) Received advert with higher priority 110, ours 100 Apr 15 18:23:48 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Instance(Oracle_HA_1) Entering BACKUP STATE Apr 15 18:23:48 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Instance(Oracle_HA_1) removing protocol VIPs. Apr 15 18:23:48 hmdg-db1 Keepalived_healthcheckers[90790]: Netlink reflector reports IP 172.16.10.130 removed Apr 15 18:23:48 hmdg-db1 Keepalived_healthcheckers[90790]: Netlink reflector reports IP 172.16.10.131 removed Apr 15 18:23:54 hmdg-db1 Keepalived_vrrp[90792]: pid 96486 exited with status 2 Apr 15 18:24:14 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Script(monitor_oracle_status) succeeded Apr 15 18:24:15 hmdg-db1 Keepalived_vrrp[90792]: VRRP_Instance(Oracle_HA_1) Changing effective priority from 100 to 120 ------------------------------------------------------------------------------- Apr 15 18:23:48 Sun hmdg-db1 [keepalived_notify]: Transition to BACKUP STATE Apr 15 18:23:48 Sun hmdg-db1 [keepalived_notify]: removing the VIP on eth2 for 172.16.10.130,172.16.10.131 Apr 15 18:23:48 Sun hmdg-db1 [keepalived_notify]: Database Switchover To BACKUP Apr 15 18:23:49 Sun hmdg-db1 [keepalived_notify]: Database instance state is mounted Apr 15 18:23:49 Sun hmdg-db1 [keepalived_notify]: Backup current controlfile. SQL> alter database backup controlfile to '/backup/oracle/control/control_20181504182348'; Database altered. Apr 15 18:23:49 Sun hmdg-db1 [keepalived_notify]: Shutdown database instance, please wait... Database closed. Database dismounted. ORACLE instance shut down. Apr 15 18:23:55 Sun hmdg-db1 [keepalived_notify]: Database instance shutdown successfully. Apr 15 18:23:55 Sun hmdg-db1 [keepalived_notify]: umount sharedisk Apr 15 18:23:55 Sun hmdg-db1 [keepalived_notify]: umount /oradata success. Apr 15 18:23:55 Sun hmdg-db1 [keepalived_notify]: stopping listener... Apr 15 18:23:56 Sun hmdg-db1 [keepalived_notify]: The listener stop successfully [root@hmdg-db1 scripts]# ps -ef | grep ora_ root 97520 2451 0 18:26 pts/0 00:00:00 grep ora_ [root@hmdg-db1 scripts]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/sda3 ext4 50G 19G 29G 40% / tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm /dev/sda1 ext4 190M 40M 141M 22% /boot [root@hmdg-db1 scripts]# ip addr show dev eth2 3: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:59:d5:91 brd ff:ff:ff:ff:ff:ff inet 172.16.10.25/24 brd 172.16.10.255 scope global eth2 inet6 fe80::20c:29ff:fe59:d591/64 scope link valid_lft forever preferred_lft forever
3、查看DB2是否轉換為MASTER并接管服務
##系統日志 Apr 15 18:23:49 hmdg-db2 Keepalived_vrrp[88134]: VRRP_Instance(Oracle_HA_1) forcing a new MASTER election Apr 15 18:23:51 hmdg-db2 Keepalived_vrrp[88134]: VRRP_Instance(Oracle_HA_1) Transition to MASTER STATE Apr 15 18:23:53 hmdg-db2 Keepalived_vrrp[88134]: VRRP_Instance(Oracle_HA_1) Entering MASTER STATE Apr 15 18:23:53 hmdg-db2 Keepalived_vrrp[88134]: VRRP_Instance(Oracle_HA_1) setting protocol VIPs. Apr 15 18:23:53 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:23:53 hmdg-db2 Keepalived_vrrp[88134]: VRRP_Instance(Oracle_HA_1) Sending/queueing gratuitous ARPs on eth2 for 172.16.10.130 Apr 15 18:23:53 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:23:53 hmdg-db2 Keepalived_healthcheckers[88133]: Netlink reflector reports IP 172.16.10.130 added Apr 15 18:23:53 hmdg-db2 Keepalived_healthcheckers[88133]: Netlink reflector reports IP 172.16.10.131 added Apr 15 18:23:53 hmdg-db2 Keepalived_vrrp[88134]: VRRP_Instance(Oracle_HA_1) Sending/queueing gratuitous ARPs on eth2 for 172.16.10.131 Apr 15 18:23:53 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:23:53 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:23:53 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:23:53 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:23:53 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:23:53 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:23:53 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:23:53 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:23:57 hmdg-db2 kernel: EXT4-fs (sdb1): warning: maximal mount count reached, running e2fsck is recommended Apr 15 18:23:57 hmdg-db2 kernel: EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: Apr 15 18:23:58 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:23:58 hmdg-db2 Keepalived_vrrp[88134]: VRRP_Instance(Oracle_HA_1) Sending/queueing gratuitous ARPs on eth2 for 172.16.10.130 Apr 15 18:23:58 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:23:58 hmdg-db2 Keepalived_vrrp[88134]: VRRP_Instance(Oracle_HA_1) Sending/queueing gratuitous ARPs on eth2 for 172.16.10.131 Apr 15 18:23:58 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:23:58 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:23:58 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:23:58 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:23:58 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:23:58 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.131 Apr 15 18:23:58 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.130 Apr 15 18:23:58 hmdg-db2 Keepalived_vrrp[88134]: Sending gratuitous ARP on eth2 for 172.16.10.131 ##notify腳本日志 ------------------------------------------------------------------------------- Apr 15 18:23:53 Sun hmdg-db2 [keepalived_notify]: Transition to MASTER STATE Apr 15 18:23:53 Sun hmdg-db2 [keepalived_notify]: Setup the VIP on eth2 172.16.10.130,172.16.10.131 Apr 15 18:23:53 Sun hmdg-db2 [keepalived_notify]: Database Switchover To MASTER Apr 15 18:23:53 Sun hmdg-db2 [keepalived_notify]: Check remote node sharedisk mounted. Apr 15 18:23:53 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [1]... Apr 15 18:23:54 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [2]... Apr 15 18:23:56 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 is already mounted on remote node or busy. checking [3]... Apr 15 18:23:57 Sun hmdg-db2 [keepalived_notify]: /dev/sdb1 check passed. Apr 15 18:23:57 Sun hmdg-db2 [keepalived_notify]: mount /dev/sdb1 on /oradata Apr 15 18:23:57 Sun hmdg-db2 [keepalived_notify]: restore controlfile 1 ORACLE instance started. Total System Global Area 1603411968 bytes Fixed Size 2213776 bytes Variable Size 1056966768 bytes Database Buffers 536870912 bytes Redo Buffers 7360512 bytes Recovery Manager: Release 11.2.0.1.0 - Production on Sun Apr 15 18:23:58 2018 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: HMODB (not mounted) using target database control file instead of recovery catalog RMAN> Starting restore at 15-APR-18 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=572 device type=DISK channel ORA_DISK_1: copied control file copy output file name=/oradata/HMODB/control01.ctl output file name=/u01/app/oracle/flash_recovery_area/HMODB/control02.ctl output file name=/home/oracle/rman/HMODB/control03.ctl Finished restore at 15-APR-18 RMAN> Recovery Manager complete. Apr 15 18:23:59 Sun hmdg-db2 [keepalived_notify]: alter database to mount Database altered. Apr 15 18:24:04 Sun hmdg-db2 [keepalived_notify]: alter database to open Database altered. Apr 15 18:24:11 Sun hmdg-db2 [keepalived_notify]: Database opened. Apr 15 18:24:11 Sun hmdg-db2 [keepalived_notify]: Startup listener Apr 15 18:24:11 Sun hmdg-db2 [keepalived_notify]: listener already started. ##服務狀態檢查(Oracle進程、磁盤、VIP狀態) [root@hmdg-db2 scripts]# ps -ef | grep ora_ oracle 88629 1 0 18:23 ? 00:00:00 ora_pmon_HMODB oracle 88631 1 0 18:23 ? 00:00:00 ora_vktm_HMODB oracle 88635 1 0 18:23 ? 00:00:00 ora_gen0_HMODB oracle 88637 1 0 18:23 ? 00:00:00 ora_diag_HMODB oracle 88639 1 0 18:23 ? 00:00:00 ora_dbrm_HMODB oracle 88641 1 0 18:23 ? 00:00:00 ora_psp0_HMODB oracle 88643 1 0 18:23 ? 00:00:00 ora_dia0_HMODB oracle 88645 1 0 18:23 ? 00:00:00 ora_mman_HMODB oracle 88647 1 0 18:23 ? 00:00:00 ora_dbw0_HMODB oracle 88649 1 0 18:23 ? 00:00:00 ora_lgwr_HMODB oracle 88651 1 0 18:23 ? 00:00:00 ora_ckpt_HMODB oracle 88653 1 0 18:23 ? 00:00:00 ora_smon_HMODB oracle 88655 1 0 18:23 ? 00:00:00 ora_reco_HMODB oracle 88657 1 0 18:23 ? 00:00:00 ora_mmon_HMODB oracle 88659 1 0 18:23 ? 00:00:00 ora_mmnl_HMODB oracle 88661 1 0 18:23 ? 00:00:00 ora_d000_HMODB oracle 88663 1 0 18:23 ? 00:00:00 ora_s000_HMODB oracle 88828 1 0 18:24 ? 00:00:00 ora_arc0_HMODB oracle 88843 1 0 18:24 ? 00:00:00 ora_arc1_HMODB oracle 88845 1 0 18:24 ? 00:00:00 ora_arc2_HMODB oracle 88847 1 0 18:24 ? 00:00:00 ora_arc3_HMODB oracle 88944 1 0 18:24 ? 00:00:00 ora_qmnc_HMODB oracle 89011 1 0 18:24 ? 00:00:00 ora_cjq0_HMODB oracle 89026 1 0 18:24 ? 00:00:00 ora_vkrm_HMODB oracle 89054 1 0 18:24 ? 00:00:00 ora_q000_HMODB oracle 89056 1 0 18:24 ? 00:00:00 ora_q001_HMODB root 90790 31390 0 18:27 pts/2 00:00:00 grep ora_ [root@hmdg-db2 scripts]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/sda3 ext4 50G 18G 30G 37% / tmpfs tmpfs 3.9G 909M 3.0G 24% /dev/shm /dev/sda1 ext4 190M 40M 141M 22% /boot /dev/sdb1 ext4 30G 6.0G 22G 22% /oradata [root@hmdg-db2 scripts]# ip addr show dev eth2 3: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:dd:d1:7f brd ff:ff:ff:ff:ff:ff inet 172.16.10.26/24 brd 172.16.10.255 scope global eth2 inet 172.16.10.130/24 scope global secondary eth2 inet 172.16.10.131/24 scope global secondary eth2 inet6 fe80::20c:29ff:fedd:d17f/64 scope link valid_lft forever preferred_lft forever
結尾
本篇中主要的重點再在于測試部分。關于如何設計數據庫高可用集群方案可作為參考
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。