java - Couchbase on a remote linux machine -
i have installed couchbase on centos server , seek access using java sdk throws illegal state exception. can access couchbase console browser on 8091 port. there other steps must able access through java sdk? can access couchbase web console through browser.
here code have used so:
public class cacheinitialize {
public static couchbaseclient client = null; public void initialize() { final arraylist<uri> nodes = new arraylist<uri>(); // add together 1 or more nodes of cluster (exchange ip yours) nodes.add(uri.create("http://ip-address/pools")); seek { client = new couchbaseclient(nodes, "default", ""); } grab (final exception e) { system.err.println("error connecting couchbase: " + e.getmessage()); system.exit(1); } } public static void main(final string[] args) { new cacheinitialize().initialize(); final couchbaseclient client = cacheinitialize.client; // store document client.set("my-first-document", "hello couchbase!"); // retreive document , print system.out.println(client.get("my-first-document")); // shutting downwards client.shutdown(); } }
this exception get:
java.io.ioexception: connection reset peer @ sun.nio.ch.filedispatcherimpl.read0(native method) @ sun.nio.ch.socketdispatcher.read(socketdispatcher.java:39) @ sun.nio.ch.ioutil.readintonativebuffer(ioutil.java:225) @ sun.nio.ch.ioutil.read(ioutil.java:193) @ sun.nio.ch.socketchannelimpl.read(socketchannelimpl.java:375) @ net.spy.memcached.memcachedconnection.handlereads(memcachedconnection.java:772) @ net.spy.memcached.memcachedconnection.handlereadsandwrites(memcachedconnection.java:672) @ net.spy.memcached.memcachedconnection.handleio(memcachedconnection.java:635) @ net.spy.memcached.memcachedconnection.handleio(memcachedconnection.java:409) @ com.couchbase.client.couchbaseconnection.run(couchbaseconnection.java:288) java couchbase
No comments:
Post a Comment