failed on starting emqx in docker container
kk71 opened this issue · comments
Environment
- OS: Linux localhost.localdomain 3.10.0-1127.13.1.el7.x86_64 #1 SMP Tue Jun 23 15:46:38 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
- Erlang/OTP:
- EMQ: 4.2.2(using docker image emqx/emqx:4.2.2)
Description
I started an emqx container using docker-compose, with compose file:
version: '3.8'
services:
emqx:
image: emqx/emqx:4.2.2
privileged: true
volumes:
- type: bind
source: ./emqx.conf
target: /opt/emqx/etc/emqx.conf
- type: bind
source: ./emqx_auth_redis.conf
target: /opt/emqx/etc/plugins/emqx_auth_redis.conf
- type: bind
source: ./certs
target: /certs
restart: always
container_name: probe-emqx
network_mode: host
environment:
- WAIT_FOR_ERLANG=30
and the container crashed finally, with ouput as following:
node.max_ports=1048576
listener.tcp.external.acceptors=64
listener.ssl.external.acceptors=32
node.process_limit=2097152
node.max_ets_tables=2097152
listener.ws.external.acceptors=16
EMQ X Broker 4.2.2 failed to start within 30 seconds,
see the output of '/opt/emqx/bin/emqx console' for more information.
If you want to wait longer, set the environment variable
WAIT_FOR_ERLANG to the number of seconds to wait.
=====
===== LOGGING STARTED Tue Nov 10 08:43:53 UTC 2020
=====
Exec: /opt/emqx/erts-10.7.2.1/bin/erlexec -boot /opt/emqx/releases/4.2.2/emqx -mode embedded -boot_var ERTS_LIB_DIR /opt/emqx/erts-10.7.2.1/../lib -mnesia dir "/opt/emqx/data/mnesia/localhost.localdomain@127.0.0.1" -config /opt/emqx/data/configs/app.2020.11.10.08.43.53.config -args_file /opt/emqx/data/configs/vm.2020.11.10.08.43.53.args -vm_args /opt/emqx/data/configs/vm.2020.11.10.08.43.53.args -start_epmd false -epmd_module ekka_epmd -proto_dist ekka -- console
Root: /opt/emqx
/opt/emqx
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{ker
Crash dump is being written to: log/crash.dump...done
['2020-11-10T08:44:43Z']:emqx exit abnormally
but the same compose file and the mounted files(emqx.conf and emqx_auth_redis.conf and certs) on my mac works fine(with docker desktop). Are there anything misconfigured please?
Hi @kk71 It seems that your node name localhost.localdomain
is illegal. The .
is not allowed in the name.
You can try to specific a Node name with EMQX_NODE__NAME
environment
Hi @kk71 It seems that your node name
localhost.localdomain
is illegal. The.
is not allowed in the name.You can try to specific a Node name with
EMQX_NODE__NAME
environment
Finally I found out that the problem is caused by the network mode. I used 'host' to startup the container and it turns out failed but, when I use bridge mode, it's OK(and I haven't see any logs about port occupation etc.)