You can specify the zookeeper quorum in the connection string as
described here: https://phoenix.apache.org/#SQL_Support. All of the
hosts are expected to use the same port (which may be specified as
well).

On Tue, Jun 23, 2015 at 1:05 PM, Alex Kamil <[email protected]> wrote:
> it's running in standalone mode with hbase managing zk, I can connect to
> hbase , I can also connect with phoenix jdbc client (single tenant
> connection).
> When I try using multitenant connection I'm able to connect with the first
> tenant and write to hbase via phoenix jdbc connection,
> the second attempt to connect (with a different tenant) throws an exception:
> (no valid quorum servers found in zoo.cfg)
>
> On Tue, Jun 23, 2015 at 3:14 PM, Nick Dimiduk <[email protected]> wrote:
>>
>> If HBase is running in standalone mode, it's running an embedded ZK and
>> there's no need for zoo.cfg. You can connect to hbase? If so, the master
>> status UI or the hbase shell can tell you the ZK connection details.
>>
>> On Tue, Jun 23, 2015 at 12:01 PM, Alex Kamil <[email protected]> wrote:
>>>
>>>
>>> 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