2017-08-10 61 views
1

我在远程的couchbase bucket'SAMPLE'内创建了json文档'test'。 网址为couchbase是http://testcouch.employee.com:8091/index.html - IP是沙发124.10.0.2couchbase java身份验证失败问题

用户名:helloUser

密码沙发:helloUser ++

Connection.java 

static CouchbaseEnvironment couchbaseEnvironment = DefaultCouchbaseEnvironment.builder() 
     .queryTimeout(10000) 
     .build(); 

    static Cluster cluster = CouchbaseCluster.create(couchbaseEnvironment,"http://testcouch.employee.com"); 

    static Bucket bucket = cluster.openBucket("SAMPLE","helloUser++"); 

尝试连接时收到以下错误:

WARNING: [null][KeyValueEndpoint]: Could not connect to endpoint, retrying with delay 32 MILLISECONDS: com.couchbase.client.core.endpoint.kv.AuthenticationException: Authentication Failure at com.couchbase.client.core.endpoint.kv.KeyValueAuthHandler.checkIsAuthed(KeyValueAuthHandler.java:288) at com.couchbase.client.core.endpoint.kv.KeyValueAuthHandler.channelRead0(KeyValueAuthHandler.java:173)

回答

0

给予的密码电话是您在创建存储桶时指定的电话。

看起来您使用的是Couchbase Web控制台密码。

如果您不记得创建存储桶密码,请尝试从通话中删除密码。

1

我得到了同样的错误。从UI创建存储桶时,无法在存储桶级别定义“密码”(v社区5.0.0)。

取而代之,我创建了一个用户并给他目标桶上的管理员权限。在菜单中选择安全,然后在上面右击群集对象上不openBucket

Cluster cluster = CouchbaseCluster.create(couchbaseEnvironment,"http://testcouch.employee.com"); 
couchBaseCluster.authenticate("helloUser", "helloUser++"); 
Bucket bucket = cluster.openBucket("SAMPLE",""); 
“添加用户”

指定的密码