Running MapReduce code that uses zooKeeper

I want to ask about how to execute a MapReduce java code that uses zooKeeper.

My first code is just to create a variable (znode) and to modify it by each mapper. So I modified the wordCount code just to test zookeeper for the first time. When I run it using the eclipse console, everything goes well, so I can see the changes on the value of the znode, etc.

However, I was trying to execute it using linux command line:

**bin/hadoop jar ./myjar.jar algo.WordCount /input.txt /out

I got the following error

**Error: java.lang.ClassNotFoundException: org.apache.zookeeper.Watcher

Although that I added the path of the jar file using conf.set("mapred.jar","...."); in the mapreduce code but I don't know why it did not recognize the classes of zookeeper.

Any idea?


Check this blog from Cloudera on how to include 3rd party libraries in MR jobs.

Need Your Help

Use backup function vim to make a copy on write

vim backup

I am using set backup in my .vimrc to automatically backup files on every write. This backs up the original (old) file however, not the newly written file. Is there an elegant, preferably built-in ...