Issue with Influxdb extension in Ubuntu linux | Solved

Hello,
I am having docker containers for Influxdb and hivemq-ce running on my ubuntu system (VM on Win 10). They are working in general. Now I want to monitor the hivemq broker using the influxDB extension (HiveMQ Extension - InfluxDB). I do not get any data in the database. Here is the influx.properties file for reference

mode:http
host:192.168.5.104
port:8086
protocol:http
auth:

prefix:
database:hivemq

reportingInterval:1
connectTimeout:5000

tags:host=hivemq1

I have run this same system on a RasPi 4 and it worked but not on my Ubuntu VM. Please help…
Thanks in advance!

BR,
Subhadeep

Hello @sahebdatta,

can you fetch and post the hivemq.log of the HiveMQ CE docker container? Then we can look if everything is correctly installed and configured (the config logs fine tough).

You can use this command:

docker cp containerId:/opt/hivemq/log/hivemq.log localPath/hivemq.log

Another question, are both containers in the same network?

Greetings,
Michael

Hi @michael_w,
Thanks for the quick response… Here you go…

2021-01-11 05:31:53,829 INFO  - Starting HiveMQ Community Edition Server
2021-01-11 05:31:53,909 INFO  - HiveMQ version: 2020.6
2021-01-11 05:31:53,909 INFO  - HiveMQ home directory: /opt/hivemq
2021-01-11 05:31:54,585 INFO  - Log Configuration was overridden by /opt/hivemq/conf/logback.xml
2021-01-11 05:31:57,318 INFO  - This HiveMQ ID is QV7kg
2021-01-11 05:32:01,636 INFO  - Shutting down HiveMQ. Please wait, this could take a while...
2021-01-11 05:33:03,170 INFO  - Starting HiveMQ Community Edition Server
2021-01-11 05:33:03,240 INFO  - HiveMQ version: 2020.6
2021-01-11 05:33:03,240 INFO  - HiveMQ home directory: /opt/hivemq
2021-01-11 05:33:04,031 INFO  - Log Configuration was overridden by /opt/hivemq/conf/logback.xml
2021-01-11 05:33:06,697 INFO  - This HiveMQ ID is cZwZ4
2021-01-11 05:33:18,177 INFO  - Starting with file persistences
2021-01-11 05:33:22,798 INFO  - Starting HiveMQ extension system.
2021-01-11 05:33:23,026 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 (https://www.hivemq.com/extensions/).       #
################################################################################################################
2021-01-11 05:33:23,039 INFO  - Extension "Allow All Extension" version 1.0.0 started successfully.
2021-01-11 05:33:23,192 INFO  - Starting TCP listener on address 0.0.0.0 and port 1883
2021-01-11 05:33:23,394 INFO  - Starting Websocket listener on address 0.0.0.0 and port 8000
2021-01-11 05:33:23,440 INFO  - Started TCP Listener on address 0.0.0.0 and on port 1883
2021-01-11 05:33:23,440 INFO  - Started Websocket Listener on address 0.0.0.0 and on port 8000
2021-01-11 05:33:23,440 INFO  - Started HiveMQ in 20367ms
2021-01-11 10:17:07,994 INFO  - Shutting down HiveMQ. Please wait, this could take a while...
2021-01-11 10:17:10,080 INFO  - Shutting down extension system
2021-01-11 10:17:10,085 INFO  - Extension "Allow All Extension" version 1.0.0 stopped successfully.
2021-01-11 10:17:24,830 INFO  - Starting HiveMQ Community Edition Server
2021-01-11 10:17:24,840 INFO  - HiveMQ version: 2020.6
2021-01-11 10:17:24,840 INFO  - HiveMQ home directory: /opt/hivemq
2021-01-11 10:17:24,961 INFO  - Log Configuration was overridden by /opt/hivemq/conf/logback.xml
2021-01-11 10:17:25,734 INFO  - This HiveMQ ID is uFNhd
2021-01-11 10:17:28,898 INFO  - Starting with file persistences
2021-01-11 10:17:30,440 INFO  - Starting HiveMQ extension system.
2021-01-11 10:17:30,609 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 (https://www.hivemq.com/extensions/).       #
################################################################################################################
2021-01-11 10:17:30,617 INFO  - Extension "Allow All Extension" version 1.0.0 started successfully.
2021-01-11 10:17:30,687 INFO  - Starting TCP listener on address 0.0.0.0 and port 1883
2021-01-11 10:17:30,769 INFO  - Starting Websocket listener on address 0.0.0.0 and port 8000
2021-01-11 10:17:30,790 INFO  - Started TCP Listener on address 0.0.0.0 and on port 1883
2021-01-11 10:17:30,790 INFO  - Started Websocket Listener on address 0.0.0.0 and on port 8000
2021-01-11 10:17:30,790 INFO  - Started HiveMQ in 5979ms
2021-01-11 10:22:07,734 INFO  - Shutting down HiveMQ. Please wait, this could take a while...
2021-01-11 10:22:09,886 INFO  - Shutting down extension system
2021-01-11 10:22:09,888 INFO  - Extension "Allow All Extension" version 1.0.0 stopped successfully.
2021-01-11 10:22:19,403 INFO  - Starting HiveMQ Community Edition Server
2021-01-11 10:22:19,416 INFO  - HiveMQ version: 2020.6
2021-01-11 10:22:19,416 INFO  - HiveMQ home directory: /opt/hivemq
2021-01-11 10:22:19,523 INFO  - Log Configuration was overridden by /opt/hivemq/conf/logback.xml
2021-01-11 10:22:20,269 INFO  - This HiveMQ ID is Pj4cF
2021-01-11 10:22:23,728 INFO  - Starting with file persistences
2021-01-11 10:22:25,154 INFO  - Starting HiveMQ extension system.
2021-01-11 10:22:25,243 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 (https://www.hivemq.com/extensions/).       #
################################################################################################################
2021-01-11 10:22:25,246 INFO  - Extension "Allow All Extension" version 1.0.0 started successfully.
2021-01-11 10:22:25,390 INFO  - Starting TCP listener on address 0.0.0.0 and port 1883
2021-01-11 10:22:25,523 INFO  - Starting Websocket listener on address 0.0.0.0 and port 8000
2021-01-11 10:22:25,573 INFO  - Started TCP Listener on address 0.0.0.0 and on port 1883
2021-01-11 10:22:25,574 INFO  - Started Websocket Listener on address 0.0.0.0 and on port 8000
2021-01-11 10:22:25,574 INFO  - Started HiveMQ in 6182ms
2021-01-11 10:30:39,875 INFO  - Shutting down HiveMQ. Please wait, this could take a while...
2021-01-11 10:30:41,942 INFO  - Shutting down extension system
2021-01-11 10:30:41,945 INFO  - Extension "Allow All Extension" version 1.0.0 stopped successfully.
2021-01-11 10:30:52,660 INFO  - Starting HiveMQ Community Edition Server
2021-01-11 10:30:52,678 INFO  - HiveMQ version: 2020.6
2021-01-11 10:30:52,678 INFO  - HiveMQ home directory: /opt/hivemq
2021-01-11 10:30:52,952 INFO  - Log Configuration was overridden by /opt/hivemq/conf/logback.xml
2021-01-11 10:30:53,826 INFO  - This HiveMQ ID is gEXtD
2021-01-11 10:30:57,149 INFO  - Starting with file persistences
2021-01-11 10:30:58,889 INFO  - Starting HiveMQ extension system.
2021-01-11 10:30:59,040 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 (https://www.hivemq.com/extensions/).       #
################################################################################################################
2021-01-11 10:30:59,043 INFO  - Extension "Allow All Extension" version 1.0.0 started successfully.
2021-01-11 10:30:59,109 INFO  - Starting TCP listener on address 0.0.0.0 and port 1883
2021-01-11 10:30:59,232 INFO  - Starting Websocket listener on address 0.0.0.0 and port 8000
2021-01-11 10:30:59,247 INFO  - Started TCP Listener on address 0.0.0.0 and on port 1883
2021-01-11 10:30:59,250 INFO  - Started Websocket Listener on address 0.0.0.0 and on port 8000
2021-01-11 10:30:59,253 INFO  - Started HiveMQ in 6640ms
2021-01-11 11:15:54,433 INFO  - Shutting down HiveMQ. Please wait, this could take a while...
2021-01-11 11:15:56,513 INFO  - Shutting down extension system
2021-01-11 11:15:56,516 INFO  - Extension "Allow All Extension" version 1.0.0 stopped successfully.
2021-01-11 11:17:28,637 INFO  - Starting HiveMQ Community Edition Server
2021-01-11 11:17:28,640 INFO  - HiveMQ version: 2020.6
2021-01-11 11:17:28,640 INFO  - HiveMQ home directory: /opt/hivemq
2021-01-11 11:17:28,841 INFO  - Log Configuration was overridden by /opt/hivemq/conf/logback.xml
2021-01-11 11:17:29,960 INFO  - This HiveMQ ID is kwpTc
2021-01-11 11:17:33,723 INFO  - Starting with file persistences
2021-01-11 11:17:35,401 INFO  - Starting HiveMQ extension system.
2021-01-11 11:17:35,509 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 (https://www.hivemq.com/extensions/).       #
################################################################################################################
2021-01-11 11:17:35,511 INFO  - Extension "Allow All Extension" version 1.0.0 started successfully.
2021-01-11 11:17:35,614 INFO  - Starting TCP listener on address 0.0.0.0 and port 1883
2021-01-11 11:17:35,706 INFO  - Starting Websocket listener on address 0.0.0.0 and port 8000
2021-01-11 11:17:35,731 INFO  - Started TCP Listener on address 0.0.0.0 and on port 1883
2021-01-11 11:17:35,731 INFO  - Started Websocket Listener on address 0.0.0.0 and on port 8000
2021-01-11 11:17:35,732 INFO  - Started HiveMQ in 7119ms
2021-01-11 11:31:57,285 INFO  - Shutting down HiveMQ. Please wait, this could take a while...
2021-01-11 11:31:59,345 INFO  - Shutting down extension system
2021-01-11 11:31:59,351 INFO  - Extension "Allow All Extension" version 1.0.0 stopped successfully.
2021-01-11 11:32:09,856 INFO  - Starting HiveMQ Community Edition Server
2021-01-11 11:32:09,883 INFO  - HiveMQ version: 2020.6
2021-01-11 11:32:09,883 INFO  - HiveMQ home directory: /opt/hivemq
2021-01-11 11:32:10,082 INFO  - Log Configuration was overridden by /opt/hivemq/conf/logback.xml
2021-01-11 11:32:11,245 INFO  - This HiveMQ ID is 6EkGl
2021-01-11 11:32:14,934 INFO  - Starting with file persistences
2021-01-11 11:32:16,759 INFO  - Starting HiveMQ extension system.
2021-01-11 11:32:16,865 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 (https://www.hivemq.com/extensions/).       #
################################################################################################################
2021-01-11 11:32:16,870 INFO  - Extension "Allow All Extension" version 1.0.0 started successfully.
2021-01-11 11:32:16,925 INFO  - Starting TCP listener on address 0.0.0.0 and port 1883
2021-01-11 11:32:16,996 INFO  - Starting Websocket listener on address 0.0.0.0 and port 8000
2021-01-11 11:32:17,050 INFO  - Started TCP Listener on address 0.0.0.0 and on port 1883
2021-01-11 11:32:17,050 INFO  - Started Websocket Listener on address 0.0.0.0 and on port 8000
2021-01-11 11:32:17,050 INFO  - Started HiveMQ in 7212ms
2021-01-11 11:34:44,746 INFO  - Shutting down HiveMQ. Please wait, this could take a while...
2021-01-11 11:34:46,893 INFO  - Shutting down extension system
2021-01-11 11:34:46,898 INFO  - Extension "Allow All Extension" version 1.0.0 stopped successfully.
2021-01-11 11:35:10,356 INFO  - Starting HiveMQ Community Edition Server
2021-01-11 11:35:10,372 INFO  - HiveMQ version: 2020.6
2021-01-11 11:35:10,372 INFO  - HiveMQ home directory: /opt/hivemq
2021-01-11 11:35:10,697 INFO  - Log Configuration was overridden by /opt/hivemq/conf/logback.xml
2021-01-11 11:35:12,500 INFO  - This HiveMQ ID is 2ZkpI
2021-01-11 11:35:21,031 INFO  - Starting with file persistences
2021-01-11 11:35:24,553 INFO  - Starting HiveMQ extension system.
2021-01-11 11:35:24,769 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 (https://www.hivemq.com/extensions/).       #
################################################################################################################
2021-01-11 11:35:24,819 INFO  - Extension "Allow All Extension" version 1.0.0 started successfully.
2021-01-11 11:35:24,980 INFO  - Starting TCP listener on address 0.0.0.0 and port 1883
2021-01-11 11:35:25,151 INFO  - Starting Websocket listener on address 0.0.0.0 and port 8000
2021-01-11 11:35:25,209 INFO  - Started TCP Listener on address 0.0.0.0 and on port 1883
2021-01-11 11:35:25,209 INFO  - Started Websocket Listener on address 0.0.0.0 and on port 8000
2021-01-11 11:35:25,209 INFO  - Started HiveMQ in 14929ms
2021-01-11 11:47:48,077 INFO  - Shutting down HiveMQ. Please wait, this could take a while...
2021-01-11 11:47:50,147 INFO  - Shutting down extension system
2021-01-11 11:47:50,148 INFO  - Extension "Allow All Extension" version 1.0.0 stopped successfully.
2021-01-11 11:48:02,052 INFO  - Starting HiveMQ Community Edition Server
2021-01-11 11:48:02,083 INFO  - HiveMQ version: 2020.6
2021-01-11 11:48:02,083 INFO  - HiveMQ home directory: /opt/hivemq
2021-01-11 11:48:02,302 INFO  - Log Configuration was overridden by /opt/hivemq/conf/logback.xml
2021-01-11 11:48:03,321 INFO  - This HiveMQ ID is 5gzty
2021-01-11 11:48:07,276 INFO  - Starting with file persistences
2021-01-11 11:48:08,882 INFO  - Starting HiveMQ extension system.
2021-01-11 11:48:08,977 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 (https://www.hivemq.com/extensions/).       #
################################################################################################################
2021-01-11 11:48:08,985 INFO  - Extension "Allow All Extension" version 1.0.0 started successfully.
2021-01-11 11:48:09,053 INFO  - Starting TCP listener on address 0.0.0.0 and port 1883
2021-01-11 11:48:09,145 INFO  - Starting Websocket listener on address 0.0.0.0 and port 8000
2021-01-11 11:48:09,159 INFO  - Started TCP Listener on address 0.0.0.0 and on port 1883
2021-01-11 11:48:09,159 INFO  - Started Websocket Listener on address 0.0.0.0 and on port 8000
2021-01-11 11:48:09,160 INFO  - Started HiveMQ in 7137ms

Yes, I double-checked… this might help!

> ~$ docker container ls
> CONTAINER ID   IMAGE              COMMAND                  CREATED      STATUS          PORTS                              NAMES
> 0f9886616c89   hivemq/hivemq-ce   "/opt/docker-entrypo…"   3 days ago   Up 35 minutes   0.0.0.0:1883->1883/tcp, 8000/tcp   hivemq
> b942261978ed   telegraf           "/entrypoint.sh tele…"   3 days ago   Up 35 minutes   8092/udp, 8125/udp, 8094/tcp       telegraf
> 795ba9835b24   influxdb           "/entrypoint.sh infl…"   4 days ago   Up 35 minutes   0.0.0.0:8086->8086/tcp             influxdb
> 9c51ce12fc9a   chronograf         "/entrypoint.sh chro…"   4 days ago   Up 35 minutes   0.0.0.0:8888->8888/tcp             chronograf
> 34a95fe10a20   grafana/grafana    "/run.sh"                4 days ago   Up 35 minutes   0.0.0.0:3000->3000/tcp             grafana

Hi @sahebdatta,

you are using the official HiveMQ CE image which doesn’t have the InfluxDB extension installed. You need to build you a custom images with where you add the influxdb extension.

Do you know how this works or should I help you?

Kind regards,
Michael

Hi Michael,

is this what you mean?

~$ docker exec -it hivemq bash
root@0f9886616c89:/opt/hivemq-ce-2020.6# ls 
README.txt  bin  conf  data  extensions  log  third-party-licenses
root@0f9886616c89:/opt/hivemq-ce-2020.6# cd extensions/
root@0f9886616c89:/opt/hivemq-ce-2020.6/extensions# ls
hivemq-allow-all-extension  hivemq-influxdb-extension
root@0f9886616c89:/opt/hivemq-ce-2020.6/extensions# cd hivemq-
bash: cd: hivemq-: No such file or directory
root@0f9886616c89:/opt/hivemq-ce-2020.6/extensions# cd hivemq-influxdb-extension/
root@0f9886616c89:/opt/hivemq-ce-2020.6/extensions/hivemq-influxdb-extension# ls
LICENSE.txt  README.txt		   hivemq-influxdb-extension-4.1.0.jar
README.html  hivemq-extension.xml  influxdb.properties
root@0f9886616c89:/opt/hivemq-ce-2020.6/extensions/hivemq-influxdb-extension#

I have already installed the available extension from this link: HiveMQ Extension - InfluxDB

Hi @sahebdatta,

my guess is you did copy the extension after the container was already started? Then this won’t work with the community edition as it has no hot reload of extensions.

What you can do is to build your own docker image, I’ll list the steps you need for that below.

Create the structure:
Don’t forget to configure the influxdb.properties.

The Dockerfile contains:

FROM hivemq/hivemq-ce:2020.6
COPY hivemq-influxdb-extension /opt/hivemq/extensions/hivemq-influxdb-extension

Build the image:
cd to the DOCKER folder then execute (you can use adapt the image name if you want):

docker build -t hivemq-ce-influxdb:2020.6 .

Run it:

Replace in the docker run command hivemq/hivemq-ce through hivemq-ce-influxdb:2020.6.

Then the extension should start, check the hivemq.log for those lines if and of course if data is sent to the influxdb image:

2021-01-12 05:51:37,454 INFO  - Creating InfluxDB HTTP sender for server 10.2.1.123:8086 and database hivemq
2021-01-12 05:51:37,470 INFO  - Extension "InfluxDB Monitoring Extension" version 4.1.0 started successfully

Greetings,
Michael

2 Likes

Hi Michael,

Wow, it works!!! Thanks for your spot on support! :grinning:
Have a great rest of the day.

BR,
Subhadeep

Hi @sahebdatta,

I’m glad to hear that it works now :slight_smile:.

You also have a great day :+1:

Greetings,
Michael