Connecting hivemq instance from google cloud VM

Hello all, we are unable to connect hivemq instance from one of our dedicated VM (Ubuntu) on google cloud.

Followed steps from Install HiveMQ from a Download Package Getting Started with HiveMQ :: HiveMQ Documentation.

Running the .sh file produces below result:


              _    _  _              __  __   ____
             | |  | |(_)            |  \/  | / __ \ 
             | |__| | _ __   __ ___ | \  / || |  | |
             |  __  || |\ \ / // _ \| |\/| || |  | |
             | |  | || | \ V /|  __/| |  | || |__| |
             |_|  |_||_|  \_/  \___||_|  |_| \___\_\

HiveMQ Start Script for Linux/Unix v1.13


HIVEMQ_HOME: /var/www/html/hivemq-4.15.0

JAVA_OPTS: -Djava.net.preferIPv4Stack=true -noverify --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED --add-exports java.base/jdk.internal.misc=ALL-UNNAMED -Djava.security.egd=file:/dev/./urandom -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Duser.language=en -Duser.region=US -XX:+CrashOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError

JAVA_VERSION: 11


2023-05-19 14:00:28,810 INFO - Starting HiveMQ Enterprise Server
2023-05-19 14:00:28,822 INFO - HiveMQ version: 4.15.0
2023-05-19 14:00:28,822 INFO - HiveMQ home directory: /var/www/html/hivemq-4.15.0
2023-05-19 14:00:28,825 INFO - Log Configuration was overridden by /var/www/html/hivemq-4.15.0/conf/logback.xml
2023-05-19 14:00:29,550 INFO - Successfully loaded configuration from ‘/var/www/html/hivemq-4.15.0/conf/config.xml’.
2023-05-19 14:00:29,690 INFO - This node’s ID is IuRRL
2023-05-19 14:00:29,690 INFO - Clustering is disabled
2023-05-19 14:00:34,448 INFO - No valid license file found. Using trial license, restricted to 25 connections.
2023-05-19 14:00:35,202 INFO - This node uses ‘2’ CPU cores.
2023-05-19 14:00:35,208 INFO - Starting HiveMQ extension system.
2023-05-19 14:00:35,265 INFO - Starting extension with id “hivemq-allow-all-extension” at /var/www/html/hivemq-4.15.0/extensions/hivemq-allow-all-extension
2023-05-19 14:00:35,275 WARN -
################################################################################################################

This HiveMQ deployment is not secure! You are lacking Authentication and Authorization.

Right now any MQTT client can connect to the broker with a full set of permissions.

For production usage, add an appropriate security extension and remove the hivemq-allow-all extension.

You can download security extensions from the HiveMQ Marketplace (HiveMQ Extensions Marketplace: Integrate HiveMQ into your business).

################################################################################################################
2023-05-19 14:00:35,276 INFO - Extension “Allow All Extension” version 1.0.0 started successfully.
2023-05-19 14:00:37,475 INFO - IuRRL: no members discovered after 2001 ms: creating cluster as first member
2023-05-19 14:00:37,510 INFO - No user for HiveMQ Control Center configured. Starting with default user
2023-05-19 14:00:37,511 INFO - Starting HiveMQ Control Center on address 127.0.0.1 and port 8080
2023-05-19 14:00:37,908 INFO - Control Center Audit Logging started.
2023-05-19 14:00:37,914 INFO - Started HiveMQ Control Center in 403ms
2023-05-19 14:00:37,933 INFO - Starting TCP listener on address 0.0.0.0 and port 1883
2023-05-19 14:00:37,957 INFO - Started TCP Listener on address 0.0.0.0 and on port 1883.
2023-05-19 14:00:37,957 INFO - Started HiveMQ in 9158ms

But when we try connecting control center or tcp port 1883 using our ip address:

http://:8080 - it doesn’t return control center, connection is refused.

Added network firewall policy for TCP ports - 1883 and 8080 on google cloud as well.

If I change the config.xml and change bindAddress, it doesn’t work either.

Is there anything else we are missing.

Any help would be highly appreciated.

Hello @paragdrring ,

To confirm, does this Ubuntu VM also utilize a local firewall? Typically, Ubuntu installations include “ufw” or “Uncomplicated Firewall” which can prevent these ports from being accessed from the Ubuntu VM itself, rather than a network configuration within the Google Cloud / GCP environment.

Best,
Aaron from the HiveMQ Team

Tried changing this but no success. Just want to ask one question, in config.xml do we need to change binding address from local to the actual IP?

1883 0.0.0.0

And same for control center webUI?

Hello @paragdrring ,

0.0.0.0 specifies ‘any’ for the available IP address, meaning that it will take the address available for the network adapter being utilized.

If we are looking to use a specific address, it is recommended to update these bind addresses to the accurate network addresses intended to be utilized. More information regarding configuration is available here.

Best,
Aaron from HiveMQ Team

This is SOLVED. I re-added the firewall rules for 8080 and 1883 and for control center UI changed from localhost to 0.0.0.0 in config.

Thanks for all the help!

Hello @paragdrring ,

Glad to hear it, and thanks again for using the community forum!

Best,
Aaron from HiveMQ Team