无法使用phoenix在hbase中创建模式

时间:2017-06-19 14:13:15

标签: hbase phoenix

I am using Phoenix verion :4.10.0-HBase-1.2

I am getting below error while creating new schema:  
  

命名空间映射不一致..确保配置       phoenix.schema.isNamespaceMappingEnabled在客户端上是有意义的       服务器

What does mean by ensure on client and server ??  
What changes i need to do ??  

HBase的-site.xml中
    ------------------------
      <property> <name>phoenix.schema.isNamespaceMappingEnabled</name> <value>true</value> </property>

  

Java代码:
      ----------------
      连接连接= setupDbConnection();
      statement statement = connection.createStatement();
      int status = statement.executeUpdate(&#34; CREATE SCHEMA test&#34;);
      connection.commit();

please give me any suggestions..

3 个答案:

答案 0 :(得分:2)

您需要修改setupDbConnection();将属性设置为这样的方法:

Properties properties = new Properties();      
properties.setProperty("phoenix.schema.mapSystemTablesToNamespace", "true");        
properties.setProperty("phoenix.schema.isNamespaceMappingEnabled", "true");
Connection connection = DriverManager.getConnection("jdbc:phoenix:...:/hbase", properties);

答案 1 :(得分:0)

如果即使在将For Each Target In Sheets("Sheet1").Range("A1:A10")设置为phoenix.schema.isNamespaceMappingEnabled之后仍出现问题,请确保在类路径上有hbase conf文件夹。

答案 2 :(得分:-1)

phoenix.schema.isNamespaceMappingEnabled

中将属性consitent设置为hbase-site.xml