安装phoenix后,启动hbase,过一会HRegionServer直接报错停止服务
2022-02-10 15:59:03,452 ERROR [RS_OPEN_PRIORITY_REGION-regionserver/master:16020-0] coprocessor.CoprocessorHost: The coprocessor org.apache.phoenix.coprocessor.ServerCachingEndpointImpl threw java.lang.ClassCastException: org.apache.phoenix.coprocessor.ServerCachingEndpointImpl cannot be cast to com.google.protobuf.Servicejava.lang.ClassCastException: org.apache.phoenix.coprocessor.ServerCachingEndpointImpl cannot be cast to com.google.protobuf.Service at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.createEnvironment(RegionCoprocessorHost.java:412) at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.createEnvironment(RegionCoprocessorHost.java:95) at org.apache.hadoop.hbase.coprocessor.CoprocessorHost.checkAndLoadInstance(CoprocessorHost.java:281) at org.apache.hadoop.hbase.coprocessor.CoprocessorHost.load(CoprocessorHost.java:247) at org.apache.hadoop.hbase.coprocessor.CoprocessorHost.load(CoprocessorHost.java:198) at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.loadTableCoprocessors(RegionCoprocessorHost.java:387) at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.
详细日志如上,找了三天的问题,原因在于拷贝phoenix的jar包到hbase的lib下太多了,目前找到的很多文章都是说三个jar包全部拷贝,但是三个jar包的protobuf不一致,导致protobuf报错,所以正确做法是只拷贝phoenix下的server包就行
我对应版本的完整包名是
phoenix-hbase-2.4.0-5.1.2-bin/phoenix-server-hbase-2.4.0-5.1.2.ja