I use two computers for the configuration of the cluster, if it is a single machine, there may be some problems. First, set the hostname root permissions on the two computer to open the/etc/host file
Set Hostname,root permissions again to open/etc/hostname file settings
From the machine set to Slaver.hadoop
1. Install the Java JDK and configure the environment
CentOS comes with a JDK installed, and if we want to install the JDK ourselves and configure the environment, first uninstall the original JDK
In command-line mode, enter command: Yum remove Java (root user, non-root user, please add sudo before the command).
Next install the JDK and configure the environment, download the JDK rpm package online, using the command: RPM-IVH JDK-......;
To configure the JDK environment:
The root user opens the/etc/profile file at the end of the file by adding a JDK path similar to the following configuration, just pay attention to the JDK version
The above section is a Java environment variable, followed by a Hadoop variable, and so on.
2. Install Hadoop and configure the environment.
Download the hadoop-2.6.0 version to the Apache website.
Extract files: tar-xvf hadoop-2.6.0.tar.gz (Unzip to the path you need to install, or set the path again)
Go to the extracted directory and find the following configuration files under the hadoop-2.6.0/etc/hadoop/path
Core.site.xml:
Hdfs-site.xml
Mapred-site.xml.template
hadoop-env.sh
Slaves
192.168.1.126 slave IP
To complete this configuration, start the tutorial on the reference web.
/hadoop-2.6.0/bin/hadoop Namenode-format
/hadoop-2.6.0/sbin/start-all.sh
Complete.
Note: You need to shut down the firewall of two computers before starting: sudo systemctl stop Iptables.service
3. Installing the configuration Hadoop Eclipse plug-in
Download the Hadoop Eclipse plugin and put it in the plugins folder in the Eclipse folder to start Eclipse.
Eclipse Window->open persperctive->other->
Open Map/reduce and Resource respectively. Then create a new M/R project in Eclipse, find Wordcount.java source code execution,
Set parameters for run as configuertion in Eclipse:
Project directory in eclipse:
Execution Result:
CentOS 7 Hadoop installation Configuration