记一次--------phoenix创建表映射到hbase报错

报错信息片段如下
java.lang.RuntimeException: java.sql.SQLException: ERROR 726 (43M10):  Inconsistent namespace mapping properties. Ensure that config phoenix.schema.isNamespaceMappingEnabled is consistent on client and server.
        at org.apache.calcite.avatica.jdbc.JdbcMeta.openConnection(JdbcMeta.java:621)
        at org.apache.calcite.avatica.remote.LocalService.apply(LocalService.java:285)
        at org.apache.calcite.avatica.remote.Service$OpenConnectionRequest.accept(Service.java:1771)
        at org.apache.calcite.avatica.remote.Service$OpenConnectionRequest.accept(Service.java:1751)
        at org.apache.calcite.avatica.remote.AbstractHandler.apply(AbstractHandler.java:94)
        at org.apache.calcite.avatica.remote.ProtobufHandler.apply(ProtobufHandler.java:46)
        at org.apache.calcite.avatica.server.AvaticaProtobufHandler.handle(AvaticaProtobufHandler.java:127)
        at org.apache.phoenix.shaded.org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
        at org.apache.phoenix.shaded.org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        at org.apache.phoenix.shaded.org.eclipse.jetty.server.Server.handle(Server.java:499)

 

 
 
直接在hbase-site.xml添加配置
注意:需要在客户端和服务端的文件中 分别添加
<property><name>phoenix.schema.isNamespaceMappingEnabled</name><value>true</value></property>
<name>phoenix.schema.mapSystemTablesToNamespace</name><value>true</value></property>

 

 
如果是CDH版本,在cm页面HBASE组件--  配置--搜索hbase-site.xml
 
 
分别进行配置,然后重启集群。一切正常。。。。。
 
创建schema语句:
CREATE SCHEMA IF NOT EXISTS "EVM";

 

 
创建phoenix表语句(以vin为rowkey)
create table "EVM"."VEHICLE_INFO"(
"vin" varchar primary key ,
"MM"."vin" varchar ,
"MM"."s_veh" integer,
"MM"."bat_s" integer,
"MM"."lng" float,
"MM"."lat" float,
"MM"."a_caf" integer
);
 

 

 
插入phoenix语句
upsert into EVM.TEST_VEHICLE_INFO("vin","s_veh","bat_s","lng","lat","a_caf") VALUES("111",2,3,4.0,5.0,6) 

 

posted @ 2020-06-07 02:17  二黑诶  阅读(917)  评论(0编辑  收藏  举报