gpt4 book ai didi

node.js - 如何在 couchbase 日志中查找传入请求的 IP 地址? (非 REST API - 非 Web 控制台请求)

转载 作者:太空宇宙 更新时间:2023-11-04 00:10:17 26 4
gpt4 key购买 nike

我已查看以下链接中给出的所有日志,但未能找到 IP 地址:

https://developer.couchbase.com/documentation/server/3.x/admin/Misc/Trbl-logs.html

我通过代码访问 Couchbase 存储桶,而不是通过 REST API 或 Web 控制台。这是我的一段代码:

var couchbase = require("couchbase");

var userCouchbaseIp = subscriptionConf.CouchbaseIp;

var couchbaseBucketName = subscriptionConf.couchbaseBucketName;

var cluster = new couchbase.Cluster(userCouchbaseIp);

var Bucket = cluster.openBucket(couchbaseBucketName);

var Key = "abcd";

Bucket.get(Key, function(errGetKey, resGetKey) {

console.log("trial console");
if (errGetKey) {
console.log("errGetKey: ", errGetKey);
} else {
console.log("resGetKey: ", resGetKey);
}
});

最佳答案

官方 SDK 在与数据服务通信时使用 HELO 命令来标识自己。这会记录在数据服务日志 /opt/couchbase/var/log/memcached.log* 中。

这就是 5.5-beta 上的日志条目的样子。

2018-04-27T10:14:32.031425Z INFO 47: HELO [{"a":"libcouchbase/2.8.6 (Darwin-17.3.0; x86_64; Clang 9.0.0.9000039)","i":"00000000ae092f72/26a9bd662aca89f5"}] TCP nodelay, XATTR, XERROR, Select bucket, Snappy, JSON [ 10.111.180.1:50149 - 10.111.180.101:11210 (not authenticated) ]

它会显示正在使用的 SDK 版本 (libcouchbase/2.8.6)、连接 (10.111.180.1:50149 - 10.111.180.101:11210)以及 SDK 具有的功能(TCP nodelay、XATTR、XERROR、选择存储桶、Snappy、JSON)。

关于node.js - 如何在 couchbase 日志中查找传入请求的 IP 地址? (非 REST API - 非 Web 控制台请求),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50036770/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com