可以使用高版本couchbase-cli来备份低版本的couchbase吗?

时间:2016-02-28 03:50:45

标签: backup couchbase

我尝试使用couchbase v4.0.0的cbbackup和cbtransfer cli来备份couchbase v3.0.1。这两个命令都失败了。下面是cbbackup命令的输出。我想知道为什么高版本的cli不适用于低版本的沙发基础?它们是向前兼容的吗?

[cb-v4.0.0]$ /opt/couchbase/bin/cbbackup http://<cb-v3.0.1>:8091  /tmp/cbbackup -u 'xxxx' -p '***' -v
2016-02-28 03:05:28,679: mt cbbackup...
2016-02-28 03:05:28,679: mt  source : http://<cb-v3.0.1>:8091
2016-02-28 03:05:28,679: mt  sink   : /tmp/cbbackup
2016-02-28 03:05:28,679: mt  opts   : {'username': '<xxx>', 'verbose': 1, 'dry_run': False, 'extra': {'max_retry': 10.0, 'rehash': 0.0, 'dcp_consumer_queue_length': 1000.0, 'data_only': 0.0, 'uncompress': 0.0, 'nmv_retry': 1.0, 'cbb_max_mb': 100000.0, 'report': 5.0, 'mcd_compatible': 1.0, 'try_xwm': 1.0, 'backoff_cap': 10.0, 'batch_max_bytes': 400000.0, 'report_full': 2000.0, 'flow_control': 1.0, 'batch_max_size': 1000.0, 'seqno': 0.0, 'design_doc_only': 0.0, 'recv_min_bytes': 4096.0}, 'single_node': False, 'ssl': False, 'vbucket_list': None, 'threads': 4, 'mode': 'full', 'key': None, 'password': '<xxx>', 'id': None, 'silent': False, 'bucket_source': None}
2016-02-28 03:05:28,713: mt bucket: productbucket
2016-02-28 03:05:44,590: w0   source : http://<cb-v3.0.1>:8091(productbucket@172.31.2.154:8091)
2016-02-28 03:05:44,590: w0   sink   : /tmp/cbbackup(productbucket@172.31.2.154:8091)
2016-02-28 03:05:44,590: w0          :                total |       last |    per sec
2016-02-28 03:05:44,590: w0    batch :                  171 |        171 |       10.8
2016-02-28 03:05:44,590: w0    byte  :             69447174 |   69447174 |  4374738.4
2016-02-28 03:05:44,590: w0    msg   :                28346 |      28346 |     1785.6
  [####################] 100.0% (28346/estimated 28346 msgs)
bucket: productbucket, msgs transferred...
       :                total |       last |    per sec
 batch :                  171 |        171 |       10.7
 byte  :             69447174 |   69447174 |  4331609.4
 msg   :                28346 |      28346 |     1768.0
Traceback (most recent call last):
  File "/opt/couchbase/lib/python/cbbackup", line 12, in <module>
    pump_transfer.exit_handler(pump_transfer.Backup().main(sys.argv))
  File "/opt/couchbase/lib/python/pump_transfer.py", line 94, in main
    rv = pumpStation.run()
  File "/opt/couchbase/lib/python/pump.py", line 140, in run
    self.transfer_bucket_index(source_bucket, source_map, sink_map)
  File "/opt/couchbase/lib/python/pump.py", line 267, in transfer_bucket_index
    source_bucket, source_map)
  File "/opt/couchbase/lib/python/pump_dcp.py", line 92, in provide_index
    err, index_server = pump.filter_server(opts, source_spec, 'index')
  File "/opt/couchbase/lib/python/pump.py", line 1057, in filter_server
    if filtor in node["services"] and node["status"] == "healthy":
KeyError: 'services'

2 个答案:

答案 0 :(得分:1)

遗憾的是,目前尚不支持。我们目前正在为目标发布集支持所有Couchbase工具。

一种解决方法是使用3.0.1群集中的XDCR将数据移动到4.0群集。

答案 1 :(得分:0)

除了上述已接受的解决方案,您可以使用cbtransfer工具从3.x服务器存储桶备份数据,然后使用备份数据填充4.x服务器存储区

public partial class FormattingOverlay : UserControl
{

    public FormattingOverlay(Form1 mainForm)
    {
        this.mainForm = mainForm;
        InitializeComponent();
    }

    private void btnBold_Click(object sender, EventArgs e)
    {
        RichTextBox rTxtBx = mainForm.rTxtBxSelectionTester;
        rTxtBx.SelectionFont = new Font(rTxtBx.Font, FontStyle.Bold);
        rTxtBx.SelectionStart = rTxtBx.SelectionStart + rTxtBx.SelectionLength;
        rTxtBx.SelectionLength = 0;
        rTxtBx.SelectionFont = rTxtBx.Font;
    }
}

切换服务器的原因是为cbtransfer使用正确的bin可执行文件。