Solve CentOS Warning: $ HADOOP_HOME is deprecated
A warning message is reported when Hadoop is started. The Hadoop version I installed is hadoop1.0.4. The warning information is as follows:
[Plain] view plaincopy
- [Root@localhosthadoop-1.0.4] #./bin/start-all.sh
- Warning: $ HADOOP_HOMEisdeprecated.
The online statement is because Hadoop itself made a judgment on HADOOP_HOME, specifically in bin/hadoop and bin/hadoop-config.sh. There are the following configurations in the hadoop-config.sh:
[Plain] view plaincopy
- If ["$ HADOOP_HOME_WARN_SUPPRESS" = "] & [" $ HADOOP_HOME "! = ""]; Then
- Echo "Warning: \ $ HADOOP_HOMEisdeprecated." 1> & 2
- Echo1> & 2
- Fi
The solution to this warning is as follows:
1. comment out the if fi configuration given above in the hadoop-config.sh (not recommended)
2. Add an environment variable in/etc/profile:
Export HADOOP_HOME_WARN_SUPPRESS = 1
Note: After modifying the profile, you need to perform the source operation to make it take effect.
[Plain] view plaincopy
- Source/etc/profile
Note: Modify the/home/. bashrc file in ubuntu and add an export HADOOP_HOME_WARN_SUPPRESS = 1
After the execution, we can check whether the configuration is successful, re-execute the start-all.sh script:
[Plain] view plaincopy
- [Root@localhosthadoop-1.0.4] #./bin/start-all.sh
- Startingnamenode, loggingto/root/hadoop-1.0.4/libexec/../logs/hadoop-root-namenode-localhost.out
- Localhost: startingdatanode, loggingto/root/hadoop-1.0.4/libexec/../logs/hadoop-root-datanode-localhost.out
- Localhost: startingsecondarynamenode, loggingto/root/hadoop-1.0.4/libexec/../logs/hadoop-root-secondarynamenode-localhost.out
- Startingjobtracker, loggingto/root/hadoop-1.0.4/libexec/../logs/hadoop-root-jobtracker-localhost.out
- Localhost: startingtasktracker, loggingto/root/hadoop-1.0.4/libexec/../logs/hadoop-root-tasktracker-localhost.out
There is no Warning: $ HADOOP_HOME is deprecated, indicating that the problem has been resolved.