From our previous discussions I summarize that you can send requests to 8091 but not to the n1ql query node. You seemed to have all the 3 services enabled.
I have a couple of questions :
What version of Couchbase are you using
Can you see a query tab on the UI. If so that is the query workbench. Could you please try to query using that and see if it works for you. Run the following query there
select * from system:keyspaces;
If this works then query is working. You need to always issue queries against the query service. Hence run the following curl command :
Try the following curl command (after replacing my host to your hostname or ip):
curl -v http://myhost:8093/query/service -d ‘statement=select 1’
Could you post both the outputs here. We can go forward from there.
CBQ location for different os (On the machine that runs couchbase) :
For Centos /opt/couchbase/bin
For Windows mostly Program Files\Couchbase\Server\bin
For Mac /Applications/Couchbase\ Server.app/Contents/Resources/couchbase-core/bin/
cd into that dir and run cbq by executing
./cbq
See if you can execute a query here.
Sample query : select * from system:keyspaces;
So it looks like you can connect to the query service. Cbq is a command line tool that allows you to run N1QL queries. Since you are running on docker, there can be a couple of issues when connecting from outside (not your docker instance, which as we see works, from running cbq above)
you havent exposed the ports when bringing up the docker instance
If you access it from another machine, you need an ip rewrite rule.
@arungupta will be able to help with the docker connection issue.
@arungupta Perfect now its working. i was used out dated coucbase/server now 8092 and 8093 ports are available. Thanks for your glad help @arungupta, @isha and @geraldss
@arungupta I have another instance running in other server. Now it is live. Again 8093 port is not working. i was follwed out dated tutorial to run docker. So is there any way to turn on 8093 port on existing instace, without any data lose and issues.
I think that this is really a docker question, not a couchbase question, so you may want to ask on StackOverflow or the Docker forums. But I’ll take a shot at it:
If you followed the outdated instructions, then it’s likely you did something like this:
docker run -d -p 8091:8091 couchbase/server
Which means that only port 8091 is exposed from the docker host. I’m assuming that you’re trying to execute queries on port 8093 from outside of the docker host. So, what you need to do is open up port 8093.
I would suggest that you make a backup of the data before you do anything, just in case something goes wrong. Make sure to follow the up to date instructions to expose the correct ports (see https://hub.docker.com/_/couchbase/ for instance):
docker run -d --name db -p 8091-8094:8091-8094 -p 11210:11210 couchbase