To install Hadoop, follow these steps:
Prerequisites:
- Ensure you have Java installed (Java 8 or later).
- Set the
JAVA_HOMEenvironment variable.
Download Hadoop:
wget https://downloads.apache.org/hadoop/common/hadoop-x.y.z/hadoop-x.y.z.tar.gzReplace
x.y.zwith the desired version number.Extract the downloaded file:
tar -xzvf hadoop-x.y.z.tar.gzMove to the desired directory:
mv hadoop-x.y.z /usr/local/hadoopSet environment variables: Add the following lines to your
.bashrcor.bash_profile:export HADOOP_HOME=/usr/local/hadoop export PATH=$PATH:$HADOOP_HOME/bin export JAVA_HOME=/path/to/javaSource the profile:
source ~/.bashrcConfigure Hadoop: Edit the configuration files in the
$HADOOP_HOME/etc/hadoopdirectory:core-site.xmlhdfs-site.xmlmapred-site.xmlyarn-site.xml
Format the NameNode:
hdfs namenode -formatStart Hadoop:
start-dfs.sh start-yarn.shVerify Installation: Check if Hadoop is running:
jps
This should show the Hadoop daemons running, such as NameNode, DataNode, ResourceManager, and NodeManager.
