使用前配置
/usr/local/polardb_cluster_manager/bin/plugin/manager/manager_extern.conf
"BackupMachineList":["10.162.93.56:1888","10.162.4.208:1888","10.162.4.209:1888"],
"ManagerAddr": "10.162.93.56:5500",
說(shuō)明:
/var/polardb/cluster/clusterid/postgresql.conf
archive_mode=always
archive_command=
show archive_mode;
show archive_command;
"ManagerAddr": ["10.162.93.56:5500"], #端口為CM端口。
"ManagerAddr": ["10.162.93.56:5500"], #端口為CM端口
systemctl restart backupctl.service
備份集群
cmgateway="10.162.93.56:5500" #CM ip和端口
polardbdata="/mnt/disk2" #數(shù)據(jù)存放目錄
pgdata="/var/local/polardb/clusters/mycluster" #數(shù)據(jù)庫(kù)工作目錄
storagetype="fs" #備份存儲(chǔ)類(lèi)型
dst="/backup/test" #備份存放目錄
instanceid="polardb-flex-test" #實(shí)例ID
cd /usr/local/polardb_o_backup_tool_current/bin
./regular-fullbackup-flex.sh
[INFO] backup wal file [xxxx] finished
[INFO] main [pgpipeline.backup] Run success
cmgateway="10.162.93.56:5500" #CM ip和端口
polardbdata="/mnt/disk2" #數(shù)據(jù)存放目錄
pgdata="/var/local/polardb/clusters/mycluster" #數(shù)據(jù)庫(kù)工作目錄
storagetype="http" #備份存儲(chǔ)類(lèi)型
dst=" 10.162.93.56:8080" #備份存放目錄
instanceid="polardb-flex-test" #實(shí)例ID
cd /usr/local/polardb_o_backup_tool_current/bin
./regular-fullbackup-flex.sh
[INFO] backup wal file [xxxx] finished
[INFO] main [pgpipeline.backup] Run success
cmgateway="10.162.93.56:5500" #CM ip和端口
polardbdata="/mnt/disk2" #數(shù)據(jù)存放目錄
pgdata="/var/local/polardb/clusters/mycluster" #數(shù)據(jù)庫(kù)工作目錄
storagetype="fs" #備份存儲(chǔ)類(lèi)型
dst="/backup/test" #備份存放目錄
instanceid="polardb-flex-test" #實(shí)例ID
cd /usr/local/polardb_o_backup_tool_current/bin
./regular-increbackup-flex.sh
tailf backup.log
cmgateway="10.162.93.56:5500" #CM ip和端口
polardbdata="/mnt/disk2" #數(shù)據(jù)存放目錄
pgdata="/var/local/polardb/clusters/mycluster" #數(shù)據(jù)庫(kù)工作目錄
storagetype="fs" #備份存儲(chǔ)類(lèi)型
dst="10.162.93.56:8080" #備份存放目錄
instanceid="polardb-flex-test" #實(shí)例ID
cd /usr/local/polardb_o_backup_tool_current/bin
./regular-increbackup-flex.sh
tailf backup.log
cmgateway="10.162.93.56:5500" #CM端口和IP
instanceid="polar-flex-test" #實(shí)例ID
cd /usr/local/polardb_o_backup_tool_current/bin
./stop-increbackup-flex.sh
恢復(fù)集群
cmgateway="10.162.93.56:5500"
backupmachine="10.162.93.56:1888"
polardbdata="/mnt/disk3"
pgdata="/var/local/polardb/clusters/mycluster_recovery"
storagetype="fs"
dst="/root/testbk"
instanceid="polar-flex-test"
fullbackupid="testbkid-031101"
recoverytime=0
# 恢復(fù)到指定時(shí)間點(diǎn)示例:
cmgateway="10.162.93.56:5500"
backupmachine="10.162.93.56:1888"
polardbdata="/mnt/disk3"
pgdata="/var/local/polardb/clusters/mycluster_recovery"
storagetype="fs"
dst="/root/testbk"
instanceid="polar-flex-test"
fullbackupid=""
recoverytime=1616050150
cmgateway="10.162.93.56:5500"
backupmachine="10.162.93.56:1888"
polardbdata="/mnt/disk3"
pgdata="/var/local/polardb/clusters/mycluster_recovery"
storagetype="http"
dst="10.162.93.56:8080"
instanceid="polar-flex-test"
fullbackupid="testbkid-031101"
recoverytime=0
# 恢復(fù)到指定時(shí)間點(diǎn)?例:
cmgateway="10.162.93.56:5500"
backupmachine="10.162.93.56:1888"
polardbdata="/mnt/disk3"
pgdata="/var/local/polardb/clusters/mycluster_recovery"
storagetype="http"
dst="10.162.93.56:8080"
instanceid="polar-flex-test"
fullbackupid=""
recoverytime=1616050150
main [increpipeline.restore] Run success
pdbcli upgrade backup
cat > /root/pdbcli-0.5.1/config.yaml < all:
hosts:
host01:
ansible_host: 10.253.181.1
vars:
polardb_data_root_dir: /data01/polardb/data
cluster_id: mycluster
primary_db_host: host01
external_storage_path: /data01/polardb_cluster_mycluster
firewalld_enabled: false
ansible_group_priority: 99
ansible_python_interpreter: /usr/bin/python2.7
children:
db:
hosts:
host01:
polardb_polar_hostid: 1
vars:
polardb_custom_params: []
polardb_recovery_custom_params:
- restore_command =
- recovery_target_action = promote
cm:
hosts:
host01:
var:
proxy:
hosts:
host01:
var:
EOF
#安裝集群組件
執(zhí)行pdbcli install cluster --config=config.yaml安裝集群組件
#創(chuàng)建單節(jié)點(diǎn)集群
pdbcli create cluster --create-from-backup --config=config.yaml
#備節(jié)點(diǎn)安裝集群組件和數(shù)據(jù)庫(kù)引擎
pdbcli install node --target host02
pdbcli install node --target host03
#重建備節(jié)點(diǎn)數(shù)據(jù)庫(kù)
pdbcli rebuild db --targer host02
pdbcli rebuild db --targer host03
#重建完成后檢查集群狀態(tài)
pdbcli status --config=config.yaml
crontab -e
0 4 * * 6 /usr/local/polardb_o_backup_tool_current/bin/regular-fullbackup-flex.sh
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/129269.html
使用BenchmarkSQL對(duì)Polardb數(shù)據(jù)庫(kù)進(jìn)行TPCC測(cè)試 img{ display:block; margin:0 auto !important; width:100%; } body{ width:...
摘要:數(shù)據(jù)方舟已經(jīng)在多個(gè)數(shù)據(jù)安全案例中得到應(yīng)用,并得到了眾多用戶(hù)的認(rèn)可。相對(duì)于數(shù)據(jù)方舟產(chǎn)品,的價(jià)格直降,低至元月,保護(hù)核心的數(shù)據(jù)資產(chǎn),每日只需元典型應(yīng)用場(chǎng)景容災(zāi)備份利用快照定期備份重要的業(yè)務(wù)數(shù)據(jù),以應(yīng)對(duì)誤操作攻擊或病毒等導(dǎo)致的數(shù)據(jù)丟失風(fēng)險(xiǎn)。在企業(yè)數(shù)字化轉(zhuǎn)型的浪潮下,數(shù)據(jù)正成為企業(yè)核心資產(chǎn)甚至命門(mén),數(shù)據(jù)安全的重要性不言而喻??墒羌幢闫髽I(yè)對(duì)數(shù)據(jù)安全高度重視,幾乎每年還是會(huì)發(fā)生震撼業(yè)界的數(shù)據(jù)丟失大事件:...
摘要:死鎖問(wèn)題可以預(yù)防,可以解決死鎖年月日數(shù)據(jù)庫(kù)的完整性約束實(shí)體完整性約束定義主鍵。主鍵不能為空,不能重復(fù)參照完整性約束外鍵。系統(tǒng)需要進(jìn)行多次連接,才能進(jìn)行查詢(xún)操作,是的系統(tǒng)效率大大下降。 ...
摘要:在年推出了為云主機(jī)磁盤(pán)提供持續(xù)數(shù)據(jù)保護(hù)的數(shù)據(jù)方舟產(chǎn)品,支持最小精確到秒級(jí)的恢復(fù),針對(duì)數(shù)據(jù)刪除或者丟失事件,能夠最大程度的挽回?cái)?shù)據(jù)。為此我們推出了磁盤(pán)快照服務(wù),基于數(shù)據(jù)方舟技術(shù)并進(jìn)一步升級(jí),以更低的成本為全系列云盤(pán)普通提供了數(shù)據(jù)備份功能。UCloud在2015年推出了為云主機(jī)磁盤(pán)提供持續(xù)數(shù)據(jù)保護(hù)(CDP)的數(shù)據(jù)方舟(UDataArk)產(chǎn)品,支持最小精確到秒級(jí)的恢復(fù),針對(duì)數(shù)據(jù)刪除或者丟失事件,能...
摘要:在年推出了為云主機(jī)磁盤(pán)提供持續(xù)數(shù)據(jù)保護(hù)的數(shù)據(jù)方舟產(chǎn)品,支持最小精確到秒級(jí)的恢復(fù),針對(duì)數(shù)據(jù)刪除或者丟失事件,能夠最大程度的挽回?cái)?shù)據(jù)。為此我們推出了磁盤(pán)快照服務(wù),基于數(shù)據(jù)方舟技術(shù)并進(jìn)一步升級(jí),以更低的成本為全系列云盤(pán)普通提供了數(shù)據(jù)備份功能。UCloud在2015年推出了為云主機(jī)磁盤(pán)提供持續(xù)數(shù)據(jù)保護(hù)(CDP)的數(shù)據(jù)方舟(UDataArk)產(chǎn)品,支持最小精確到秒級(jí)的恢復(fù),針對(duì)數(shù)據(jù)刪除或者丟失事件,能...
閱讀 1359·2023-01-11 13:20
閱讀 1707·2023-01-11 13:20
閱讀 1215·2023-01-11 13:20
閱讀 1908·2023-01-11 13:20
閱讀 4166·2023-01-11 13:20
閱讀 2759·2023-01-11 13:20
閱讀 1402·2023-01-11 13:20
閱讀 3673·2023-01-11 13:20