In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The cbbackup tool is a flexible backup command that allows you to back up different combinations of local and remote nodes and data involving your cluster:
Single node single buckets
All buckets on a single node
A single buckets on the entire cluster
All buckets on the entire cluster
Backups can copy files directly on a single node, or you can connect to a remote cluster and save them to the backup location in the form of a data stream. Backups can be performed on running nodes or clusters or offline nodes.
The cbbackup command stores data in a format that is easy to recover. Using cbrestore when you need to restore, you can restore data to any configured cluster. The source and destination clusters do not need to satisfy the information you save when using the cbbackup command.
The cbbackup command copies data from each item defined by the source to the destination backup directory. The format of the backup file is unique to Couchbase and allows you to recover all or part of the backup data when you plan to restore the data to the cluster.
You can choose to be on a key (through regular expressions) or all the data is stored in a specific vbucket ID, or you can choose to copy the source data from a bucket to a bucket with a different name in the cluster.
Cbbackup command parameter options:
Cbbackup [options] [source] [backup_dir]
The Note: cbbackup tool is located in the Couchbase standard command line directory.
Be aware that cbbackup does not support external IP addresses. If you install a Couchbase server using the default IP address, you cannot use an external host to access it.
Next are the optional parameters for cbbackup:
The following options are used to configure user and password information, backup type, and bucket options for connecting to the cluster.
You can use one or more options. The main options include:
-single-node
Backup single node
-bucket-source or-b
Back up bucket with a specific name
Next are the required parameters for cbbackup:
Data source, local data catalog reference, or remote node / cluster specification:
Local directory referenc
The local directory specification is URL defined using the couchstore-files protocol. Take a chestnut:
Couchstore-files:///opt/couchbase/var/lib/couchbase/data/default
With this approach, you only need to back up the data for the specified bucket on a single node. If you back up all bucket data on a cluster or all data on a single node, you must use the cluster node specification. This approach is not supported in the design documents defined in bucket.
Cluster node
This node, or a node in the cluster, specifies URL as a node or cluster service.
Take a chestnut:
Http://HOST:8091// For distinction you can use the couchbase protocol prefix: couchbase://HOST:8091// The administrator and password can also be combined with both forms of the URL for authentication. If you have named data buckets (other than the default bucket) that you want to backup, specify an administrative name and password for the bucket: couchbase://Administrator:password@HOST:8091
Whether the URL provided by a combination of other options refers to the entire cluster, a single node, or a single bucket (node or cluster). The nodes and clusters can be remote or local. This method is also used to back up design documents that define views and indexes.
The cbbackup [backup_dir] parameter is the directory where the backup data is saved by executing the cbbackup command. This must be an absolutely explicit directory and the files will be stored directly in a specific directory; no additional directory structure has been created to distinguish between the different components of the backup data. The backup directory you specified should not exist or should be empty. If the directory does not exist, it will be created, but if the parent directory already exists. The backup directory is always created on the local node, even if you are backing up the remote node or a cluster. Backup files are stored in a specific directory specified locally. Backups can be run in a running cluster or on a node corresponding to ip
Using this basic structure, you can back up different combinations of data from the source cluster. Here are some examples of different data combinations:
Back up all bucket on all nodes
The data that backs up the entire cluster includes all bucket, all node data:
Cbbackup http://HOST:8091 / backups/backup-20120501\-u Administrator-p password [#] 100.0% (231726 msgs) bucket: default, msgs transferred... : total | last | per sec batch: 5298 | 5298 | 617.1 byte: 10247683 | 10247683 | 1193705.5 msg: 231726 | 231726 | 26992.7 done [#] 100.0% (11458 msgs) bucket: loggin, msgs transferred... : total | last | per sec batch: 5943 | 5943 | 15731.0 byte: 11474121 | 11474121 | 30371673.5 msg: 84 | 84 | 643701.2 done
Whether the URL provided by a combination of other options refers to the entire cluster, a single node, or a single bucket (node or cluster). The nodes and clusters can be remote or local. This method is also used to back up design documents that define views and indexes.
The cbbackup [backup_dir] parameter is the directory where the backup data is saved by executing the cbbackup command. This must be an absolutely explicit directory and the files will be stored directly in a specific directory; no additional directory structure has been created to distinguish between the different components of the backup data. The backup directory you specified should not exist or should be empty. If the directory does not exist, it will be created, but if the parent directory already exists. The backup directory is always created on the local node, even if you are backing up the remote node or a cluster. Backup files are stored in a specific directory specified locally. Backups can be run in a running cluster or on a node corresponding to ip
Using this basic structure, you can back up different combinations of data from the source cluster. Here are some examples of different data combinations:
Back up all bucket on all nodes
The data that backs up the entire cluster includes all bucket, all node data:
Cbbackup http://HOST:8091 / backups/backup-20120501\-u Administrator-p password\-b default [#] 100.0% (231726amp 231718 msgs) bucket: default, msgs transferred... : total | last | per sec batch: 5294 | 5294 | 617.0 byte: 10247683 | 10247683 | 1194346.7 msg: 231726 | 231726 | 27007.2 done
The-b option specifies the bucket you want to back up. If bucket's name is bucket, you must provide the administrator's account number and password. If you want to back up the data of the entire cluster, you must perform the same backup operation for each bucket in the cluster.
Back up all bucket of a single node
Back up all bucket data on a single node:
Cbbackup http://HOST:8091 / backups/backup-20120501\-u Administrator-p password\-- single-node
With this method, the data source must specify the name of the node you want to back up.
Using this method to back up data from a real cluster, you should back up each node in the cluster individually.
Back up a single node, a single bucket
Back up a single bucket on a single node:
Cbbackup http://HOST:8091 / backups/backup-20120501\-u Administrator-p password\-- single-node\-b default
With this method, the data source must specify the name of the node you want to back up.
Back up a single node, and a single bucket; backup file is stored on the same node
There are two ways to back up a single bucket, a single node, while the backup data is stored on the source data node.
You need to specify the node name and data backup path. Take a chestnut:
Ssh USER@HOST remote- > sudo su-couchbase remote- > cbbackup http://127.0.0.1:8091 / mnt/backup-20120501\-u Administrator-p password\-- single-node\-b default
With this method, the data source must specify the name of the node you want to back up.
Back up a single node, and a single bucket; backup file is stored on the same node
There are two ways to back up a single bucket, a single node, while the backup data is stored on the source data node.
You need to specify the node name and data backup path. Take a chestnut:
Ssh USER@HOST remote- > sudo su-couchbase remote- > cbbackup couchstore-files:///opt/couchbase/var/lib/couchbase/data/default / mnt/backup-20120501
Using this method to back up the entire cluster data, you need to back up the data of each node in the cluster and each bucket.
Note: choosing the appropriate backup solution depends on your requirements, and you expect the data to be restored to the cluster method.
Filter Keys during backup
Cbbackup supports filtering keys backups. This will be a useful feature if you want to back up some of the data or if you want to move some of the data to a different bucket.
This format is in the form of regular expressions and is carried out on the client side of the cbbackup tool. For example, from a bucket, the key has a backup of information about the prefix object:
Cbbackup http://HOST:8091 / backups/backup-20120501\-u Administrator-p password\-b default\-k'^ object.*'
The backup above simply stores the data to which the regular matches are stored in the backup file. When the data is backed up, only the key restore is recorded in the backup file.
Important tips:
Regular expression matching is performed on the client side. This means that the content cbbackup of the real bucket must be accessible, and the data will be discarded if it does not match.
Regular expressions based on key can also be used when recovering data. You can back up the real bucket and select the keys you want to restore when you use cbrestore to restore.
Make a backup by copying a file
You can also back up data by using cbbackup and specifying that the data is stored in the local directory
Or directly copy data files such as cp, tar ….
For instance
Use cbbackup:
Cbbackup\ couchstore-files:///opt/couchbase/var/lib/couchbase/data/default\ / mnt/backup-20120501 uses the cp command to achieve the same backup effect:
Cp-R / opt/couchbase/var/lib/couchbase/data/default\ / mnt/copy-20120501
There are restrictions on backing up books in this way. In the same cluster configuration, data can only be restored to offline nodes, so make the same vBucket map work.
You should also copy CONFIG.DAT configuration files from each node.
Parent topic: Backup and restore
Source text: backup-cbbackup
License: Attribution-NonCommercial-ShareAlike 4.0 International
This article is from Suzf Blog. If not indicated, they are all original by SUZF.NET.
For reprint, please indicate: http://suzf.net/thread-0823-1051.html
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.