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

Can use the high version couchbase-cli to backup low version couchbase?

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

[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'

很遗憾,目前不支持它。我们目前正在为一组目标版本支持所有 Couchbase 工具。

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

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

# ssh to 3.x server
$ cbtransfer -b <bucket> http://<3.x.server.ip>:8091 bucket-backup
# copy back-up data to 4.x server from 3.x server using scp or similar tool
# ssh 4.x server
$ cbtransfer -B <bucket> http://<4.x.server.ip>:8091 bucket-backup

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