简体   繁体   English

与Couchbase群集的连接状态

[英]Connection status to Couchbase cluster

How can monitoring status connection to couchbase cluster consisting few servers? 如何监视到由几台服务器组成的Couchbase群集的状态连接? In docs to couchbase, class CouchbaseClaster doesn't have methods for checks connection status to cluster. 在Couchbase的文档中,类CouchbaseClaster没有用于检查与群集的连接状态的方法。 One of the solution it's checks to connection to bucket with CouchbaseManager.hasBucket(), but's think it's bad. 它使用CouchbaseManager.hasBucket()检查连接到存储桶的解决方案之一,但认为这很糟糕。 Maybe someone faced such a challenge? 也许有人面临这样的挑战?

PS: I apologize for possible mistakes, becouse I don't speak English well. PS:对于可能的错误,我深表歉意,因为我的英语说得不好。

I have found it unnecessary to monitor the database connection. 我发现没有必要监视数据库连接。 I instead add error handling code to recover from such scenarios. 相反,我添加了错误处理代码以从这种情况下恢复。

With the Couchbase Java SDK you can encounter a variety of exceptions. 使用Couchbase Java SDK,您会遇到各种异常。 Some indicate temporary problems while others are permanent problems. 有些表示暂时性问题,而另一些则表示永久性问题。 For temporary problems, consider using a retry mechanism . 对于临时性问题,请考虑使用重试机制 For permanent problems , log the error and trigger a notification through a monitoring application. 对于永久性问题 ,请记录错误并通过监视应用程序触发通知。

The Couchbase Java SDK will also log connectivity issues. Couchbase Java SDK也将记录连接问题。 It periodically contacts the cluster to keep its Cluster Map up to date with any cluster changes. 它会定期与集群联系,以使集群图随时随集群的变化而更新。 If it has problems doing that, it will log a message. 如果这样做有问题,它将记录一条消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM