抽象沙发底座配置

AbstractCouchbaseConfiguration

我正在尝试使用 Spring 数据 2.2.8 版本连接到安装在 linux 服务器上的 couchbase。我们的沙发床 db 是 Enterprise Edition 5.0.0 build 2873.

存在我无法从 AbstractCouchbaseConfiguration 方法传递的集群用户 ID 和密码,并收到 401 错误(Unknown ResponseStatus with Protocol HTTP: 401)。

但是当我用下面的代码尝试 java sdk 时,我能够成功连接。

Cluster cluster = CouchbaseCluster.create(“servername”);
cluster.authenticate(“userid”, “password”);
Bucket bucket = cluster.openBucket(“bucket”);

你能帮我理解我在处理 Spring 数据时做错了什么吗。

只需创建一个与存储桶同名的用户并在那里设置密码,如

正如那里提到的那样,文档应该涵盖这一点,如果那里有任何令人困惑的地方,请单击 "feedback" 按钮并提供可以改进的地方!

https://developer.couchbase.com/documentation/server/5.0/security/security-authorization.html https://developer.couchbase.com/documentation/server/5.0/security/concepts-rba-for-apps.html https://developer.couchbase.com/documentation/server/5.0/security/security-resources-under-access-control.html