Hi HiveMQ Team,
I have deployed HiveMQ on Kubernetes (Openstack Platform). Initially when i start application it is working fine and in logs showing nodes added in cluster, extention started etc… But when i check again after 20 or 24 hours logs of hivemq printing below error:
2020-02-07 07:27:47,003 ERROR - Failed to resolve DNS record for address ‘hivemq-discovery-1.kube-prod-hivemq.svc.cluster.local.’.
java.util.concurrent.ExecutionException: java.net.UnknownHostException: failed to resolve ‘hivemq-discovery-1.kube-prod-hivemq.svc.cluster.local.’ after 2 queries
at io.netty.util.concurrent.AbstractFuture.get(AbstractFuture.java:54)
at com.hivemq.extensions.callbacks.DnsClusterDiscovery.loadOtherNodes(DnsClusterDiscovery.java:110)
at com.hivemq.extensions.callbacks.DnsClusterDiscovery.loadClusterNodeAddresses(DnsClusterDiscovery.java:88)
at com.hivemq.extensions.callbacks.DnsClusterDiscovery.reload(DnsClusterDiscovery.java:78)
at cX.e$a.run(Unknown Source)
at com.codahale.metrics.InstrumentedScheduledExecutorService$InstrumentedRunnable.run(Unknown Source)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.net.UnknownHostException: failed to resolve ‘hivemq-discovery-1.kube-prod-hivemq.svc.cluster.local.’ after 2 queries
at io.netty.resolver.dns.DnsResolveContext.finishResolve(DnsResolveContext.java:848)
at io.netty.resolver.dns.DnsResolveContext.tryToFinishResolve(DnsResolveContext.java:809)
at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:332)
at io.netty.resolver.dns.DnsResolveContext.access$600(DnsResolveContext.java:62)
at io.netty.resolver.dns.DnsResolveContext$3.operationComplete(DnsResolveContext.java:381)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:504)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:483)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:121)
at io.netty.resolver.dns.DnsQueryContext.setFailure(DnsQueryContext.java:220)
at io.netty.resolver.dns.DnsQueryContext.access$300(DnsQueryContext.java:43)
at io.netty.resolver.dns.DnsQueryContext$4.run(DnsQueryContext.java:170)
at io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38)
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:127)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:474)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:909)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
… 1 common frames omitted
Caused by: io.netty.resolver.dns.DnsNameResolverTimeoutException: [/10.233.0.10:53] query timed out after 5000 milliseconds (no stack trace available)
I am pulling latest HiveMQ DNS image from docker hub in Docker file.
Docker file
ARG BASEIMAGE=hivemq/hivemq4:dns-latest
FROM ${BASEIMAGE}
##Use default DNS resolution timeout as default discovery interval
ENV HIVEMQ_DNS_DISCOVERY_INTERVAL 31
ENV HIVEMQ_DNS_DISCOVERY_TIMEOUT 30
##The default cluster transport bind port to use (UDP port)
ENV HIVEMQ_CLUSTER_PORT 7800
ENV HIVEMQ_CONTROL_CENTER_USER admin
ENV HIVEMQ_CONTROL_CENTER_PASSWORD a68fc32fc49fc4d04c63724a1f6d0c90442209c46dba6975774cde5e5149caf8
COPY config-dns.xml /opt/hivemq/conf/config.xml
COPY logback.xml /opt/hivemq/conf/logback.xml
COPY run.sh /opt/hivemq/bin/run.sh
COPY docker-entrypoint.sh /opt/docker-entrypoint.sh
##HiveMQ extentions for Redis, Kafka, IDAM, LDAP etc…
ADD extension/extension.tar.gz /opt/hivemq/extensions/
RUN chown -R hivemq:hivemq /opt/hivemq
&& chmod +x /opt/docker-entrypoint.sh && chmod +x /opt/hivemq/bin/run.sh
##HiveMQ-licence and hivemq4-kafka-extension-license
COPY licence/hivemq.lic /opt/hivemq/license/hivemq-license.lic
COPY licence/hivemq4-kafka-extension-license.elic /opt/hivemq/license/hivemq4-kafka-extension-license.elic
RUN chown -R hivemq:hivemq /opt/hivemq*
##Set TimeZone on Container.
ENV TZ=Asia/Kolkata
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN ln -sf /dev/stdout /opt/hivemq/log/hivemq.log
ENTRYPOINT ["/opt/docker-entrypoint.sh"]
CMD ["/opt/hivemq/bin/run.sh"]