-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opening ipv4 listen socket on port 1883 Error: Address already in use #3181
Comments
General advice: It would be more helpful to provide the full details of how you are actually running mosquitto, e.g. what docker run command are you using to start it? Given that this is an open source project, providing as much information as possible would help you get better and quicker answers to your project. TLDR; This is expected since you're accidentally starting a second mosquitto process inside the container by running More detailed answer $ docker run -it -p 1883:1883 eclipse-mosquitto After a container starts, that will start the mosquitto process. If you then open a new shell inside the container using |
services:
mosquitto:
image: eclipse-mosquitto
tty: true
container_name: mosquitto
ports:
- '13003:1883'
- '13004:9001'
volumes:
- './config/mosquitto.conf:/mosquitto/config/mosquitto.conf'
- './data:/mosquitto/data'
- './log:/mosquitto/log' Unable to connect through port 13003. |
@zjt003 You need to provide your But guessing, you're missing the following line to create a listener on port 1883 (inside the container): listener 1883 0.0.0.0 Then afterwards, you can use normal docker port mapping to map the internal container port 1883 to the outside world port, |
You can see all of the mosquitto configuration file documentation here: https://mosquitto.org/man/mosquitto-conf-5.html |
After adding the configuration, you can connect, thank you |
docker exec -it be5004c7c0cb sh
/ #
mosquitto -v
1733404635: mosquitto version 2.0.20 starting
1733404635: Using default config.
1733404635: Starting in local only mode. Connections will only be possible from clients running on this machine.
1733404635: Create a configuration file which defines a listener to allow remote access.
1733404635: For more details see https://mosquitto.org/documentation/authentication-methods/
1733404635: Opening ipv4 listen socket on port 1883.
1733404635: Error: Address in use
1733404635: Opening ipv6 listen socket on port 1883.
1733404635: Error: Address in use
docker logs be5004c7c0cb
1733404263: mosquitto version 2.0.20 starting
1733404263: Config loaded from /mosquitto/config/mosquitto.conf.
1733404263: Starting in local only mode. Connections will only be possible from clients running on this machine.
1733404263: Create a configuration file which defines a listener to allow remote access.
1733404263: For more details see https://mosquitto.org/documentation/authentication-methods/
1733404263: Opening ipv4 listen socket on port 1883.
1733404263: Opening ipv6 listen socket on port 1883.
1733404263: mosquitto version 2.0.20 running
The text was updated successfully, but these errors were encountered: