Despliegue Apache Hadoop sobre Debian

Despliegue de Apache hadoop sobre Debian con un nodo único.

Esta guía particulariza la instalación sobre un servidor Debian, actualizando las rutas y valores que en la guía original de Hadoop, es necesario cambiar para que funcione.

Instalación de paquetes previos

 sudo apt-get install -y ssh rsync

Instalación de los paquetes propios de Apache Hadoop 2.9 (versión estable:

wget http://apache.uvigo.es/hadoop/common/stable/hadoop-2.9.0.tar.gz ;
# Descomprimir:
tar -xvzf hadoop-2.9.0.tar.gz ;
# Moverlo a /usr/bin
sudo mv hadoop-2.9.0 /usr/bin/hadoop-2.9.0 ;
# Creo un enlace, para no tener que buscar las rutas:
sudo ln -s /usr/bin/hadoop-2.9.0/bin/hadoop /usr/bin/hadoop

Configuración del entorno

Cambiar en la configuración, la ruta donde tengamos en nuestro sistema java.

whereis java; 
medit /usr/bin/hadoop-2.9.0/etc/hadoop/hadoop-env.sh
# set to the root of your Java installation
 export JAVA_HOME=/usr/bin/java

Iniciar Hadoop

Al haber creado ya un enlace durante la instalación, es suficiente con invocar hadoop de la siguiente manera:

hadoop

Desinstalación

rm -rf /usr/bin/hadoop-2.9.0
rm -rf /usr/bin/hadoop

Más información: https://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-common/SingleCluster.html

Centreon nagios: Instalación centreon 2.5.0

Ya ha salido la versión estable de centreon 2.5.0. Vamos a usar un fichero answers para que no nos pregunte por todos los datos. El fichero de respuestas, está al final del tutorial.

Estamos desplegando sobre una distribución CentOS release 6.5 (Final)

wget http://download.centreon.com/centreon/centreon-2.5.0.tar.gz
tar -xvzf  centreon-2.5.0.tar.gz
./centreon-2.5.0/install.sh -f answer

Respuestas que faltan:

Where is your monitoring plugins (libexec) directory ?
default to [/usr/lib/nagios/plugins]
> /usr/lib64/nagios/plugins/
(...)
Where is your CentreonTrapd binaries directory
default to [/usr/local/centreon/bin]
/usr/local/centreon/bin

Entramos en el interfaz web:

http://server-ip/centreon/install/upgrade.php

En este caso, debemos hacer unos cambios antes de seguir en el instalador. Estamos usando ndo. Hemos intentado seguir las instrucciones que nos dan en el instalador:

If you are using NDO

  • Stop centstorage
  • Upgrade Centreon (web install)
  • Execute /path/to/centreon/bin/changeRrdDsName.pl
  • Start centstorage

No ha funcionado ninguno de los pasos:

[root@server centreon-2.5.0]# service centstorage stop
Stopping centstorage:                                      [FALLÃ]
[root@server centreon-2.5.0]# find / -name changeRrdDsName.pl
/usr/local/centreon/bin/changeRrdDsName.pl
[root@server centreon-2.5.0]# /usr/local/centreon/bin/changeRrdDsName.pl
Can't call method "prepare" on an undefined value at /usr/local/centreon/bin/changeRrdDsName.pl line 61.

Tras la instalación, hemos tenido un problema con el fichero sudoers:

Central

sudo: no tty present and no askpass program specified

Verificar el fichero sudoers:

[root@servercentreon-2.5.0]# cat /etc/sudoers | grep -i centreon
## BEGIN: CENTREON SUDO
#Add by CENTREON installation script
User_Alias      CENTREON=apache,centreon
Defaults:CENTREON !requiretty
CENTREON   ALL = NOPASSWD: /etc/init.d/nagios* restart
CENTREON   ALL = NOPASSWD: /etc/init.d/nagios restart
CENTREON   ALL = NOPASSWD: /etc/init.d/nagios* reload
CENTREON   ALL = NOPASSWD: /etc/init.d/nagios reload
CENTREON   ALL = NOPASSWD: /etc/init.d/nagios* force-reload
CENTREON   ALL = NOPASSWD: /etc/init.d/nagios force-reload
CENTREON   ALL = NOPASSWD: /usr/sbin/nagios* -v *
CENTREON   ALL = NOPASSWD: /usr/sbin/nagios -v *
CENTREON   ALL = NOPASSWD: /usr/sbin/nagios* -s *
CENTREON   ALL = NOPASSWD: /usr/sbin/nagios -s *
CENTREON   ALL = NOPASSWD: /etc/init.d/snmptrapd restart
# Centreontrapd restart
CENTREON   ALL = NOPASSWD: /etc/init.d/centreontrapd restart
# Centreontrapd reload
CENTREON   ALL = NOPASSWD: /etc/init.d/centreontrapd reload
CENTREON   ALL = NOPASSWD: /etc/init.d/centstorage restart
CENTREON   ALL = NOPASSWD: /etc/init.d/centstorage stop
CENTREON   ALL = NOPASSWD: /etc/init.d/centstorage start
CENTREON   ALL = NOPASSWD: /etc/init.d/ndoutils* restart
CENTREON   ALL = NOPASSWD: /etc/init.d/ndoutils restart
CENTREON   ALL = NOPASSWD: /etc/init.d/ndoutils* reload
CENTREON   ALL = NOPASSWD: /etc/init.d/ndoutils reload
## END: CENTREON SUDO

 

Enlace entre /usr/sbin/nagios y  /usr/bin/nagios

ln -s /usr/sbin/nagios  /usr/bin/nagios

Verificar el usuario de /etc/nagios:

chown -R apache:centreon /etc/nagios/

 

Anexo: Ficheros answers.txt

## CentWeb: Web front Centreon for Nagios
PROCESS_CENTREON_WWW=1
## CentStorage: Log and charts archiving.
PROCESS_CENTSTORAGE=1
## CentCore: Distributed Monitoring engine.
PROCESS_CENTCORE=1
## CentPlugins: Centreon Plugins for nagios
PROCESS_CENTREON_PLUGINS=1
## CentTraps: Centreon Snmp traps process for nagios
PROCESS_CENTREON_SNMP_TRAPS=1
#####################################################################
## Begin: Default variables
#####################################################################
## Your default variables
## $BASE_DIR is the centreon source directory
LOG_DIR=”$BASE_DIR/log”
LOG_FILE=”$LOG_DIR/install_centreon.log”
## Don’t change values above unless you perfectly understand
## what you are doing.
## Centreon temporary directory to work
TMP_DIR=”/tmp/centreon-setup”
## default snmp config directory
SNMP_ETC=”/etc/snmp/”
## a list of pear modules require by Centreon
PEAR_MODULES_LIST=”pear.lst”
PEAR_PATH=”/usr/share/pear”
NAGIOS_PLUGINS=”/usr/lib64/nagios/plugins”
#####################################################################
## End: Default variables
##################################################################
#####################################################################
## Begin: Centreon preferences
#####################################################################
## Above variables are necessary to run a silent install
## Where you want to install Centreon (Centreon root directory)
INSTALL_DIR_CENTREON=”/usr/local/centreon”
## Centreon log files directory
CENTREON_LOG=”/usr/local/centreon/log”
## Centreon config files
CENTREON_ETC=”/etc/centreon”
## Where is your Centreon binaries directory ?
CENTREON_BINDIR=”/usr/local/centreon/bin”
## Where is your Centreon data informations directory ?
CENTREON_DATADIR=”/usr/local/centreon/data”
## Centreon generation config directory
##  filesGeneration and filesUpload
## Where is your Centreon generation_files directory ?
CENTREON_GENDIR=”/usr/local/centreon”
## libraries temporary files directory
## Where is your Centreon variable library directory ?
CENTREON_VARLIB=”/var/lib/centreon”
## Where is your CentPlugins Traps binary?
CENTPLUGINSTRAPS_BINDIR=”/usr/local/centreon/bin”
## Where is the RRD perl module installed [RRDs.pm]
## ATTENTION: ON x64 SYSTEMS THE PATH IS LIB64 INSTEAD OF LIB
##               vv
RRD_PERL=”/usr/lib64/perl5″
## What is the Centreon group ?
CENTREON_GROUP=”centreon”
## What is the Centreon user ?
CENTREON_USER=”centreon”
## What is the Monitoring engine user ?
MONITORINGENGINE_USER=”nagios”
## What is the Monitoring engine group ?
MONITORINGENGINE_GROUP=”nagios”
## What is the Monitoring engine log directory ?
MONITORINGENGINE_LOG=”/var/log/nagios”
## Where is your monitoring plugins (libexec) directory ?
PLUGIN_DIR=”/usr/local/nagios/libexec”
## Path to sudoers file (optional)
## Where is sudo configuration file
SUDO_FILE=”/etc/sudoers”
## What is the Monitoring engine init.d script ?
MONITORINGENGINE_INIT_SCRIPT=”/etc/init.d/nagios”
## What is the Monitoring engine binary ?
MONITORINGENGINE_BINARY=”/usr/sbin/nagios”
## What is the Monitoring engine configuration directory ?
MONITORINGENGINE_ETC=”/etc/nagios”
## Where is the configuration directory for broker module ?
BROKER_ETC=”/etc/nagios”
## Where is the init script for broker module daemon ?
BROKER_INIT_SCRIPT=”/etc/init.d/ndoutils”
## Do you want me to configure your sudo ? (WARNING)
FORCE_SUDO_CONF=1
#####################################################################
## Begin: Apache preferences
#####################################################################
## Apache configuration directory (optional)
#DIR_APACHE=”/etc/apache”
## Apache local specific configuration directory (optional)
## Do you want to update Centreon Apache sub configuration file ?
# DIR_APACHE_CONF=”/etc/apache/conf.d”
## Apache configuration file. Only file name. (optional)
#APACHE_CONF=”apache.conf”
## Apache user (optional)
WEB_USER=”apache”
## Apache group (optional)
WEB_GROUP=”apache”
## Force apache reload (optional): set APACHE_RELOAD to 1
## Do you want to reload your Apache ?
APACHE_RELOAD=1
#####################################################################
## End: Apache preferences
#####################################################################
## Do you want me to install/upgrade your PEAR modules
PEAR_AUTOINST=1
## Centreon run dir (all .pid, .run, .lock)
## Where is your Centreon Run Dir directory?
CENTREON_RUNDIR=”/var/run/centreon”
## path to centstorage binary
## Where is your CentStorage binary directory
CENTSTORAGE_BINDIR=”/usr/local/centreon/bin”
## CentStorage RRDs directory (where .rrd files go)
## Where is your CentStorage RRD directory
CENTSTORAGE_RRD=”/var/lib/centreon”
## Do you want me to install CentStorage init script ?
CENTSTORAGE_INSTALL_INIT=1
## Do you want me to install CentStorage run level ?
CENTSTORAGE_INSTALL_RUNLVL=1
## path to centcore binary
CENTCORE_BINDIR=”usr/local/centreon/bin”
## force install init script (install in init.d)
## Set to “1” to enable
## Do you want me to install CentCore init script ?
CENTCORE_INSTALL_INIT=1
## force install run level for init script (add all link on rcX.d)
## Set to “1” to enable
## Do you want me to install CentCore run level
CENTCORE_INSTALL_RUNLVL=1
## Some plugins require temporary datas to process output.
## These temp datas are store in the CENTPLUGINS_TMP path.
## Where is your CentPlugins lib directory
CENTPLUGINS_TMP=”/var/lib/centreon/centplugins”
## path for snmptt installation
SNMPTT_BINDIR=”/usr/local/centreon/bin/”
## What is the Broker user ? (optional)
BROKER_USER=$MONITORINGENGINE_USER
## Nagios user (optional)
NAGIOS_USER=”nagios”
## Nagios group (optional)
NAGIOS_GROUP=”nagios”
## Centreon Connector PATH
## Mail (optional)
BIN_MAIL=”/bin/mail”
##