未能在2x zookeeper超时时间内连接到zookeeper

ccgok5k5  于 2021-05-29  发布在  Hadoop
关注(0)|答案(0)|浏览(212)
Failed to connect to zookeeper (10.10.10.205:2181) within 2x zookeeper timeout period 30000

我正在本地系统上运行geomesa客户端。我已经在我的虚拟机(ip是10.10.10.205)中设置了hadoop、accumulo和zookeeper,我可以看到zookeeper正在运行。

2187 Jps
24929 NameNode
25610 Main
25729 Main
25203 SecondaryNameNode
25055 DataNode
30767 QuorumPeerMain

但当我试图通过客户端连接时。我一直在犯这个错误。

java.lang.RuntimeException: Failed to connect to zookeeper (10.10.10.205:2181) within 2x zookeeper timeout period 30000
    at org.apache.accumulo.fate.zookeeper.ZooSession.connect(ZooSession.java:124)
    at org.apache.accumulo.fate.zookeeper.ZooSession.getSession(ZooSession.java:164)
    at org.apache.accumulo.fate.zookeeper.ZooReader.getSession(ZooReader.java:43)
    at org.apache.accumulo.fate.zookeeper.ZooReader.getZooKeeper(ZooReader.java:47)
    at org.apache.accumulo.fate.zookeeper.ZooCache.getZooKeeper(ZooCache.java:75)
    at org.apache.accumulo.fate.zookeeper.ZooCache.access$800(ZooCache.java:50)
    at org.apache.accumulo.fate.zookeeper.ZooCache$2.run(ZooCache.java:318)
    at org.apache.accumulo.fate.zookeeper.ZooCache$2.run(ZooCache.java:295)
    at org.apache.accumulo.fate.zookeeper.ZooCache$ZooRunnable.retry(ZooCache.java:190)
    at org.apache.accumulo.fate.zookeeper.ZooCache.get(ZooCache.java:347)
    at org.apache.accumulo.fate.zookeeper.ZooCache.get(ZooCache.java:282)
    at org.apache.accumulo.core.client.ZooKeeperInstance.getInstanceID(ZooKeeperInstance.java:169)
    at org.apache.accumulo.core.client.ZooKeeperInstance.<init>(ZooKeeperInstance.java:159)
    at org.apache.accumulo.core.client.ZooKeeperInstance.<init>(ZooKeeperInstance.java:140)
    at org.locationtech.geomesa.accumulo.data.AccumuloDataStoreFactory$.buildAccumuloConnector(AccumuloDataStoreFactory.scala:109)
    at org.locationtech.geomesa.accumulo.data.AccumuloDataStoreFactory$$anonfun$1.apply(AccumuloDataStoreFactory.scala:43)
    at org.locationtech.geomesa.accumulo.data.AccumuloDataStoreFactory$$anonfun$1.apply(AccumuloDataStoreFactory.scala:43)
    at scala.Option.getOrElse(Option.scala:121)
    at org.locationtech.geomesa.accumulo.data.AccumuloDataStoreFactory.createDataStore(AccumuloDataStoreFactory.scala:42)
    at org.locationtech.geomesa.accumulo.data.AccumuloDataStoreFactory.createDataStore(AccumuloDataStoreFactory.scala:31)
    at org.geotools.data.DataAccessFinder.getDataStore(DataAccessFinder.java:130)
    at org.geotools.data.DataStoreFinder.getDataStore(DataStoreFinder.java:89)
    at com.hps.GeomesaClient.<init>(GeomesaClient.java:50)
    at com.hps.GeomesaTest.setup(GeomesaTest.java:71)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.internal.runners.ClassRoadie.runBefores(ClassRoadie.java:49)
    at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:36)
    at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

我在这里不知所措。我不知道该怎么解决。下面是我的cfg文件:

tickTime=2000
initLimit=10
syncLimit=5
dataDir=/var/zookeeper
clientPort=2181

更新
这是jps-ml的输出

Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
4334 org.apache.accumulo.start.Main master --address localhost
5644 org.apache.hadoop.hdfs.server.namenode.NameNode
24363 sun.tools.jps.Jps -ml
5944 org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode
5778 org.apache.hadoop.hdfs.server.datanode.DataNode
4192 org.apache.accumulo.start.Main tserver --address localhost
24253 org.apache.zookeeper.server.quorum.QuorumPeerMain /opt/zookeeper/bin/../conf/zoo.cfg

这是应用netstat-tlnp | grep java的java|u选项后更新的输出

tcp        0      0 127.0.0.1:9997          0.0.0.0:*               LISTEN      4192/java
tcp        0      0 127.0.0.1:9999          0.0.0.0:*               LISTEN      4334/java
tcp        0      0 127.0.0.1:10001         0.0.0.0:*               LISTEN      4334/java
tcp        0      0 127.0.0.1:10002         0.0.0.0:*               LISTEN      4192/java
tcp        0      0 0.0.0.0:50070           0.0.0.0:*               LISTEN      5644/java
tcp        0      0 0.0.0.0:50010           0.0.0.0:*               LISTEN      5778/java
tcp        0      0 0.0.0.0:50075           0.0.0.0:*               LISTEN      5778/java
tcp        0      0 0.0.0.0:39233           0.0.0.0:*               LISTEN      24253/java
tcp        0      0 0.0.0.0:50020           0.0.0.0:*               LISTEN      5778/java
tcp        0      0 0.0.0.0:2181            0.0.0.0:*               LISTEN      24253/java
tcp        0      0 0.0.0.0:9000            0.0.0.0:*               LISTEN      5644/java
tcp        0      0 0.0.0.0:50090           0.0.0.0:*               LISTEN      5944/java

如果有人知道问题所在,请帮忙。谢谢:)

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题