couchbase / docker

Dockerfiles and configuration scripts for the Docker Hub Official Couchbase images
143 stars 154 forks source link

Couchbase-server official docker image starting but cant connect to it && no log errors #176

Closed k-sae closed 2 years ago

k-sae commented 2 years ago

I am having trouble running the Couchbase using docker. No errors to the console and no errors to the logs. The command I am using:

# docker run --name db -p 8091-8094:8091-8094 -p 11210:11210 couchbase:enterprise-7.0.3 

output:

Starting Couchbase Server -- Web UI available at http://<ip>:8091
and logs available in /opt/couchbase/var/lib/couchbase/logs

However, It refuses the connection whenever I connect to http://localhost:8091:

This site can’t be reached The connection was reset.
ERR_CONNECTION_RESET

Here are services statuses on the docker image:

root@07:/# service  --status-all
 [ - ]  cron
 [ ? ]  hwclock.sh
 [ - ]  procps
 [ - ]  sysstat

Here are the ports that are allocated on the docker image:

root@07:/# netstat -ltnp                  
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:4369            0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.11:35907        0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:21200         0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::4369                 :::*                    LISTEN      -    

Here are the list of processes containing couchbase on the docker image:

root@07:/# ps aux | grep -i 'couchbase'
root          41  0.0  0.0   2380   720 ?        Ss   00:29   0:00 runsv couchbase-server
couchba+      42  0.0  9.8 6678000 1613224 ?     Sl   00:29   0:01 /opt/couchbase/lib/erlang/erts-10.7.2.7/bin/beam.smp -A 16 -sbwt none -- -root /opt/couchbase/lib/erlang -progname erl -- -home /tmp -- -smp enable -kernel logger [{handler, default, undefined}] inetrc "/opt/couchbase/etc/couchbase/hosts.cfg" dist_config_file "/opt/couchbase/var/lib/couchbase/config/dist_cfg" -hidden -name babysitter_of_ns_1@cb.local -proto_dist cb -epmd_module cb_epmd -start_epmd false -ssl_dist_optfile /opt/couchbase/etc/couchbase/ssl_dist_opts -setcookie nocookie -- -kernel global_enable_tracing false -noshell -noinput -run ns_babysitter_bootstrap -- -couch_ini /opt/couchbase/etc/couchdb/default.ini /opt/couchbase/etc/couchdb/default.d/capi.ini /opt/couchbase/etc/couchdb/default.d/geocouch.ini /opt/couchbase/etc/couchdb/local.ini -ns_babysitter cookiefile "/opt/couchbase/var/lib/couchbase/couchbase-server.babysitter.cookie" -ns_babysitter nodefile "/opt/couchbase/var/lib/couchbase/couchbase-server.babysitter.node" -ns_babysitter pidfile "/opt/couchbase/var/lib/couchbase/couchbase-server.pid" -ns_server config_path "/opt/couchbase/etc/couchbase/static_config" --
couchba+      61  0.0  0.0   3932   104 ?        S    00:29   0:00 /opt/couchbase/lib/erlang/erts-10.7.2.7/bin/epmd -daemon
couchba+     177  0.0  0.0   3336  1576 ?        Ssl  00:33   0:00 /opt/couchbase/bin/gosecrets
couchba+    1167  0.7  9.7 6663016 1600420 ?     Ssl  01:07   0:00 /opt/couchbase/lib/erlang/erts-10.7.2.7/bin/beam.smp -A 16 -sbt u -P 327680 -K true -swt low -sbwt none -MMmcs 30 -e102400 -- -root /opt/couchbase/lib/erlang -progname erl -- -home /tmp -- -smp enable -setcookie nocookie -kernel logger [{handler, default, undefined}] -user user_io -run child_erlang child_start ns_bootstrap -- -smp enable -kernel logger [{handler, default, undefined}] inetrc "/opt/couchbase/etc/couchbase/hosts.cfg" dist_config_file "/opt/couchbase/var/lib/couchbase/config/dist_cfg" -proto_dist cb -epmd_module cb_epmd -start_epmd false -ssl_dist_optfile /opt/couchbase/etc/couchbase/ssl_dist_opts -kernel global_enable_tracing false -couch_ini /opt/couchbase/etc/couchdb/default.ini /opt/couchbase/etc/couchdb/default.d/capi.ini /opt/couchbase/etc/couchdb/default.d/geocouch.ini /opt/couchbase/etc/couchdb/local.ini --
root        1229  0.0  0.0   3312   720 pts/0    S+   01:09   0:00 grep --color=auto -i couchbase

I have tried to check the error logs but the file is empty

root@07:/# cat /opt/couchbase/var/lib/couchbase/logs/error.log

There are other logs files, Please let me know if I need to attach any of them.

The attempts I have tried and failed so far:

SPECS:

ceejatec commented 2 years ago

This GitHub repo really isn't the right place to seek support for running the product. I'd suggest trying on the Couchbase Forums: https://forums.couchbase.com/

My best immediate guess about your problem is that your OS is configured to block some ports (iptables?), or that some security system like AppArmor is interfering with Docker's ability to listen on those ports or for your browser to connect to them. Another thing you could try would be to access http://127.0.0.1:8091/ rather than http://localhost:8091/ - I have seen cases where the former worked and the latter didn't, although I cannot explain why. As an experiment, try running

docker run -d -p 8091:80 nginx

and see if connecting to either http://127.0.0.1:8091/ or http://localhost:8091/ works.

In case it's helpful, a couple additional thoughts on the information you provided:

  1. A Docker container isn't running systemd or SysV init, so running the service command isn't a meaningful thing to do.
  2. There's no need to have the |grep couchbase on your ps command, because inside a container, the only processes that should be running are the ones for the container itself (and, in your case, the interactive shell processes). You're filtering out a lot of processes that are part of Couchbase Server; not all of them have couchbase anywhere on the line, since "ps" is truncating the username to couchba+ as you can see.
  3. On a freshly-started Couchbase Server enterprise-7.0.3 container, I see 30 processes owned by the couchbase user, plus two owned by root (runsvdir and runsv).
  4. error.log would only have contents if there were any errors. The fact that it's empty is probably a good sign. Another thing you could check would be babysitter.log - somewhere in there (probably at the end) it should say "Booted. Waiting for shutdown request" if Server came fully online.