Open aisven opened 5 years ago
Also, it does not make a difference if I comment out the line with EMQX_NODE__COOKIE: 9beqyAQGcWQ1FvSiLnf3 in docker-compose.yml
While the container is active, docker ps is
[sludwig@mqtt mqtt-emqx]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7296e871e13e emqx/emqx "/usr/bin/docker-ent…" 6 seconds ago Up 5 seconds 4369/tcp, 5369/tcp, 6369/tcp, 11883/tcp, 18083/tcp, 0.0.0.0:51883->1883/tcp, 0.0.0.0:58080->8080/tcp, 0.0.0.0:58083->8083/tcp, 0.0.0.0:58084->8084/tcp, 0.0.0.0:58883->8883/tcp mqtt-emqx-vod-dev-c
I came one step further in this analysis. If I revert to using network_mode: host
in docker-compose.yml the broker starts up and does not exit after about 30 seconds. (Note that reverting back to using Docker Volumes without mapping to the Docker Host local file system did not make a difference.)
version: '3'
services:
mqtt-emqx-vod-dev-s:
image: emqx/emqx
container_name: mqtt-emqx-vod-dev-c
environment:
EMQX_LOADED_PLUGINS: "emqx_management,emqx_auth_username,emqx_recon,emqx_retainer,emqx_dashboard"
EMQX_NAME: emqxvoddev1
EMQX_HOST: 10.0.3.5
# EMQX_NODE__COOKIE: 9beqyAQGcWQ1FvSiLnf3
EMQX_LOG__CONSOLE: console
EMQX_ALLOW_ANONYMOUS: 'false'
# EMQX_LISTENER__TCP__EXTERNAL: 51883
# EMQX_LISTENER__SSL__EXTERNAL: 58883
# EMQX_LISTENER__WS__EXTERNAL: 58083
# EMQX_LISTENER__WSS__EXTERNAL: 58084
# EMQX_LISTENER__API__MGMT: 58080
# logging:
# driver: gelf
# options:
# gelf-address: udp://10.0.5.4:12201
# tag: mqtt-emqx-vod-dev
network_mode: host
# ports:
# - "51883:1883"
# - "58883:8883"
# - "58083:8083"
# - "58084:8084"
# - "58080:8080"
volumes:
- mqtt-emqx-vod-dev-lib-v:/opt/emqx/lib
- mqtt-emqx-vod-dev-etc-v:/opt/emqx/etc
- mqtt-emqx-vod-dev-log-v:/opt/emqx/log
- mqtt-emqx-vod-dev-data-v:/opt/emqx/data
# - ./local/volumes/log:/opt/emqx/log
# - ./local/volumes/data:/opt/emqx/data
- ./local/users/add_users.sh:/bin/add_users.sh
volumes:
mqtt-emqx-vod-dev-lib-v:
mqtt-emqx-vod-dev-etc-v:
mqtt-emqx-vod-dev-log-v:
mqtt-emqx-vod-dev-data-v:
Specify image as emqx/emqx:v3.2.0
and remove EMQX_HOST
to start normal
@sourcekick Just exactly same as I've met. I can normally run the emqx image without enviroment confiuration EMQX_NODE__NAME(or any configuration), but with this, the container died silently, and the logs are same with what you displayed
@PotatoGuo Can you share your environment configuration?
@zhanghongtong I just added -e EMQX_NODE__NAME="emqx@192.168.0.234"
@PotatoGuo The IP address in the EMQX_NODE__NAME
needs to be consistent with the IP address of the container, or else an exception error will result
@zhanghongtong Yes, it worked, Thanks!
@PotatoGuo You're welcome :)
Expected behavior
emqx starts up and accepts connections. The container does not exit.
Actual behavior
The process exits after about 30 seconds without any log output that would indicate the error.
logs:
The first log is the console output. To see that I made a run with the logging gelf configuration in docker-compose.yml commented out.
^ here at the end you see that an Eshell promt is open somehow and then after some seconds the process exists
Test code
my docker-compose.yml
All these files and directories on the Docker Host belong to root:docker and all of them are also readable and traversable by others. The stuff under local is also writeable by others.
EMQ version
Which branch are you on? If you know the Git revision then add it here as well.
emqx/emqx latest
Docker version
Docker version 18.09.7, build 2d0083d
How docker info?
System
CentOS 7
Hardware
standard modern Azrue VM