spring-boot - 抽象Couchbase配置

标签 spring-boot spring-data couchbase

我正在尝试使用 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/

相关文章:

java - Spring 安全: Keep only one active token per client

java - 未创建表,在 Spring Boot 的多个应用程序中使用来自 maven jar 依赖项的实体

elasticsearch - 用于多个存储桶的 Couchbase/Elasticsearch 连接器

android - Couchbase 精简版 : reading document vs querying data

gps - 如何将地理空间坐标从右上角、左下角转换为左上角和右下角

java - Spring Boot 不替换 application.properties 文件中的环境变量

java - 在 JPA 中获取多对一关联时出现问题

java - Spring data cdi多个持久化单元报错

java - Spring JPA Query 返回 Null 而不是 List

java - Spring Data JPA Update @Query 没有更新?