Manual de Instalación y Configuración Hadoop
Manual de Instalación y Configuración Hadoop
Manual de Instalación y Configuración Hadoop
configuración Hadoop
2019
Contenido
Nota Inicial
Instalación de Java
Creación de usuario y grupo Hadoop
Configuración del Hostname
Instalación de SSH
Creación de certificado SSH
Instalación de Hadoop
Configuración de Archivos
1. ~/.bashrc:
2. /usr/local/hadoop/etc/hadoop/hadoop-env.sh
3. /usr/local/hadoop/etc/hadoop/core-site.xml:
4. /usr/local/hadoop/etc/hadoop/mapred-site.xml
5. /usr/local/hadoop/etc/hadoop/hdfs-site.xml
Formatear el nuevo sistema de archivos
Iniciar Servicios Hadoop
Parar Servicios Hadoop
Nota Inicial
Instalación de Java
k@laptop:~$ cd ~
hduser@laptop:~/hadoop-2.6.0$ su -
Password:
192.168.1.16 hadoop-slave-1
192.168.1.17 hadoop-slave-2
Instalación de SSH
$ssh hadoop-slave-1
Instalación de Hadoop
hduser@laptop:~$ wget
http://apache.uniminuto.edu/hadoop/common/hadoop-3.1.0/hadoop-3.1
.0.tar.gz
hduser@laptop:~$ tar xvzf hadoop-2.8.3.tar.gz
Configuración de Archivos
1. ~/.profile:
Se debe tener en cuenta la ruta de JAVA_HOME:
hduser@laptop update-alternatives --config java
There is only one alternative in link group java (providing
/usr/bin/java): /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
Nothing to configure.
export HADOOP_HOME=/usr/local/hadoop
export PATH=$PATH:$HADOOP_INSTALL/bin
export PATH=$PATH:$HADOOP_INSTALL/sbin
export HADOOP_MAPRED_HOME=$HADOOP_INSTALL
export HADOOP_COMMON_HOME=$HADOOP_INSTALL
export HADOOP_HDFS_HOME=$HADOOP_INSTALL
export YARN_HOME=$HADOOP_INSTALL
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_INSTALL/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_INSTALL/lib"
#HADOOP VARIABLES END
hduser@laptop:~$ source ~/.profile
2. /usr/local/hadoop/etc/hadoop/hadoop-env.sh
hduser@laptop:~$ nano /usr/local/hadoop/etc/hadoop/hadoop-env.sh
Editar la ruta del JAVA_HOME dentro del archivo
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
3. /usr/local/hadoop/etc/hadoop/core-site.xml:
hduser@laptop:~$ sudo mkdir -p /app/hadoop/tmp
hduser@laptop:~$ sudo chown -R hduser:hadoop /app
<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>/app/hadoop/tmp</value>
<description>A base for other temporary
directories.</description>
</property>
<property>
<name>fs.defaultFS</name>
<value>hdfs://hadoop-master:8020</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>
4. /usr/local/hadoop/etc/hadoop/mapred-site.xml
hduser@laptop:~$ sudo mkdir -p /app/hadoop/mapred/system
hduser@laptop:~$ sudo mkdir -p /app/hadoop/mapred/local
hduser@laptop:~$ cp /usr/local/hadoop/etc/hadoop/mapred-site.xml.template
/usr/local/hadoop/etc/hadoop/mapred-site.xml
<property>
<name>mapred.system.dir</name>
<value>/app/hadoop/mapred/system</value>
</property>
<property>
<name>mapred.local.dir</name>
<value>/app/hadoop/mapred/local</value>
</property>
</configuration>
5. /usr/local/hadoop/etc/hadoop/hdfs-site.xml
<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>
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/app/hadoop/hdfs/namenode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/app/hadoop/hdfs/datanode</value>
</property>
<property>
<name>dfs.permissions</name>
<value>false</value>
</property>
</configuration>
6. /usr/local/hadoop/etc/hadoop/masters
Crear un archivo llamado masters con el hostname del nodo
maestro.
hduser@hadoop-master
hduser@hadoop-slave-1
hduser@hadoop-slave-2
7. /usr/local/hadoop/etc/hadoop/yarn-site.xml
hduser@laptop:~$ nano /usr/local/hadoop/etc/hadoop/yarn-site.xml
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.aux-services.mapreduce_shuffle.class</name
>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
<property>
<name>yarn.resourcemanager.hostname</name>
<value>master</value>
</property>
</configuration>
hduser@laptop:~$ cd /usr/local/hadoop/sbin
hduser@laptop:/usr/local/hadoop/sbin$ start-dfs.sh
hduser@laptop:/usr/local/hadoop/sbin$ start-yarn.sh
hduser@laptop:/usr/local/hadoop/sbin$ stop-yarn.sh