top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Hadoop: JAVA_HOME not set though the workstation has working java

+2 votes
318 views

I have a working version of java 7 installed. I can execute java programs in the workstation. When I start hdfs, the statup process aborts with a message JAVA_HOME not set.

OS : Ubuntu 13.04 raring ringtail
Hadoop version : 2.1.1-beta
Java version:java-7-openjdk-amd64

posted Jan 10, 2014 by Tarun Singhal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

You'll need to set JAVA_HOME under the $HADOOP_CONF_DIR/hadoop-env.sh explicitly. This variable is not a system global one.

answer Jan 10, 2014 by anonymous
Similar Questions
+1 vote

I want to know the installation and configuration of Apache Hadoop and Programming Paradigm for working on it..

0 votes

Is there a Java API for getting yarn.scheduler.capacity.maximum-am-resource-percent for a particular queue?

Unfortunately, QueueInfo doesnt seem to contain this info, so something like this wouldnt work:

Configuration conf = new Configuration(...);
Cluster cluster = new Cluster(conf);
QueueInfo queueInfo = cluster.getQueue("default");
Properties p = queueInfo.getProperties(); // This is empty! :(
+2 votes

Did any one got these error before, please help

ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: xxxxx.com:50010:DataXceiver error processing WRITE_BLOCK operation  src: /xxxxxxxx:39000 dst: /xxxxxx:50010

java.lang.NullPointerException
at org.apache.hadoop.hdfs.server.datanode.BlockReceiver.(BlockReceiver.java:167)
at org.apache.hadoop.hdfs.server.datanode.DataXceiver.writeBlock(DataXceiver.java:604)
at org.apache.hadoop.hdfs.protocol.datatransfer.Receiver.opWriteBlock(Receiver.java:126)
at org.apache.hadoop.hdfs.protocol.datatransfer.Receiver.processOp(Receiver.java:72)
at org.apache.hadoop.hdfs.server.datanode.DataXceiver.run(DataXceiver.java:225)
at java.lang.Thread.run(Thread.java:745)
2015-01-11 04:13:21,846 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: IOException in offerService
WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Slow BlockReceiver write packet to mirror took 657ms (threshold=300ms)
0 votes

I can't find any information on how possible or difficult it is to install Hadoop as a single node on Windows 8 running Oracle Java 8. The tutorial on Hadoop 2 on Windows mentions neither Windows 8 nor Java 8.

Is there anything known about this?

+2 votes
public class MaxMinReducer extends Reducer {
int max_sum=0; 
int mean=0;
int count=0;
Text max_occured_key=new Text();
Text mean_key=new Text("Mean : ");
Text count_key=new Text("Count : ");
int min_sum=Integer.MAX_VALUE; 
Text min_occured_key=new Text();

 public void reduce(Text key, Iterable<IntWritable> values, Context context) throws IOException, InterruptedException {
       int sum = 0;           

       for (IntWritable value : values) {
             sum += value.get();
             count++;
       }

       if(sum < min_sum)
          {
              min_sum= sum;
              min_occured_key.set(key);        
          }     


       if(sum > max_sum) {
           max_sum = sum;
           max_occured_key.set(key);
       }          

       mean=max_sum+min_sum/count;
  }

 @Override
 protected void cleanup(Context context) throws IOException, InterruptedException {
       context.write(max_occured_key, new IntWritable(max_sum));   
       context.write(min_occured_key, new IntWritable(min_sum));   
       context.write(mean_key , new IntWritable(mean));   
       context.write(count_key , new IntWritable(count));   
 }
}

Here I am writing minimum,maximum and mean of wordcount.

My input file :

high low medium high low high low large small medium

Actual output is :

high - 3------maximum

low - 3--------maximum

large - 1------minimum

small - 1------minimum

but i am not getting above output ...can anyone please help me?

...