sudo apt-get install python-software-install
#Hadoop requires Java 1.6+. It is built and tested on Oracle (nee Sun) Java, which is the only "supported" JVM.
#Go to this page http://www.oracle.com/technetwork/java/javase/downloads/jdk6u38-downloads-1877406.html downloaded jdk-6u38-linux-x64.bin
chmod a+x jdk-6u38-linux-x64.bin
./jdk-6u38-linux-x64.bin
#During installation it will ask you to register - press ENTER.
#JDK 6 package is extracted into ./jdk1.6.0_38 directory, for example ./jdk1.6.0_30.
mv jdk1.6.0_38 java-6-oracle
#if /usr/lib/jvm not exists
sudo mkdir /usr/lib/jvm
sudo mv java-6-oracle /usr/lib/jvm/
#if ssh not installed
sudo apt-get install ssh
sudo apt-get install rsync
java -version
sudo addgroup hadoop
sudo adduser --ingroup hadoop hduser
#Configuring SSH
su - hduser
ssh-keygen -t rsa -P ""
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
ssh localhost
sudo vim /etc/sysctl.conf
# disable ipv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
cd /usr/local
wget http://www.eu.apache.org/dist/hadoop/core/hadoop-1.1.1/hadoop-1.1.1.tar.gz
sudo tar -xzvf hadoop-1.1.1.tar.gz
rm hadoop-1.1.1.tar.gz
sudo mv hadoop-1.1.1 hadoop
sudo chown -R hduser:hadoop /usr/local/hadoop
sudo mkdir -p /app/hadoop/tmp
sudo chown hduser:hadoop /app/hadoop/tmp
sudo chmod 750 /app/hadoop/tmp
vim /home/hduser/.profile
export JAVA_HOME=/usr/lib/jvm/java-6-oracle
# set PATH so it includes JAVA_HOME/bin if it exists
if [ -d "$JAVA_HOME/bin" ] ; then
PATH="$JAVA_HOME/bin:$PATH"
fi
vim /home/hduser/.bashrc
export HADOOP_HOME=/usr/local/hadoop
if [ -d "$HADOOP_HOME/bin" ] ; then
PATH=$PATH:$HADOOP_HOME/bin
fi
vim conf/hadoop-env.sh
export HADOOP_HOME_WARN_SUPPRESS="TRUE"
vim $HADOOP_HOME/conf/core-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>/app/hadoop/tmp</value>
<description>A base for other temporary directories.</description>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://myhost.com:54310</value>
<description>The name of the default file system. A URI whose
scheme and authority determine the FileSystem implementation. The
uri's scheme determines the config property (fs.SCHEME.impl) naming
the FileSystem implementation class. The uri's authority is used to
determine the host, port, etc. for a filesystem.</description>
</property>
</configuration>
vim $HADOOP_HOME/conf/mapred-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>myhost.com:54311</value>
<description>The host and port that the MapReduce job tracker runs
at. If "local", then jobs are run in-process as a single map
and reduce task.
</description>
</property>
</configuration>
vim $HADOOP_HOME/conf/hdfs-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
<description>Default block replication.
The actual number of replications can be specified when the file is created.
The default is used if replication is not specified in create time.
</description>
</property>
</configuration>
$ hadoop namenode -format
$ $HADOOP/bin/start-all.sh
$ jps
pid1 TaskTracker
pid2 JobTracker
pid3 DataNode
pid4 SecondaryNameNode
pid5 Jps
pid6 NameNode
$ $HADOOP/bin/stop-all.sh
Comments
Post a Comment