通過中轉機及ssh rsync 傳輸歸檔檔案進行同步
目的:
10.13.8.186 archived log 中轉機器 。 需要從production節點mxrac01,03,04,05(10.13.67.171/172/174/175)上的
任何一臺中拷貝所有節點的歸檔檔案, 然後傳送到 RAC Standby機器上 (10.13.9.171/173/174 任何一臺) 。
步驟:
1, 首先,要在中轉機上生成public key
dfms-arc-shipping$ cd /home/oracle
dfms-arc-shipping$mkdir .ssh
dfms-arc-shipping$chmod 700 .ssh
dfms-arc-shipping$ cd /home/oracle
dfms-arc-shipping$ ssh-keygen -t rsa
然後可以看到 .ssh 目錄下生成有 id_rsa.pub 檔案。
2. 然後在production各個節點(其實在一個準備拷貝的節點作業就可以了,這裡為了防止有節點出現問題)將中轉機的public key傳輸到
各個節點已經存在 authorized_keys 檔案中, 然後通過在中轉機上測試 ssh mxrac01 date 等來測試中轉機到RAC的連通性。
mxrac01$ssh 10.13.8.186 cat /home/oracle/.ssh/id_rsa.pub >>authorized_keys
mxrac03$ssh 10.13.8.186 cat /home/oracle/.ssh/id_rsa.pub >>authorized_keys
mxrac04$ssh 10.13.8.186 cat /home/oracle/.ssh/id_rsa.pub >>authorized_keys
mxrac05$ssh 10.13.8.186 cat /home/oracle/.ssh/id_rsa.pub >>authorized_keys
3. 同樣,中轉機上的archived log要傳輸到RAC Standby上, 我們要將中轉機的public key 傳輸到RAC Standby的各個節點的 authorized_keys
中, 由於中轉機是主動角色, 所以其他機器的public key 不用傳給中轉機的 authorized_keys (所以它可以不用生成這個檔案) 。 同樣測試中轉機到RAC
Standby各個節點的聯通性。
mxrac01$ssh 10.13.8.186 cat /home/oracle/.ssh/id_rsa.pub >>authorized_keys
mxrac03$ssh 10.13.8.186 cat /home/oracle/.ssh/id_rsa.pub >>authorized_keys
mxrac04$ssh 10.13.8.186 cat /home/oracle/.ssh/id_rsa.pub >>authorized_keys
mxrac05$ssh 10.13.8.186 cat /home/oracle/.ssh/id_rsa.pub >>authorized_keys
備註: 目前所有的拷貝工作都是production db及standby db中的節點4 在和中轉機進行, 只所有要加入中轉機的public key 給所有節點,建立ssh信任關係,
主要是為了防止節點4發生故障後, 只要修改rsync 指令碼中的IP即可 。
4. 設定指令碼(指令碼放在中轉機上):
dfms-arc-shipping$cat rsync_rac_arc
#!/bin/bash
pid=`/sbin/pidof rsync`
if [ "$pid" ]
then
echo "Rsync is already running...."
else
echo "Starting rsync from production db to middle server `date`"
rsync -e ssh -av oracle@10.13.67.174:/ocfs_data/mxdell/arch/ /ocfs_data/mxdell/arch/
echo "Starting rsync from middle server to standby server `date`"
rsync -e ssh -av /ocfs_data/mxdell/arch/ oracle@10.13.9.174:/ocfs_data/mxdell/arch/
echo "Completed rsync `date`"
fi
exit 0
5. 最後設定crontab (在中轉機上):
dfms-arc-shipping$crontab -l
*/10 * * * * bash /u01/run/rsync_rac_arc 1>>/u01/run/log/rsync_rac_arc.log 2>>/u01/run/log/rsync_rac_arc.bad
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-630857/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Mac下利用SSH進行傳輸檔案(轉)Mac
- 如何使用 rsync 透過 SSH 恢復部分傳輸的檔案
- linux下遠端傳送檔案命令,通過ssh協議傳輸檔案Linux協議
- 【rsync】使用rsync命令提高檔案傳輸效率
- 利用ssh傳輸檔案
- rsync 做檔案同步
- Win10系統怎麼通過藍芽與手機進行檔案傳輸Win10藍芽
- [rsync]——rsync檔案同步和備份
- rsync udr——遠端大檔案傳輸加速
- Centos rsync檔案同步配置CentOS
- ios檔案同步傳輸工具iOS
- 企業經常需要進行傳輸檔案,大檔案傳輸有哪些方法?
- scp不輸入密碼進行檔案傳輸密碼
- rsync排除多個檔案同步
- 什麼是極速檔案傳輸,極速檔案傳輸如何進行大檔案傳輸
- Windows 機器通過 FTP 上傳檔案WindowsFTP
- 在php中通過curl上傳檔案PHP
- Linux 檔案同步工具之 rsyncLinux
- Rsync 3.1.0 釋出,檔案同步工具
- 通過SQL Server對上傳檔案內容進行查詢SQLServer
- Win10系統怎麼透過藍芽與手機進行檔案傳輸Win10藍芽
- 資料檔案在網路“裸奔”,如何在網際網路中進行檔案傳輸?
- 通過配置檔案(.htaccess)實現檔案上傳
- FTP檔案服務搭建與同步傳輸FTP
- 哪裡有免費大檔案傳輸平臺?透過這4個網站免費來進行大檔案傳輸網站
- ADG歸檔不傳輸
- rsync同步和備份檔案到本地
- rsync + lsyncd 檔案實時同步/備份
- rsync 檔案同步工具配置記錄(zt)
- 通過RMAN-transport獲取傳輸表空間檔案
- 兩機之間不用密碼傳輸檔案(轉)密碼
- Android 使用 Socket 對大檔案進行加密傳輸Android加密
- java tcp網路通訊 傳輸檔案JavaTCP
- Qt通過Http上傳檔案(路過)QTHTTP
- 基於rsync實現海量檔案高速傳輸的解決方案
- 使用WinSCP軟體在windows和Linux中進行檔案傳輸WindowsLinux
- win10通過映象檔案進行升級Win10
- linux 利用rsync實現檔案增量同步Linux