1. Install Ubuntu system
If you do not use the cloud server, you can use the virtual machine WMware installation, the specific installation steps are not spoken here, Ubuntu system: Http://www.ubuntu.com/download/desktop
2. Modify the source list (non-essential steps)
Ubuntu source list By default is the European server, download JDK and other open source tools is slow, we recommend that you modify the following:
Back up the source list and modify the file:
sudo CP /etc/apt/sources.list/etc/apt//etc/apt/sources.list
In the open graphical interface, delete all the original content and paste the following:
Deb http://Mirrors.aliyun.com/ubuntu/vivid main restricted universe multiverseDeb http://mirrors.aliyun.com/ubuntu/vivid-security main restricted universe multiverseDeb http://mirrors.aliyun.com/ubuntu/vivid-updates main restricted universe multiverseDeb http://mirrors.aliyun.com/ubuntu/vivid-proposed main restricted universe multiverseDeb http://mirrors.aliyun.com/ubuntu/vivid-backports main restricted universe multiverseDEB-SRC http://Mirrors.aliyun.com/ubuntu/vivid main restricted universe multiverseDEB-SRC http://mirrors.aliyun.com/ubuntu/vivid-security main restricted universe multiverseDEB-SRC http://mirrors.aliyun.com/ubuntu/vivid-updates main restricted universe multiverseDEB-SRC http://mirrors.aliyun.com/ubuntu/vivid-proposed main restricted universe multiverseDEB-SRC http://mirrors.aliyun.com/ubuntu/vivid-backports main restricted universe multiverse
Here the main use of the source of Ali, other sources can be consulted: http://wiki.ubuntu.org.cn/%E6%BA%90%E5%88%97%E8%A1%A8
3. Installing the JDK
It is recommended that you use root permissions to switch root permissions before installing the command: sudo-i
Install the JDK via the following command:
Install openjdk-7-jdk
After installation, you also need to modify the environment variables, edit the/etc/profile file, use Gedit/etc/profile, add the following environment variable in the file (Java_home need to modify according to the actual situation):
Export java_home=/usr/lib/jvm/java-7-openjdk-i386export jre_home= $JAVA _home/jreexport PATH = $JAVA _home/bin: $HADOOP _home/Bin: $PATHexport CLASSPATH= $JAVA _home/lib: $CLASSPATH
Don't forget to use the source command to make the changes take effect:
Source/etc/profile
4, Installation Hadoop-1.2.1
To access the OPT directory, download Hadoop using the wget command:
wget http://mirrors.aliyun.com/apache/hadoop/core/hadoop-1.2.1/hadoop-1.2.1.tar.gz
After the download is complete, unzip:
tar zxvf hadoop-1.2. 1. tar. gz
5. Modify the Hadoop configuration
Go to the opt/hadoop/conf directory and modify the four configuration files:
hadoop-env.sh (Modify Java_home as the actual installation directory):
Export java_home=/usr/lib/jvm/java-7-openjdk-i386
Core-site.xml (Ubantu is the native hostname and can be learned using the hostname command):
<Configuration> < Property> <name>Fs.default.name</name> <value>hdfs://ubuntu:9000</value> </ Property> < Property> <name>Hadoop.tmp.dir</name> <value>/hadoop</value> </ Property> < Property> <name>Dfs.name.dir</name> <value>/hadoop/name</value> </ Property> </Configuration>
Hdfs-site.xml:
<Configuration> < Property> <name>Dfs.data.dir</name> <value>/hadoop/data</value> </ Property> </Configuration>
Mapred-site.xml (Ubantu is the native hostname and can be learned using the hostname command):
<Configuration> < Property> <name>Mapred.job.tracker</name> <value>ubuntu:9001</value> </ Property> </Configuration>
6. Installing the SSH service (not necessary steps)
For cases where the SSH service is not installed, you can use Ps-e|grep ssh to see if the SSH service is already installed:
Install ssh-server using the following command:
Install Openssh-server
To start the SSH service:
ssh start
Modify SSH for password login:
Type "sudo gedit/etc/ssh/sshd_config"--enter "Permitrootlogin Without-password" in the configuration file with a "#" number and comment it out. Add a "Permitrootlogin yes"--save, modify successfully.
7. Start and verify
To format Namenode, enter the Hadoop-1.2.1/bin directory and type the following command:
Hadoop Namenode-format
Start Hadoop:
Start-all. SH
You may be asked to enter the root password, and if the prompt fails to verify, use the passwd command to reset the root password
Finally, the Java process is viewed through the JPS command, and the following process shows success:
3869 DataNode 4302 Tasktracker 4048 Secondarynamenode 4132 Jobtracker 5075 Jps 3601 NameNode
Hadoo-1.2.1 Installation Steps Summary (Ubuntu)