Compiling and Configuring Hadoop
This section describes how to compile and deploy Hadoop and configure environment variables to ensure that Hadoop can run properly.
- Compile the Hadoop software deployment package hadoop-3.1.1.tar.gz by following the instructions in Hadoop Porting Guide (CentOS & openEuler).
- Place hadoop-3.1.1.tar.gz in the /usr/local directory on server1 and decompress it.
1 2 3
mv hadoop-3.1.1.tar.gz /usr/local cd /usr/local tar -zxvf hadoop-3.1.1.tar.gz
- Create a soft link for later version replacement.
1ln -s hadoop-3.1.1 hadoop
- Setting the Hadoop environment variables.
- Open the /etc/profile file.
1vi /etc/profile - Press i to enter the insert mode and add environment variables at the end of the file.
1 2
export HADOOP_HOME=/usr/local/hadoop export PATH=$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Make the environment variables take effect.
1source /etc/profile
- Open the /etc/profile file.
Parent topic: Deploying Hadoop