【问题标题】:CouchbaseError: Client-Side timeout exceeded for operationCouchbaseError:操作超时客户端超时
【发布时间】:2015-03-31 22:48:29
【问题描述】:

我正在使用 NodeJS SDK 运行 couchbase server 3.0.1。我已经设置了一个带有两个存储桶的服务器,并且没有文档。我通过以下方式打开了一个连接:

var dbCluster = new couchbase.Cluster([my_host]); var db = dbCluster.openBucket( [my_bucket_name]);

当我尝试执行“db.upsert”时,出现以下错误:

Error: CouchbaseError: Client-Side timeout exceeded for operation. Inspect network conditions or increase the timeout

现在最奇怪的部分是文档仍然被添加。所以命令执行成功,但仍然返回错误。调用的执行速度也非常快,绝对不需要 2.5 秒(默认操作超时)。

在此之后:Couchbase times out after few seconds 我尝试通过以下方式增加超时:

db.operationTimeout = 5000;

这不起作用。再次调用成功,但是即使指定的超时时间没有过去,也返回超时错误(调用非常快,比 5 秒快得多)。

我能找到的唯一其他支持是在这个 Google Groups 中,但它似乎已经死了:https://groups.google.com/forum/#!topic/couchbase/scrTb94Mj3w

我正在运行 OSX Yosemite 10.10.2。任何帮助都将不胜感激,因为我不知道下一步该去哪里。

谢谢,

下面是代码供参考:

var couchbase = require('couchbase');

var dbCluster = new couchbase.Cluster("mylocalhostname");
var db = dbCluster.openBucket( "mybucketname", function(err){
    // no errors here
    if(err){
        console.log("Can't open bucket");
        throw err;
    }
    else {
        console.log("Successfully opened bucket");
    }
});

db.operationTimeout = 5000;

db.upsert("docname", someJSON, function(err, result){

    if(err){
        // get an error here, even though the call successfully executes
        return console.log("Error: " + err);
    }
});

【问题讨论】:

标签: node.js timeout couchbase


【解决方案1】:

我对 AWS 上的 CouchBase 也有同样的问题。我通过向任何人开放以下端口来解决它:

22 tcp 0.0.0.0/0 4369 tcp 0.0.0.0/0 4984 tcp 0.0.0.0/0 8080 tcp 0.0.0.0/0 8088 tcp 0.0.0.0/0 8091 tcp 0.0.0.0/0 8092 tcp 0.0.0.0/0 11209 tcp 0.0.0.0/0 11210 tcp 0.0.0.0/0 11211 tcp 0.0.0.0/0 11214 tcp 0.0.0.0/0 11215 tcp 0.0.0.0/0 18091 tcp 0.0.0.0/0 18092 tcp 0.0.0.0/0

欲了解更多信息,请参阅:http://docs.couchbase.com/couchbase-manual-2.5/cb-install/#network-ports

【讨论】:

    【解决方案2】:

    原来问题出在集群连接上。根据文档,我将我的连接指定为:

    "couchbase://my.domain.com", where "my.domain.com" pointed to 127.0.0.7.
    

    删除“couchbase://”解决了我的问题。所以通过以下方式连接:

    "my.domain.com"
    

    解决了这个问题。有趣的是,通过以下方式连接:

    "couchbase://127.0.0.7"
    

    也有效。不知道它们是如何相关的,以及它如何仍然能够更新文档,但这为我解决了。暂时不会将其标记为已接受,以防有人提出更令人满意的答案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-05
      • 2012-03-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-12
      相关资源
      最近更新 更多