gpt4 book ai didi

spring-boot - 抽象Couchbase配置

转载 作者:行者123 更新时间:2023-12-02 17:48:07 25 4
gpt4 key购买 nike

我正在尝试使用 Spring data 2.2.8 版本连接到安装在 Linux 服务器上的 couchbase。我们的沙发床db 是企业版 5.0.0 版本 2873。

有集群用户 ID 和密码,我无法从 AbstractCouchbaseConfiguration 方法传递并收到 401 错误(协议(protocol) HTTP 的未知响应状态:401)。

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

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

你能帮我理解我对 Spring 数据做错了什么吗?

最佳答案

只需创建一个与存储桶同名的用户并在那里设置密码,如 I also answered in this other post .

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

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

关于spring-boot - 抽象Couchbase配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46955161/

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