java 远程连接hbase遇到问题,网上都是改本地host文件,有没有一种不需要改本地配置就可以连接到hbase然后可以用Admin的api方法,?

Configuration configuration = HBaseConfiguration.create();
configuration.set("hbase.rootdir", "hdfs://远程hbaseIP:9820/hbase");
configuration.set("hbase.zookeeper.quorum", "远程hbaseIP");

configuration.set("hbase.zookeeper.property.clientPort", "2181");
Connection conn = ConnectionFactory.createConnection(configuration);
Admin admin = conn.getAdmin();
NamespaceDescriptor.Builder builder = NamespaceDescriptor.create("SpaceName");

            报错信息
     WARN  [org.apache.hadoop.util.Shell] - Did not find winutils.exe: java.io.FileNotFoundException: java.io.FileNotFoundException: HADOOP_HOME and hadoop.home.dir are unset. -see https://wiki.apache.org/hadoop/WindowsProblems

WARN [org.apache.hadoop.util.NativeCodeLoader] - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.security.HadoopKerberosName.setRuleMechanism(Ljava/lang/String;)V

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问