java connnect problem
Hi All,
I am a new user who just learn couchbase recently, today when i install 2.0 in my centos5.8(1386) (VMware) ,i find the ip is already bound(0.0.0.0:8091) and this cause connect timed out in my java environment(win7,the main system) , how can i solve this problem?
regards,
kenhome
Hello,
Thanks a lot.
I can connect on the port 8091 this time,but i meet another question:
2012-12-23 21:56:32.038 INFO com.couchbase.client.CouchbaseConnection: Added {QA sa=/192.168.255.128:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2012-12-23 21:56:53.352 INFO com.couchbase.client.CouchbaseConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@9ebcd0
2012-12-23 21:56:53.353 INFO com.couchbase.client.CouchbaseConnection: Reconnecting due to failure to connect to {QA sa=192.168.255.128/192.168.255.128:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}
java.net.ConnectException: Connection timed out: no further information
What's the wrong with it?
Regards,
kenhome
This may be because you're using java 1.7. If so, please downgrade to 1.6!
Also, can you please post your complete bootstrap code so we can examine it? Thanks!
Thank daschl for solving my question, program running normal at 1.6!
However,it seems to run a little slowly on my computer.
Here is my source code:
public static void main(String[] args) {
ArrayList nodes = new ArrayList();
// Add one or more nodes of your cluster (exchange the IP with yours)
nodes.add(URI.create("http://192.168.255.128:8091/pools"));
// Try to connect to the client
CouchbaseClient client = null;
try {
client = new CouchbaseClient(nodes, "default", "");
} catch (Exception e) {
System.err.println("Error connecting to Couchbase: " + e.getMessage());
System.exit(1);
}
// Set your first document with a key of "hello" and a value of "couchbase!"
int timeout = 0; // 0 means store forever
client.set("hello", timeout, "couchbase!");
// Return the result and cast it to string
String result = (String)client.get("hello");
System.out.println(result);
// Shutdown the client
client.shutdown();
}
And this is the Result on the console:
2012-12-24 21:04:27.976 INFO com.couchbase.client.CouchbaseConnection: Added {QA sa=/192.168.255.128:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2012-12-24 21:04:49.289 INFO com.couchbase.client.CouchbaseConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@9ebcd0
2012-12-24 21:05:10.637 INFO com.couchbase.client.ViewConnection: Added 192.168.255.128 to connect queue
2012-12-24 21:05:10.641 INFO com.couchbase.client.CouchbaseClient: viewmode property isn't defined. Setting viewmode to production mode
couchbase!
2012-12-24 21:05:11.071 INFO com.couchbase.client.CouchbaseConnection: Shut down Couchbase client
2012-12-24 21:05:11.080 INFO com.couchbase.client.ViewConnection: Node 192.168.255.128 has no ops in the queue
2012-12-24 21:05:11.082 INFO com.couchbase.client.ViewNode: I/O reactor terminated for 192.168.255.128
From the logs, this looks absolutely correct. Keep in mind that connecting takes time, so do it only once if possible and reuse it! (maybe through a singleton).
What kind of performance problems do you experience?
may be i install it on the main system(win7) and the couchbase version was 1.8 two weeks ago,haha...
Like you say,connecting takes time, I don't have any problem anymore at this point.
It's so kind of you,Thanks again!
Hello,
Do you know which process is running on port 8091?
What do you see when you try to access this port? (browser, telnet, ...)
So if you cannot find or use another port of you process, you can change the port of Couchbase Server using the Command Line Interface
I invite you to look at the following documentation:
http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-admin-cmdli...
Look at the "cluster-init" command.
Regards
Tug
Tug
@tgrall