Bài đăng

Đang hiển thị bài đăng từ Tháng 7, 2019

MongoDB Backup & Restore

MongoDB Backup & Restore # Các phương pháp backup cho mongoDB    -  mongdump:       + Sử dụng trong trương hợp kích thước data không quá lớn       + Thời gian backup và restore lâu       + Dẽ dàng thao tác    -  rsync and copy       + Phù hợp với kích thước nhỏ       + Thời gian backup lâu, nhưng restore nhanh       + Dễ dàng cho việc thao tác    -  Percona hot backup:       ?    -  Point in time use oplog .       + Cho phép recovery tại một thời diểm mong muốn       + Phải enable oplog => replication       + Thời gian backup and restore nhanh # Tim hieu command "mongodump" - # Quy trình thực hiệc backup : point in time use oplog    - B1. Chuẩn bị để việc login dễ dang hơn                 $  auth ="...

MONGODB: UNDERSTANDING OPLOG

The following table clearly explains what each Oplog field denotes. F Alias Details Operations Values ts TimeSpace Holds the “Time of the operation” & “incremental id”. For all bulk (insert/remove/update) operations “Time of the operation” remains same and id changes to an incremental value. Default value of the id is 1 For All Operations (Time of the operation, incremental id) h  hash a unique ID for each operation For All Operations NumberLong(“7202552052460497158”) t NA NA For All Operations NumberLong(1) v version# version For All Operations 2 op Operation Type Write operations (import/Insert/Delete/Update/) Write Operations i/d/u Commands that affect database (Create, Drop: Database/collection) Command Operations C Informational Operation No-Operation N ns NameSpace The database and collection affected by the operation Write Operations (db_name.collection_name) Command Operations (db_name.$cmd)) No-Operation Blank O Operation Info/Data of the Operations I...

COUCHBASE BACKUP AND RECOVERY

Hình ảnh
# Couchbase có các loại backup sau :   - Full backup   - Differential incremental backup   - Cumulative incremetal backup (accu) SAMPLE COUCHBASE BACKUP SCRIPT #!/bin/bash # File: couchbase_backup.sh # Author: Chad Dimatulac # Description: This is a sample backup for Couchbase. #    A full backup kicks in at a designated day (i.e. Saturday) and will have a cumulative backup on succeeding days. #    The script uses the BACKUP_PATH/current as its active directory path to store the backup for the week. #    As the week cycles to the next full backup, the current dir data will be moved to archive and an empty #    current dir will be available to the backup process. # To run:   # nohup ./couchbase_backup.sh & # LOG_DATE=`date +%Y%m%d%H%M` DAY_OF_WEEK=`date +%a` CB_HOME=/app/couchbase/inst1/opt/couchbase PATH=$PATH:$CB_HOME/bin ; export PATH CBBACKUP=$CB_HOME/bi...