i have broker runing in amazon aws instance and I restart the instance after restart the broker refused to reconnect
I run /etc/init.d/hivemq status
and result is
hivemq.service - HiveMQ Community Edition
Loaded: loaded (/etc/systemd/system/hivemq.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2024-07-28 15:43:48 UTC; 37min ago
Main PID: 858 (java)
Tasks: 35 (limit: 1134)
CGroup: /system.slice/hivemq.service
└─858 java -Dhivemq.home=/opt/hivemq -XX:HeapDumpPath=/opt/hivemq/heap-dump.hprof -XX:ErrorFile=/opt/hivemq/hs_err_pid%p.log -Djava.net.…ar
netstat -an | grep 1883
return nothing !
Hi @gendiaaa
Hello and a warm welcome to the HiveMQ Community! We’re delighted that you’re interested in MQTT and the HiveMQ broker. Your presence brings us great joy.
I don’t see any error message in the information you’ve provided. What you’ve shared appears to be a status report for the HiveMQ service, and it indicates that the service is currently running. Here’s a breakdown of the key information:
- The service is loaded and enabled.
- It’s active and running since Sunday, July 28, 2024, at 15:43:48 UTC.
- It has been running for 37 minutes at the time this status was checked.
- The main process ID is 858.
This status suggests that the HiveMQ broker is actually running on your AWS instance. If you’re having issues connecting to it, check HiveMQ logs for more detailed information about security and port configuration errors. You want to check the “hivemq.log” file from the start moment until the line “Started HiveMQ in…”. Official documentation on logs: Logging :: HiveMQ Documentation
Best,
Dasha from the HiveMQ Team
this is when i try to run.sh
2024-07-29 01:38:59,925 INFO - Starting HiveMQ Community Edition Server
2024-07-29 01:38:59,930 INFO - HiveMQ version: 2022.2-SNAPSHOT
2024-07-29 01:38:59,930 INFO - HiveMQ home directory: /opt/hivemq
2024-07-29 01:38:59,931 INFO - Log Configuration was overridden by /opt/hivemq/conf/logback.xml
2024-07-29 01:39:00,460 INFO - This HiveMQ ID is UnBhb
2024-07-29 01:39:05,613 ERROR - Exception on Log recovery. Approved high address = -1145652621
jetbrains.exodus.ExodusException: Can’t read loggable fully, address = 1704042, file = 00000000000.xd
at jetbrains.exodus.log.Log.(Log.java:151)
at jetbrains.exodus.env.Environments.newLogInstance(Environments.java:137)
at jetbrains.exodus.env.Environments.newLogInstance(Environments.java:115)
at jetbrains.exodus.env.Environments.newContextualInstance(Environments.java:99)
at com.hivemq.persistence.local.xodus.XodusLocalPersistence.lambda$start$2(XodusLocalPersistence.java:164)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
2024-07-29 01:39:07,405 ERROR - Exception on Log recovery. Approved high address = -947695375
jetbrains.exodus.ExodusException: Can’t read loggable fully, address = 1687552, file = 00000000000.xd
at jetbrains.exodus.log.Log.(Log.java:151)
at jetbrains.exodus.env.Environments.newLogInstance(Environments.java:137)
at jetbrains.exodus.env.Environments.newLogInstance(Environments.java:115)
at jetbrains.exodus.env.Environments.newContextualInstance(Environments.java:99)
at com.hivemq.persistence.local.xodus.XodusLocalPersistence.lambda$start$2(XodusLocalPersistence.java:164)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
2024-07-29 00:01:11,044 INFO - Starting HiveMQ Community Edition Server
2024-07-29 00:01:11,048 INFO - HiveMQ version: 2022.2-SNAPSHOT
2024-07-29 00:01:11,048 INFO - HiveMQ home directory: /opt/hivemq
2024-07-29 00:01:11,049 INFO - Log Configuration was overridden by /opt/hivemq/conf/logback.xml
2024-07-29 00:01:11,865 INFO - This HiveMQ ID is sM1Ny
2024-07-29 00:01:17,453 ERROR - Exception on Log recovery. Approved high address = -1145652621
jetbrains.exodus.ExodusException: Can’t read loggable fully, address = 1704042, file = 00000000000.xd
at jetbrains.exodus.log.Log.(Log.java:151)
at jetbrains.exodus.env.Environments.newLogInstance(Environments.java:137)
at jetbrains.exodus.env.Environments.newLogInstance(Environments.java:115)
at jetbrains.exodus.env.Environments.newContextualInstance(Environments.java:99)
at com.hivemq.persistence.local.xodus.XodusLocalPersistence.lambda$start$2(XodusLocalPersistence.java:164)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
2024-07-29 00:01:19,990 ERROR - Exception on Log recovery. Approved high address = -947695375
jetbrains.exodus.ExodusException: Can’t read loggable fully, address = 1687552, file = 00000000000.xd
at jetbrains.exodus.log.Log.(Log.java:151)
at jetbrains.exodus.env.Environments.newLogInstance(Environments.java:137)
at jetbrains.exodus.env.Environments.newLogInstance(Environments.java:115)
at jetbrains.exodus.env.Environments.newContextualInstance(Environments.java:99)
at com.hivemq.persistence.local.xodus.XodusLocalPersistence.lambda$start$2(XodusLocalPersistence.java:164)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
2024-07-29 00:08:23,350 INFO - Starting HiveMQ Community Edition Server
2024-07-29 00:08:23,358 INFO - HiveMQ version: 2022.2-SNAPSHOT
2024-07-29 00:08:23,358 INFO - HiveMQ home directory: /opt/hivemq
2024-07-29 00:08:23,363 INFO - Log Configuration was overridden by /opt/hivemq/conf/logback.xml
2024-07-29 00:08:24,288 INFO - This HiveMQ ID is nhm8a
2024-07-29 00:08:32,522 ERROR - Exception on Log recovery. Approved high address = -1145652621
jetbrains.exodus.ExodusException: Can’t read loggable fully, address = 1704042, file = 00000000000.xd
at jetbrains.exodus.log.Log.(Log.java:151)
at jetbrains.exodus.env.Environments.newLogInstance(Environments.java:137)
at jetbrains.exodus.env.Environments.newLogInstance(Environments.java:115)
at jetbrains.exodus.env.Environments.newContextualInstance(Environments.java:99)
at com.hivemq.persistence.local.xodus.XodusLocalPersistence.lambda$start$2(XodusLocalPersistence.java:164)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
2024-07-29 00:08:36,677 ERROR - Exception on Log recovery. Approved high address = -947695375
jetbrains.exodus.ExodusException: Can’t read loggable fully, address = 1687552, file = 00000000000.xd
at jetbrains.exodus.log.Log.(Log.java:151)
at jetbrains.exodus.env.Environments.newLogInstance(Environments.java:137)
at jetbrains.exodus.env.Environments.newLogInstance(Environments.java:115)
at jetbrains.exodus.env.Environments.newContextualInstance(Environments.java:99)
at com.hivemq.persistence.local.xodus.XodusLocalPersistence.lambda$start$2(XodusLocalPersistence.java:164)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
2024-07-29 00:56:58,731 INFO - Starting HiveMQ Community Edition Server
2024-07-29 00:56:58,736 INFO - HiveMQ version: 2022.2-SNAPSHOT
2024-07-29 00:56:58,736 INFO - HiveMQ home directory: /opt/hivemq
2024-07-29 00:56:58,738 INFO - Log Configuration was overridden by /opt/hivemq/conf/logback.xml
2024-07-29 00:56:59,343 INFO - HiveMQ start was cancelled. An error occurred while opening the persistence. Is another HiveMQ instance running?
2024-07-29 00:58:24,249 INFO - Starting HiveMQ Community Edition Server
2024-07-29 00:58:24,252 INFO - HiveMQ version: 2022.2-SNAPSHOT
2024-07-29 00:58:24,252 INFO - HiveMQ home directory: /opt/hivemq
Hi @gendiaaa
Thanks for sharing the log. Can you confirm the issue is observed not only with version 2022.2 but also with the latest version 2024.6?
Best,
Dasha from the HiveMQ Team
i did not setup version 2024.6
i have the old version
i think i need help to update to the new version right ?
please lemme know what is the problem so I can try to solve or help me to solve it please its urgent case
I see two potential issues:
- You already have a running HiveMQ process therefore the second process can’t start up. So make sure you don’t already have a running HiveMQ instance (maybe started via service?)
- The data folder got corrupted because due to instance restart or something else. If that is the case you would need to delete the content of the HiveMQ data folder, which means you loose all client data, then start with a clean slate. Best way to test this is to copy whole HiveMQ folder and delete the data folder in the copied folder and then try to start instance via the copied folder.
Greetings,
Michael
thank you and yes its happened after restart and I do not know why this happens after restart
sp you mean if I delete my data files I will be able to run again ?
can you tell me how exactly i can do this to delete which files ?
:/opt/hivemq/data$ ls
data.lock meta.id metadata persistence
I am here in data folder which file should I delete and how?
Basically everything in /opt/hivemq/data
:
Linux: rm -fr /opt/hivemq/data/*
But as I said test this with a copied hivemq folder first to see if this would solve your issue.
I also would recommend to test the first issue I mentioned aka make sure you do not have already a HiveMQ process running that you are not aware of
okay the test is run successfully i copied the hivemq folder inside opt to new hivemq2 folder
then I delete data
I run.sh
working great
now I have to stop this running process and delete hivemq2 folder then go to hivemq original folder and delete data then restart the server it should work again ?
Yes correctly. But stop any HiveMQ process/service you can find before you delete the data folder of /opt/hivemq/data
. After you deleted the data folder you can start the HiveMQ process or service.
i do not know how to thank you you saved my day and life … thank you so much
may i ask you a small question? at what point in the error logs did you figure out the problem in the data folder which point shows that? and as I understand now this data folder is created on the running time to store the data like retained messages and those data is that right ?
As you can see in the logs
2024-07-29 00:56:59,343 INFO - HiveMQ start was cancelled. An error occurred while opening the persistence. Is another HiveMQ instance running?
and in combination with the ERROR logs i.e. com.hivemq.persistence.local.xodus.XodusLocalPersistence
Persistence == data folder