Why N1QL query not working on 8093 port and 8091 port?

Hi @itssrinadh,

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.

It doesn’t look like docker has a way for you to expose ports while the container is running, so you will likely have to stop the container and start it again . I am not a docker expert like @arungupta, so there may be some other way that I don’t know about. Here are some similar discussions I found: Exposing a port on a live Docker container - Stack Overflow and How to EXPOSE Port on running container - General Discussions - Docker Community Forums

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