Java – What is the difference between using hadoop and java commands to execute a map-reduce job

What is the difference between using hadoop and java commands to execute a map-reduce job… here is a solution to the problem.

What is the difference between using hadoop and java commands to execute a map-reduce job

Find many options for running the map-reduce program. Can anyone explain the difference between the following commands. and the impact on the Map-Reduce job, if any.

     java -jar MyMapReduce.jar [args] 

hadoop jar MyMapReduce.jar [args] 

yarn jar MyMapReduce.jar [args] 

Of these commands, which one is the best?

Is it possible to use the Web service port 8088 (YARN) in the following command to enable the Web service to display all information about the job using Yarn and Job History (such as the Show Hadoop and yarn commands)?

     java -jar MyMapReduce.jar [args] 

Solution

None of them are better than the other. When you execute the java -jar command, it is like executing a non-Hadoop application. If you use a hadoop jar or yarn jar, it will use the /usr/bin/hadoop and /usr/bin/yarn scripts to set up the environment.

Unless you modify any scripts to set extra variables, all three scripts should work the same.

Related Problems and Solutions