当前位置:   article > 正文

phoenix安装以及启动过程中出现的报错_inconsistent namespace mapping properties. ensure

inconsistent namespace mapping properties. ensure that config phoenix.schema

1.官网地址

http://phoenix.apache.org/http://phoenix.apache.org/

2.Phoenix部署

2.1 上传并解压

解压

tar -zxvf apache-phoenix-5.0.0-HBase-2.0-bin.tar.gz -C /opt/install/

修改文件名

mv apache-phoenix-5.0.0-HBase-2.0-bin phoenix-5.0.0

2.2 复制server包并拷贝到各个节点的hbase/lib

 [root@node01 phoenix-5.0.0]# cp phoenix-5.0.0-HBase-2.0-server.jar /opt/install/hbase-2.2.7/lib/

[root@node01 phoenix-5.0.0]# scp phoenix-5.0.0-HBase-2.0-server.jar node02:/opt/install/hbase-2.2.7/lib/

[root@node01 phoenix-5.0.0]# scp phoenix-5.0.0-HBase-2.0-server.jar node03:/opt/install/hbase-2.2.7/lib/

2.3 配置环境变量

#phoenix
export PHOENIX_HOME=/opt/install/phoenix-5.0.0
export PHOENIX_CLASSPATH=$PHOENIX_HOME
export PATH=$PATH:$PHOENIX_HOME/bin

2.4 修改hbase-site.xml 添加如下配置

  1. <!-- 注意:为了开启hbase的namespace和phoenix的schema的映射,在程序中需要加这个配置文件,另外在linux服务上,也需要在hbase以及phoenix的hbase-site.xml配置文件中,加上以上两个配置,并使用xsync进行同步(本节1中文档已有说明)。-->
  2. <property>
  3. <name>phoenix.schema.isNamespaceMappingEnabled</name>
  4. <value>true</value>
  5. </property>
  6. <property>
  7. <name>phoenix.schema.mapSystemTablesToNamespace</name>
  8. <value>true</value>
  9. </property>

2.5 分发hbase-site.xml

[root@node01 conf]# scp hbase-site.xml node02:`pwd`

[root@node01 conf]# scp hbase-site.xml node03:`pwd`

 2.6 替换phoenix/bin 目录下的hbase-site.xml

[root@node01 conf]# cp hbase-site.xml /opt/install/phoenix-5.0.0/bin/

2.7 重启HBase

  1. stop-hbase.sh
  2. start-hbase.sh

2.8 连接Phoenix

[root@node01 phoenix-5.0.0]# bin/sqlline.py 

另一种连接方式

[root@node01 phoenix-5.0.0]# bin/sqlline.py node01,node02,node03:2181

3.连接phoenix过程中遇到的问题:

3.1 如果不替换phoenix/bin下面的hbase-site.xml 报错如下:

phoenix连接hbase报错:Inconsistent namespace mapping properties. Ensure that config phoenix.schema.isName

问题原因:在修改hbase-site.xml文件中的Phoenix的配置时没有同步到Phoenix/bin中的hbase-site.xml文件

解决办法:把修改后的hbase-site.xml文件重新拷贝到Phoenix集群中的bin目录下

3.2 报错:Caused by: java.lang.NoClassDefFoundError: org/apache/htrace/Trace

  1. [root@node01 phoenix-5.0.0]# bin/sqlline.py
  2. Setting property: [incremental, false]
  3. Setting property: [isolation, TRANSACTION_READ_COMMITTED]
  4. issuing: !connect jdbc:phoenix: none none org.apache.phoenix.jdbc.PhoenixDriver
  5. Connecting to jdbc:phoenix:
  6. SLF4J: Class path contains multiple SLF4J bindings.
  7. SLF4J: Found binding in [jar:file:/opt/install/phoenix-5.0.0/phoenix-5.0.0-HBase-2.0-client.jar!/org/slf4j/impl/StaticLoggerBinder.class]
  8. SLF4J: Found binding in [jar:file:/home/install/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
  9. SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
  10. 23/05/16 16:21:49 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
  11. Error: org.apache.phoenix.exception.PhoenixIOException: org.apache.hadoop.hbase.DoNotRetryIOException: java.lang.NoClassDefFoundError: org/apache/htrace/Trace
  12. at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:474)
  13. at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:133)
  14. at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:338)
  15. at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:318)
  16. Caused by: java.lang.NoClassDefFoundError: org/apache/htrace/Trace
  17. at org.apache.phoenix.coprocessor.BaseScannerRegionObserver$RegionScannerHolder.overrideDelegate(BaseScannerRegionObserver.java:222)
  18. at org.apache.phoenix.coprocessor.BaseScannerRegionObserver$RegionScannerHolder.nextRaw(BaseScannerRegionObserver.java:273)
  19. at org.apache.hadoop.hbase.regionserver.RSRpcServices.scan(RSRpcServices.java:3239)
  20. at org.apache.hadoop.hbase.regionserver.RSRpcServices.scan(RSRpcServices.java:3484)
  21. at org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:42278)
  22. at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:418)
  23. ... 3 more (state=08000,code=101)
  24. org.apache.phoenix.exception.PhoenixIOException: org.apache.phoenix.exception.PhoenixIOException: org.apache.hadoop.hbase.DoNotRetryIOException: java.lang.NoClassDefFoundError: org/apache/htrace/Trace
  25. at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:474)
  26. at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:133)
  27. at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:338)
  28. at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:318)
  29. Caused by: java.lang.NoClassDefFoundError: org/apache/htrace/Trace

原因:找不到类

解决办法:查看/opt/install/hbase-2.2.7/lib 下面是否有htrace-core-3.2.0-incubating.jar

如果没有下载htrace-core-3.2.0-incubating.jar 包,将该包放到/opt/install/hbase-2.2.7/lib下面,hbase每一个节点都要放,然后重启hbase

扩展:

查看某个jar包下面有哪些类以及方法

for i in /opt/install/hbase-2.2.7/lib/htrace-core-3.2.0-incubating.jar; do jar -tvf "$i" | grep -Hsi org.apache.htrace.Trace && echo "$i"; done
  1. [root@node01 lib]# for i in /opt/install/hbase-2.2.7/lib/htrace-core-3.2.0-incubating.jar; do jar -tvf "$i" | grep -Hsi org.apache.htrace.Trace && echo "$i"; done
  2. (standard input): 5672 Thu Apr 30 16:55:44 CST 2015 org/apache/htrace/Trace.class
  3. (standard input): 1025 Thu Apr 30 16:55:44 CST 2015 org/apache/htrace/TraceInfo.class
  4. (standard input): 645 Thu Apr 30 16:55:44 CST 2015 org/apache/htrace/Tracer$1.class
  5. (standard input): 590 Thu Apr 30 16:55:44 CST 2015 org/apache/htrace/Tracer$TracerHolder.class
  6. (standard input): 4558 Thu Apr 30 16:55:44 CST 2015 org/apache/htrace/Tracer.class
  7. (standard input): 2287 Thu Apr 30 16:55:44 CST 2015 org/apache/htrace/TraceScope.class
  8. (standard input): 1083 Thu Apr 30 16:55:44 CST 2015 org/apache/htrace/TraceTree$SpansByParent$1.class
  9. (standard input): 2933 Thu Apr 30 16:55:44 CST 2015 org/apache/htrace/TraceTree$SpansByParent.class
  10. (standard input): 1269 Thu Apr 30 16:55:44 CST 2015 org/apache/htrace/TraceTree$SpansByProcessId$1.class
  11. (standard input): 2766 Thu Apr 30 16:55:44 CST 2015 org/apache/htrace/TraceTree$SpansByProcessId.class
  12. (standard input): 2234 Thu Apr 30 16:55:44 CST 2015 org/apache/htrace/TraceTree.class
  13. /opt/install/hbase-2.2.7/lib/htrace-core-3.2.0-incubating.jar

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/462449
推荐阅读
相关标签
  

闽ICP备14008679号