Zookeeper 如何连接到Accumulo Thrift Proxy?

ct2axkht  于 12个月前  发布在  Apache
关注(0)|答案(1)|浏览(81)

我的主要目标是使用pyaccumulo,从描述中可以看出,它是Apache Accumulo的Python客户端库,使用Accumulo Thrift Proxy。
但我似乎无法正确连接Accumulo Thrift Proxy。我的config.properties文件是

useMockInstance=false
useMiniAccumulo=false
protocolFactory=org.apache.thrift.protocol.TCompactProtocol$Factory
tokenClass=org.apache.accumulo.core.client.security.tokens.PasswordToken
port=42424
maxFrameSize=16M

instance=test
zookeepers=localhost:2181

当我运行该程序时,它显示如下错误:

2023-06-10 17:43:58,709 [client.ClientConfiguration] INFO : Loaded client configuration file /opt/accumulo/conf/client.conf
2023-06-10 17:43:58,750 [impl.MetricsConfig] WARN : Cannot locate configuration: tried hadoop-metrics2-accumulo.properties,hadoop-metrics2.properties
2023-06-10 17:43:58,895 [impl.MetricsSystemImpl] INFO : Scheduled Metric snapshot period at 10 second(s).
2023-06-10 17:43:58,895 [impl.MetricsSystemImpl] INFO : Accumulo metrics system started
2023-06-10 17:43:58,942 [client.ClientConfiguration] INFO : Loaded client configuration file /opt/accumulo/conf/client.conf
2023-06-10 17:45:09,715 [start.Main] ERROR: Thread 'proxy' died.
java.lang.RuntimeException: Failed to connect to zookeeper (localhost:2181) within 2x zookeeper timeout period 30000
        at org.apache.accumulo.fate.zookeeper.ZooSession.connect(ZooSession.java:128)
        at org.apache.accumulo.fate.zookeeper.ZooSession.getSession(ZooSession.java:170)
        at org.apache.accumulo.fate.zookeeper.ZooReader.getSession(ZooReader.java:45)
        at org.apache.accumulo.fate.zookeeper.ZooReader.getZooKeeper(ZooReader.java:49)
        at org.apache.accumulo.fate.zookeeper.ZooCache.getZooKeeper(ZooCache.java:140)
        at org.apache.accumulo.fate.zookeeper.ZooCache.access$800(ZooCache.java:47)
        at org.apache.accumulo.fate.zookeeper.ZooCache$2.run(ZooCache.java:393)
        at org.apache.accumulo.fate.zookeeper.ZooCache$2.run(ZooCache.java:366)
        at org.apache.accumulo.fate.zookeeper.ZooCache$ZooRunnable.retry(ZooCache.java:260)
        at org.apache.accumulo.fate.zookeeper.ZooCache.get(ZooCache.java:423)
        at org.apache.accumulo.fate.zookeeper.ZooCache.get(ZooCache.java:352)
        at org.apache.accumulo.core.client.ZooKeeperInstance.getInstanceID(ZooKeeperInstance.java:198)
        at org.apache.accumulo.core.client.ZooKeeperInstance.<init>(ZooKeeperInstance.java:177)
        at org.apache.accumulo.core.client.ZooKeeperInstance.<init>(ZooKeeperInstance.java:189)
        at org.apache.accumulo.proxy.ProxyServer.<init>(ProxyServer.java:206)
        at org.apache.accumulo.proxy.Proxy.createProxyServer(Proxy.java:212)
        at org.apache.accumulo.proxy.Proxy.createProxyServer(Proxy.java:190)
        at org.apache.accumulo.proxy.Proxy.execute(Proxy.java:173)
        at org.apache.accumulo.start.Main$1.run(Main.java:130)
        at java.lang.Thread.run(Thread.java:748)

我一直得到这个错误,我该如何解决这个问题?
我尝试将useMiniAccumulo更改为True,但花了很长时间,当它最终在集群上创建代理时,我仍然无法使用pyaccumulo。

moiiocjp

moiiocjp1#

问题是在zookeeper中使用localhost,因为我在docker上运行它。我通过将其更改为docker主机(172.0.0.x)来修复它

相关问题