couchbasecouchbase-java-api

Couchbase client trying to connect to localhost while configured to remote server


I am trying to run a simple code, which opens a bucket on remote Couchbase 5.1 server using Java SDK 2.6.2 and inserts a document.

        Cluster cluster = CouchbaseCluster.create("192.168.111.10");

    cluster.authenticate("user", "password");

    Bucket bucket = cluster.openBucket("alex-tests");

    System.out.println("Opened bucket " + bucket);

    JsonDocument jsonDocument = JsonDocument.create("123", JsonObject.create()
            .put("id", "123")
            .put("first_name", "alex")
            .put("city", "amsterdam"));
    bucket.insert(jsonDocument);

    System.out.println("Inserted");

It looks like the bucket is opened, but then the client is printing connection errors to a localhost while it was configured to a remote machine.

The log is available here


Solution

  • As @dnault mentioned the 0.0.0.0 was configured as a server in the config of the remote cluster.