项目场景:
提示:hbase连接集群时,应对集群信息不固定的情况,即不依赖读取配置文件添加配置
问题描述:
提示:
原因分析:
提示:
解决方案:
跟换hbase 依赖版本,可以查询“hadoop和hbase兼容版本,以及2.0以上版本和1.0及以下版本连接集群时,获取配置信息的方式。
<hadoop.version>2.6.0-cdh5.5.4</hadoop.version>
<hive.version>1.1.0-cdh5.5.4</hive.version>
<hbase.version>2.2.0</hbase.version>
以及需要”读取配置文件的依赖“(虽然可以自主添加配置信息但这个不可缺)
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.6</version>
</dependency>