Ansible hdfs/spark set-up

Hello,

I’m attempting to set up hdfs and spark on two openstack VMs using the ansible scripts in dcc-cm/ansible.

I keep running in to this error:

fatal: [dcc-etl-test]: FAILED! => {“changed”: false, “failed”: true, “msg”: “starting namenode, logging to /var/log/hadoop-hdfs/hadoop-hdfs-namenode-dcc-etl-test.out\nSLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".\nSLF4J: Defaulting to no-operation (NOP) logger implementation\nSLF4J: See SLF4J Error Codes for further details.\n * Failed to start Hadoop namenode. Return value: 1\n”}

during task

TASK [hdfs : Enable and start the Hadoop HDFS NameNode service]

I get the same error when when attempting to start the node in the vm itself.

sudo service hadoop-hdfs-namenode start
starting namenode, logging to /var/log/hadoop-hdfs/hadoop-hdfs-namenode-dcc-etl-test.out
SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See SLF4J Error Codes for further details.

  • Failed to start Hadoop namenode. Return value: 1

even if I explicitly set the HADOOP_CLASSPATH to include an slf4j jar.

Any ideas what’s going on?

Hi @mayfielg, could you let us know what OS you are using and if you made any changes to the Ansible roles or variables? In particular, are you using the versions specified? Any other details would be greatly appreciated (e.g. how you invoked the playbook, etc.).Thanks.

Hi. I’m on ubuntu 14.04. They only changes I’ve made are bypassing the set-up-all / set-up-existing tasks, since I’m using pre-initialized servers rather than ones that are dynamically created by ansible. I also have different names of my servers in config/hosts file.

# Copyright 2016(c) The Ontario Institute for Cancer Research. All rights reserved.

#- include: tasks/setup.yml group=hdfs-namenode:hdfs-datanode
#- include: tasks/setup-existing.yml group=hdfs-namenode:hdfs-datanode

# HDFS - Namenode

  • hosts: dcc-etl-test
    become: yes
    vars_files:
    • “vars/main.yml”
      roles:
    • { role: hdfs, hdfs_namenode: True }

# HDFS - Datanode

  • hosts: hadoop_worker
    become: yes
    vars_files:
    • “vars/main.yml”
      roles:
      • { role: hdfs, hdfs_namenode: False }

# Spark - Master

  • hosts: dcc-etl-test
    become: yes
    vars_files:
    • “vars/main.yml”
      roles:
    • { role: spark, master: True }

# Spark - Slave

  • hosts: hadoop_worker
    become: yes
    vars_files:
    • “vars/main.yml”
      roles:
      • { role: spark, master : False }

The command I’m running is:

ansible-playbook -i config/hosts hdfs.yml

And my hosts file is:

[localhost]
127.0.0.1

[etl]
dcc-etl-test
dcc-etl-test2

I haven’t changed the versions of anything either.

Hi Georgia,
You should add a file /etc/hadoop/conf/hadoop-env.sh to the namenode with the following content.

export JAVA_LIBRARY_PATH=/usr/lib/hadoop/lib/native:$JAVA_LIBRARY_PATH:
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/usr/share/java/slf4j-simple.jar:

But, the namenode will still fail to start because it is not able to resolve hostname dcc-hadoop-master (our playbook depends on it). You should add a record to /etc/hosts on all Hadoop hosts which resolves dcc-hadoop-master hostname.