CustomPouchError
问题描述:
我想我的本地数据库同步到远程一个这样的:CustomPouchError
const DB_NAME = "my_db";
const REMOTE_DB_URL ="http://<admin>:<password>/<ip-address>:5984/my_db";
const localDB = new PouchDB(DB_NAME);
const remoteDB = new PouchDB(REMOTE_DB_URL);
localDB.sync(remoteDB)
.then(() => {
console.log("Sync done");
})
.catch(err => {
console.log(err);
});
这是错误,我得到:
message:"getCheckpoint rejected with "
name:"unknown"
result:{ok: false, start_time: Mon Dec 18 2017 14:14:03 GMT+0100 (CET), docs_read: 0, docs_written: 0, doc_write_failures: 0, ...}
status: 0
本地数据库工作正常,但是当试图复制/同步到远程,总能得到上述
错误我使用
- 阵营本地0.50.0
- pouchdb反应的母语:6.3.4
- 远程DB是CouchDB的2.1.1
答
要同步的CouchDB数据库请按照下列步骤操作:
第1步: 通过HTTPS提供远程数据库,而不是http使用CouchDB的原生支持SSL,如下所示: http://docs.couchdb.org/en/1.3.0/ssl.html
第2步: 确保启用了CORS,如下所示:http://docs.couchdb.org/en/1.3.0/cors.html
Remote是CouchDB的2.1.1 – pavle
没有CouchDB的已经从源代码构建?你有代理或防火墙,可能会导致任何问题? –
@AlexisCôté是的,我有防火墙。这是Azure Ubuntu VM,但我添加了:5984端口到防火墙。而且我还在配置中添加了* bind_address = 0.0.0.0 *。 – pavle