Nosql 复制数据库时出错
当通过_changesfeed将coach db从远程系统回复到本地系统时,我得到了这个错误Nosql 复制数据库时出错,nosql,couchdb,Nosql,Couchdb,当通过_changesfeed将coach db从远程系统回复到本地系统时,我得到了这个错误 `05-04 19:19:48.089: ERROR/CouchDB(984): [error] [<0.115.0>] Error in replication `a4b53e74a33b773bbca688073b6bbe0d+continuous` (triggered by document `cloud2airline`): {worker_died,<0.532.0>
`05-04 19:19:48.089: ERROR/CouchDB(984): [error] [<0.115.0>] Error in replication `a4b53e74a33b773bbca688073b6bbe0d+continuous` (triggered by document `cloud2airline`): {worker_died,<0.532.0>,
{process_died,<0.547.0>,
{function_clause,
[{string,tokens1,[undefined,";",[]]},
{mochiweb_util,parse_header,1},
{couch_httpd,get_boundary,1},
{couch_httpd,parse_multipart_request,3},
{couch_api_wrap,'-open_doc_revs/6-fun-1-',4},
{couch_api_wrap_httpc,process_stream_response,5},
{couch_api_wrap,'-open_doc_revs/6-fun-2-',4}]}}}
Restarting replication in 5 seconds.`
正在复制的是有效的JSON吗?看起来有一个错误“未定义”;“”这就是问题的原因?只有在通过http工作的Coach db实例之间引入节点js代理时,才会发生这种情况。我已经更新了nodejs代码。当相同的代码部署在heroku上并通过ssl工作时,它就可以正常工作。仅当其在本地部署时,复制才会失败
`'use strict';
/*!
* Middleware for forwarding a request to CouchDB.
*/
/**
* Module dependencies.
*/
var httpProxy = require('http-proxy'),
util = require('./util');
module.exports = function(couch) {
var proxy = new httpProxy.HttpProxy(couch),
couchTarget = couch.target;
httpProxy.setMaxSockets(200);
return function(req, res, next) {
req.headers['host'] = couchTarget.host + ':' + couchTarget.port;
req.headers['authorization'] = couch.credentials;
req.headers['x-forwarded-ssl'] = util.isSecureForwardedRequest(req);
var forwardedFor = req.headers['x-forwarded-for'];
req.headers['x-real-ip'] = forwardedFor
? forwardedFor.split(',',1)[0]
: req.connection.remoteAddress;
req.url = couch.path + req.url;
console.log(req.headers['x-forwarded-for']);
console.log(req.headers['x-real-ip']);
console.log(req.headers['x-forwarded-ssl'] );
console.log(couchTarget.host + ":" + couchTarget.port + req.url);
return proxy.proxyRequest(req, res);
}
}`