微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Hazecast-Kubernetes Springboot应用程序嵌入式集群警告

如何解决Hazecast-Kubernetes Springboot应用程序嵌入式集群警告

我已经在kubernetes上部署了嵌入式hazelcast集群,但是我得到的警告不足。禁用了自动递增标志,并且portCount仍然出现错误

配置:

Config config = new Config();
config.setClusterName("cache-cluster");
JoinConfig joinConfig = config.getNetworkConfig().getJoin();
joinConfig.getMulticastConfig().setEnabled(false);
joinConfig.getTcpIpConfig().setEnabled(false);
joinConfig.getKubernetesConfig().setEnabled(true)
            .setProperty("namespace","<Namespace>")
            .setProperty("service-name","<Service-name>");

我在kubernetes中打开了容器端口。服务能够创建集群,但会不断收到以下警告。


2020-10-29 14:04:40.092  WARN  [hz.silly_lalande.IO.thread-in-1    ]  c.h.i.n.t.TcpIpConnection                    - [22.249.47.234]:5701 [cache-cluster] [4.0.1] Connection[id=2,/22.249.47.234:5701->/22.249.5.1:52152,qualifier=null,endpoint=null,alive=false,connectionType=NONE] closed. Reason: Exception in Connection[id=2,alive=true,connectionType=NONE],thread=hz.silly_lalande.IO.thread-in-1 
java.lang.IllegalStateException: UnkNown protocol: ?
    at com.hazelcast.internal.nio.tcp.UnifiedProtocolDecoder.onRead(UnifiedProtocolDecoder.java:116)
    at com.hazelcast.internal.networking.nio.NioInboundPipeline.process(NioInboundPipeline.java:137)
    at com.hazelcast.internal.networking.nio.NioPipeline.lambda$start$0(NioPipeline.java:127)
    at com.hazelcast.internal.networking.nio.NioThread.processtaskQueue(NioThread.java:354)
    at com.hazelcast.internal.networking.nio.NioThread.selectLoop(NioThread.java:289)
    at com.hazelcast.internal.networking.nio.NioThread.run(NioThread.java:248)
2020-10-29 14:13:10.038  WARN  [hz.silly_lalande.IO.thread-in-2    ]  c.h.i.n.t.TcpIpConnection                    - [22.249.47.234]:5701 [cache-cluster] [4.0.1] Connection[id=3,/22.249.47.234:5701->/22.249.55.1:52730,connectionType=NONE] closed. Reason: Exception in Connection[id=3,thread=hz.silly_lalande.IO.thread-in-2 
java.lang.IllegalStateException: TLS handshake header detected,but plain protocol header was expected.
    at com.hazelcast.internal.nio.tcp.UnifiedProtocolDecoder.loadProtocol(UnifiedProtocolDecoder.java:134)
    at com.hazelcast.internal.nio.tcp.UnifiedProtocolDecoder.onRead(UnifiedProtocolDecoder.java:90)
    at com.hazelcast.internal.networking.nio.NioInboundPipeline.process(NioInboundPipeline.java:137)
    at com.hazelcast.internal.networking.nio.NioThread.processSelectionKey(NioThread.java:382)
    at com.hazelcast.internal.networking.nio.NioThread.processSelectionKeys(NioThread.java:367)
    at com.hazelcast.internal.networking.nio.NioThread.selectLoop(NioThread.java:293)
    at com.hazelcast.internal.networking.nio.NioThread.run(NioThread.java:248)
2020-10-29 14:13:10.039  WARN  [hz.silly_lalande.IO.thread-in-0    ]  c.h.i.n.t.TcpIpConnection                    - [22.249.47.234]:5701 [cache-cluster] [4.0.1] Connection[id=4,/22.249.47.234:5701->/22.249.55.1:52736,connectionType=NONE] closed. Reason: Exception in Connection[id=4,thread=hz.silly_lalande.IO.thread-in-0 
java.lang.IllegalStateException: TLS handshake header detected,but plain protocol header was expected.
    at com.hazelcast.internal.nio.tcp.UnifiedProtocolDecoder.loadProtocol(UnifiedProtocolDecoder.java:134)
    at com.hazelcast.internal.nio.tcp.UnifiedProtocolDecoder.onRead(UnifiedProtocolDecoder.java:90)
    at com.hazelcast.internal.networking.nio.NioInboundPipeline.process(NioInboundPipeline.java:137)
    at com.hazelcast.internal.networking.nio.NioThread.processSelectionKey(NioThread.java:382)
    at com.hazelcast.internal.networking.nio.NioThread.processSelectionKeys(NioThread.java:367)
    at com.hazelcast.internal.networking.nio.NioThread.selectLoop(NioThread.java:293)
    at com.hazelcast.internal.networking.nio.NioThread.run(NioThread.java:248)

不确定为什么连接在这里

[22.249.47.234]:5701 [cache-cluster] [4.0.1] Connection[id=4,**/22.249.47.234:5701->/22.249.55.1:52736**,thread=hz.silly_lalande.IO.thread-in-0 

是否缺少任何配置?

解决方法

这看起来类似于https://github.com/hazelcast/hazelcast-kubernetes/issues/186 containerPort:5701 添加到您的HZ服务清单中应该可以。

无论服务类型是LoadBalancer还是ClusterIP,它都应该工作

即使在出现警告的情况下,您也可以确认集群工作正常吗?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。