当前位置: 首页 > 知识库问答 >
问题:

无法通过凤凰连接到hbase

蒋权
2023-03-14
    <property>
<name>hbase.master</name>
<value>23.201.00.100:60000</value>
<description>The host and port the HBase master runs at. 
</description>
</property>
<property>
  <name>hbase.zookeeper.property.clientPort</name>
  <value>2222</value>
  <description>Property from ZooKeeper's config zoo.cfg.
  The port at which the clients will connect.
  </description>
</property>
<property>
  <name>hbase.zookeeper.quorum</name>
         <value>rs1.example.com,rs2.example.com,rs3.example.com,rs4.example.com,rs5.example.com</value>
  <description>Comma separated list of servers in the ZooKeeper Quorum.
  For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".
  By default this is set to localhost for local and pseudo-distributed modes
  of operation. For a fully-distributed setup, this should be set to a full
  list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in hbase-env.sh
  this is the list of servers which we will start/stop ZooKeeper on.
  </description>
</property>
<property>
  <name>hbase.zookeeper.property.dataDir</name>
  <value>/usr/local/zookeeper</value>
  <description>Property from ZooKeeper's config zoo.cfg.
  The directory where the snapshot is stored.
  </description>
</property>
 Connection conn;
    Properties prop = new Properties();
      try{
        Class.forName("com.salesforce.phoenix.jdbc.PhoenixDriver");
        conn =  DriverManager.getConnection("jdbc:phoenix:rs1.example.com,rs2.example.com,rs3.example.com,rs4.example.com,rs5.example.com:2222:hdfs://localhost:8020/hbase");
        System.out.println(conn);
    java.sql.SQLException: ERROR 102 (08001): Malformed connection url. jdbc:phoenix:rs1.example.com,rs2.example.com,rs3.example.com,rs4.example.com,rs5.example.com:2222:hdfs://localhost:8020/hbase
    at com.salesforce.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:146)
    at com.salesforce.phoenix.jdbc.PhoenixEmbeddedDriver$ConnectionInfo.create(PhoenixEmbeddedDriver.java:206)
    at com.salesforce.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:78)
    at  com.salesforce.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:115)
    at java.sql.DriverManager.getConnection(DriverManager.java:571)
    at java.sql.DriverManager.getConnection(DriverManager.java:233)
    at hbase.phoenix.HbasePhoenix.main(HbasePhoenix.java:30)
BUILD SUCCESSFUL (total time: 2 seconds)

请指引我。

共有1个答案

邹山
2023-03-14

检查此链接是否有帮助。

正如Phoenix项目中提到的,jdbc连接url应该如下所示:jdbc:Phoenix:Zookeeper1:port,Zookeeper2:port

默认情况下,zookeeper在端口2181监听。

 类似资料:
  • 一些基本信息如下: Hadoop2.7.1和NameNode HA enable hbase0.98.12 phoenix-4.6.0-hbase-0.98 执行sqlline.py localhost is error 执行sqlline.py localhost:nameservices/hbase is error

  • 插件更新到Spark2.0了吗?我不能使用插件 错误: 只要jdbc连接凤凰就可以了!

  • 问题内容: 我已经在服务器上安装了Kibana 5.4和Elastic search 5.4,我可以通过使用本地计算机上的curl来访问Kibana和Elastic search 我得到以下回应 var hashRoute =’/ app / kibana’; var defaultRoute =’/ app / kibana’; var hash = window.location.hash;

  • 我已经在服务器上安装了Kibana 5.4和Elastic search 5.4,我可以使用 我得到以下回应 var hashRoute='/app/kibana'; var defaultRoute='/app/kibana'; var hash=window.location.hash; if(hash.length){window.location=hashRoute hash;}其他{wi

  • 问题内容: 我最近安装了Elasticsearch,并且在开始的几天里一切正常,但是今天以某种方式停止了工作 当我启动该服务时,它声称很好… 但后来我明白了 查看elasticsearch日志: 看起来有关于Java VM的警告;那可能是问题吗?我还应该尝试/看看什么? 问题答案: 1) 使用linux中的命令 检查端口9200的状态 。 就我而言,以下是启动时的结果。 对我不是服务,否则找到正在

  • 这几天来,我无法在本地运行mac os ML的机器上连接到我的postgreSQL数据库。 我机器的nmap显示postgres在5432上运行,我可以通过pgadmin和psql进行本地连接。 收听地址设置为* 当我尝试连接JDBC时,我会遇到以下异常 组织。postgresql。util。PSQLException:连接被拒绝。检查主机名和端口是否正确,邮政局长是否接受TCP/IP连接。