Some Hadoop and Hive Gotchas and Developer Tips
Join the DZone community and get the full member experience.Join For Free
this is my log on several mistakes (some pretty dumb on the hindsight ) that i did while getting started with hadoop and hive some time back, along with some tricks on debugging hadoop and hive. i am using hadoop 0.20.203 and hive 0.8.1.
localhost: error: java_home is not set
this almost undecipherable and cryptic error message during hadoop startup (namenode/jobtracker etc.) says hadoop cannot find the java installation. wait!! i have already set java_home enviornment variable?? seems it’s not enough. so where else to set it? turns out that you have to set java_home in hadoop-env.sh present in conf folder to get the elephant moving.
name node mysteriously fails to start
when you start the namenode things seems fine except for the fact that the server is not up and running. and of course i hadn’t formatted the hdfs on the namenode. so why should it work right? so there goes. format the darn namenode before doing anything distributed with hadoop.
bin/hadoop namenode -format
java.io.ioexception call to localhost/127.0.0.1:9000 failed on local exception: java.io.eofexception
this one was bit tricky. after fiddling and struggling for some time found out that hadoop dependency version used in the jobclient in order to communicate with jobtracker is different from the version that’s present inside the running hadoop instance. hadoop uses a homegrown rpc mechanism to communicate with job tracker and name nodes. and it seems certain different hadoop versions have incompatibilities in this interface.
now it’s time for some debugging tips.
debugging hadoop local (standalone) mode
add debugging options for jvm as follows in conf/hadoop-env.sh.
debugging hive server
start hive with following command line to remote debug hive.
./hive --service hiveserver --debug[port=[debug_port],mainsuspend=y,childsuspend=y]
Published at DZone with permission of Buddhika Chamith, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.