bin/yarn jar lib/hbase-server-1.3.1.jar rowcounter stu
结果直接报错 Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/filter/Filter at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.privateGetMethodRecursive(Class.java:3048) at java.lang.Class.getMethod0(Class.java:3018) at java.lang.Class.getMethod(Class.java:1784) at org.apache.hadoop.util.ProgramDriverKaTeX parse error: Expected 'EOF', got '#' at position 970: …node01 servers]#? yarn jar /expo…ProgramDescription.(ProgramDriver.java:59) at org.apache.hadoop.util.ProgramDriver.addClass(ProgramDriver.java:103) at org.apache.hadoop.hbase.mapreduce.Driver.main(Driver.java:42) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.hadoop.util.RunJar.run(RunJar.java:221) at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
解决办法 [atguigu@hadoop102 ~]$ cd /opt/module/hadoop-3.1.3/etc/hadoop/ [atguigu@hadoop102 hadoop]$ vi hadoop-env.sh
添加配置
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/opt/module/hbase/lib/*
完了重启Hadoop集群和HBase
|