getting below error when using multitenant phoenix connection

is there a way to programmatically specify zoo.cfg and hbase-site.xml
properties (like *server.0=myhostname:2888:3888) *when initializing phoenix
connection?


adding hbase-site.xml and zoo.cfg to classpath doesnt help in this case,  it
only works when zoo.cfg is inside the client jar, but we can't use this
option


some notes:

- hbase is running is standalone mode and zk quorum is defined in zoo.cfg
as *server.0=myhostname:2888:3888*

- phoenix client connects without issues for the first tenant, but when
trying to connect additional tenants with their tenant-specific connections
it throws this error

- setting environment variable HBASE_CONF_DIR and copying zoo.cfg there
doesn't help


stacktrace:

org.apache.hadoop.hbase.zookeeper.ZKConfig getZKQuorumServersString ERROR
no valid quorum servers found in zoo.cfg

org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (An error is preventing HBase from connecting to
ZooKeeper)

at
org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)

at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)

at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)

Caused by: org.apache.phoenix.exception.PhoenixIOException: An error is
preventing HBase from connecting to ZooKeeper

...

at
org.apache.phoenix.util.ServerUtil.parseServerException(ServerUtil.java:96)

at
org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:776)

at
org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:986)

at
org.apache.phoenix.query.DelegateConnectionQueryServices.createTable(DelegateConnectionQueryServices.java:110)

at
org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:1448)

at
org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:556)

at
org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:175)

at
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:275)

at
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:266)

at
org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:54)

at
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:265)

at
org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:1045)

at
org.apache.phoenix.query.ConnectionQueryServicesImpl$11.call(ConnectionQueryServicesImpl.java:1339)

at
org.apache.phoenix.query.ConnectionQueryServicesImpl$11.call(ConnectionQueryServicesImpl.java:1308)

at
org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:54)

at
org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:1308)

at
org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:162)

at
org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:126)



Thanks

Alex

Reply via email to