Phoenix链接异常,报错如下
0: jdbc:phoenix:xxx:2181:/hbase> Error: ERROR 726 (43M10): Inconsistent namespace mapping properties. Ensure that config phoenix.schema.isNamespaceMappingEnabled is consistent on client and server. (state=43M10,code=726)
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.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:494)at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:150)at org.apache.phoenix.query.ConnectionQueryServicesImpl.checkClientServerCompatibility(ConnectionQueryServicesImpl.java:1305)at org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:1154)at org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1491)at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:2717)at org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:1114)at org.apache.phoenix.compile.CreateTableCompiler$1.execute(CreateTableCompiler.java:192)at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:408)at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:391)at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:389)at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:378)at org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:1806)at org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:2528)at org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:2491)at org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:76)at org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:2491)at org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:255)at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.createConnection(PhoenixEmbeddedDriver.java:150)at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:221)at sqlline.DatabaseConnection.connect(DatabaseConnection.java:157)at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:203)at sqlline.Commands.close(Commands.java:906)at sqlline.Commands.closeall(Commands.java:880)at sqlline.SqlLine.begin(SqlLine.java:714)at sqlline.SqlLine.start(SqlLine.java:398)at sqlline.SqlLine.main(SqlLine.java:291)
从异常提示来看,提示客户端与服务端配置要相同,Ensure that config phoenix.schema.isNamespaceMappingEnabled is consistent on client and server,
我们查看CDH中配置说明,提示应用所有服务角色配置,客户端配置除外,猜测客户端未加入该段代码
客户端也部署
在管理页面中部署hbase客户端配置
可以看到他在 /etc/hbase/conf目录下
在 hbase-site.xml 中添加服务端的配置
<property><name>phoenix.schema.isNamespaceMappingEnabled</name><value>true</value></property>
<property><name>phoenix.schema.mapSystemTablesToNamespace</name><value>true</value></property>
保存退出,重新连接,并查看表,成功