couchbase - 无法使用 cbrestore 恢复 couchbase 存储桶

标签 couchbase database-restore

我正在使用 Couchbase Server 版本 4.5.0 并尝试将保存的备份版本恢复到我的本地 CB 服务器上。我正在使用 macOS Sierra Xcode 开发工具是最新的 Python v2.7.10

我首先使用此命令创建了备份

sudo ./cbbackup HOST:PORT ~/Documents/ -u ‘username’ -p ‘password‘ -b BUCKET_NAME

此后,我尝试使用此命令将此备份恢复到本地 Couchbase 服务器

  sudo ./cbrestore /path/to/backup/2017-01-24T121528Z/2017-01-24T121528Z-full/ http://localhost:8091 -u ‘USERNAME’ -p ‘PASSWORD’ --bucket-source=SOURCE_BUCKET_NAME --bucket-destination=DESTINATION_BUCKET_NAME

但我收到以下错误。

Exception in thread s0:
Traceback (most recent call last):

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)

File "/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/lib/python/pump_mc.py", line 91, in run
rv, batch, need_backoff = self.scatter_gather(mconns, batch)

File "/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/lib/python/pump_cb.py", line 72, in scatter_gather
rv, conn = self.find_conn(mconns, vbucket_id, msgs)

File "/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/lib/python/pump_cb.py", line 316, in find_conn
host_port = serverList[vBucketMap[vbucket_id][0]]

IndexError: list index out of range

最佳答案

如果您在非 osx 版本的 Couchbase 上进行了备份,并且要恢复到 osx 版本,那么您需要对 cbrestore 使用“-x rehash=1”。原因是 Couchbase 的 osx 版本仅用于开发,并且 vbuckets 少于标准(非 osx)Couchbase 版本。 rehash 标志告诉 cbrestore 处理不同数量的 vbuckets。

关于couchbase - 无法使用 cbrestore 恢复 couchbase 存储桶,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42061335/

相关文章:

go - 运行 Hello Couchbase 应用程序时出现紧急运行时错误

powerbi - 如何解决 12008 - 在 couchbase 中执行批量获取操作时出错

database - Postgresql - 备份数据库并在不同所有者上恢复?

sql - 在恢复之前显式创建数据库?

mysql - 需要在 MYSQL V5.1.11 中将 sql 转储存储在其他架构中

go - 在 Couchbase 中插入只读文档

elasticsearch - Couchbase Elasticsearch插件在推送之前转换数据

.net - 删除 couchbase 存储桶中的所有文档

PostgreSQL 转储/恢复

mysql - 使用 .gz 格式的 Unicode 字符(阿拉伯语和库尔德语)恢复 MySQL 数据库