Zookeeper 无头服务的未解析地址

qltillow  于 2022-12-09  发布在  Apache
关注(0)|答案(1)|浏览(335)

I have installed rke2 kube on a centos8 linux distro, nodes are these:

NAME                           STATUS   ROLES                       AGE    VERSION
a4b-kube-1.acme.com   Ready    control-plane,etcd,master   167m   v1.22.5+rke2r1
a4b-kube-2.acme.com   Ready    control-plane,etcd,master   161m   v1.22.5+rke2r1
a4b-kube-3.acme.com   Ready    control-plane,etcd,master   158m   v1.22.5+rke2r1

So far so good. Problems come when I try to install kafka with helm.

Values.yaml:

kafka:
  replicaCount: 1
  clusterDomain: acme-kube.local
  zookeeper:
    replicaCount: 3
    clusterDomain: acme-kube.local
    heapOpts: -Xmx128m -Xms128m
  heapOpts: -Xmx256m -Xms256m

requirements.yaml

dependencies:
- name: kafka
  repository: https://charts.bitnami.com/bitnami
  version: 12.18.3

Chart.yaml

apiVersion: v1
appVersion: "1.0"
description: A Helm chart test for acme
name: acme-test
version: 0.0.1

Deploying kafka with these commands after creating the namespace called acme-default:

helm dependency update acme-test/
helm --namespace=a4b-test install acme-test acme-test/

Pods are these now:

NAME                          READY   STATUS             RESTARTS        AGE
acme-test-kafka-0       0/1     CrashLoopBackOff   7 (4m46s ago)   18m
acme-test-zookeeper-0   0/1     CrashLoopBackOff   8 (101s ago)    18m
acme-test-zookeeper-1   0/1     CrashLoopBackOff   8 (68s ago)     18m
acme-test-zookeeper-2   0/1     CrashLoopBackOff   8 (52s ago)     18m

Kafka goes in error becasue zookeer is in error, here the kafka's log:
[2022-01-14 16:41:27,139] ERROR Unable to resolve address: acme-test-zookeeper:2181 (org.apache.zookeeper.client.StaticHostProvider) java.net.UnknownHostException: acme-test-zookeeper: Name or service not known at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:929) at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1519) at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:848) at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1509) at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1368) at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1302) at org.apache.zookeeper.client.StaticHostProvider$1.getAllByName(StaticHostProvider.java:92) at org.apache.zookeeper.client.StaticHostProvider.resolve(StaticHostProvider.java:147) at org.apache.zookeeper.client.StaticHostProvider.next(StaticHostProvider.java:375) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1137) [2022-01-14 16:41:27,145] WARN Session 0x0 for server acme-test-zookeeper:2181, unexpected error, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn) java.lang.IllegalArgumentException: Unable to canonicalize address acme-test-zookeeper:2181 because it's not resolvable at org.apache.zookeeper.SaslServerPrincipal.getServerPrincipal(SaslServerPrincipal.java:71) at org.apache.zookeeper.SaslServerPrincipal.getServerPrincipal(SaslServerPrincipal.java:39) at org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:1087) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1139)
While zookeper's log are these:
2022-01-14 16:44:27,845 [myid:1] - ERROR [ListenerHandler-acme-test-zookeeper-0.acme-test-zookeeper-headless.a4b-default.svc.acme-kube.local:3888:QuorumCnxManager$Listener$ListenerHandler@1094]

  • Exception while listening java.net.SocketException: Unresolved address at java.base/java.net.ServerSocket.bind(ServerSocket.java:388) at java.base/java.net.ServerSocket.bind(ServerSocket.java:349) at org.apache.zookeeper.server.quorum.QuorumCnxManager$Listener$ListenerHandler.createNewServerSocket(QuorumCnxManager.java:1136) at org.apache.zookeeper.server.quorum.QuorumCnxManager$Listener$ListenerHandler.acceptConnections(QuorumCnxManager.java:1065) at org.apache.zookeeper.server.quorum.QuorumCnxManager$Listener$ListenerHandler.run(QuorumCnxManager.java:1034) 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)

Same error for the other 2 zookeeper's pods. I dont understand why it cannot resolve, maybe something wrong with kube installation? my config.yaml is:

server: https://a4b-kube-1.acme.com:9345
token: xxxx
write-kubeconfig-mode: "0644"
tls-san:
  - "acme.com"
cluster-cidr: "10.42.0.0/16"
service-cidr: "10.43.0.0/16"
cluster-dns: "10.43.0.10"
cluster-domain: "acme.com"
7kqas0il

7kqas0il1#

在zookeeper部分中,您还必须添加clusterDomain:acme-kube.local

相关问题