How do I connect to Accumulo Thrift Proxy?

62 views Asked by At

My main goal is to use pyaccumulo, which from the description is a python client library for Apache Accumulo that uses the Accumulo Thrift Proxy.

But I can't seem to connect Accumulo Thrift Proxy correctly. My config.properties file is

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

When I ran the program, it shows error such as this:

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)

I keep getting this error, how do I solve this?

I tried to change useMiniAccumulo as True, but it took quite a long time and when it finally creates the proxy on the cluster, I still can't use the pyaccumulo.

1

There are 1 answers

0
auliama On

The problem was using localhost in zookeeper since I'm running it on docker. I fixed it by changing it to the docker host (172.0.0.x)