문제

Im having trouble getting my hadoop jobs to run. Im getting the following exception:

java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.cassandra.hadoop.cql3.CqlOutputFormat at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:857) at org.apache.hadoop.mapreduce.JobContext.getOutputFormatClass(JobContext.java:235) at org.apache.hadoop.mapred.Task.initialize(Task.java:513) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:347) at org.apache.hadoop.mapred.Child$4.run(Child.java:255) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190) at org.apache.hadoop.mapred.Child.main(Child.java:249) Caused by: java.lang.ClassNotFoundException: org.apache.cassandra.hadoop.cql3.CqlOutputFormat at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:270) at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:810) at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:855) ... 8 more

I definitely have the cassandra jars in $HADOOP_CLASSPATH and they are being found (I know this because if I move them out of the classpath then I get a NoClassDefFoundError exception instead).

Environment is: Ubuntu 12.10, Hadoop 1.2.1, Cassandra 1.2.13

도움이 되었습니까?

해결책 2

So it turned out to be as simple as not restarting all the hadoop deamons after changing the classpath. Doh!

다른 팁

You will have to add the jars to DistributedCache so that they are available to the mapper at run time.

                DistributedCache.addArchiveToClassPath(new Path(path.toUri()
                    .getPath()), job);

Any custom jars which are not a part of the hadoop distribution have to be added this way if they are not included in the hadoop classpath of every node.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top