Reply
New Contributor
Posts: 1
Registered: ‎11-25-2015

hdfs and hive command not found

Hello,

I am rather new to Cloudera and Hadoop and got an issue I just can`t go on with.

 

The aim is to split up log files and store them into hdfs with a Hive Database.

I have set up an environment with 3 Hosts and CDH5.

 

Version: Cloudera Express 5.4.8 (#7 built by jenkins on 20151023-1203 git: d7dbdf29ac1d57ae9fb19958502d50dcf4e4fffd)

 

Host 1 which is a NameNode and DataNode

Host 2 which is a DataNode

Host 3 which is a DataNode

 

I added HDFS and Hive as service. Everything is green and working.

 

Now if I want to use the -bash: hdfs or hive commands at Host 1 I get the error that the command is not found.

If I use the same commands on Host 2 or Host 3 it`s working.

 

I am using CDH 5.4.8 Parcel install.

 

I tried to: service cloudera-scm-agent restart

 

also is /opt/cloudera/parcels/CDH-5.4.8-1.cdh5.4.8.p0.4/bin/hadoop a directory on each Hosts

 

cat /opt/cloudera/parcels/CDH-5.4.8-1.cdh5.4.8.p0.4/bin/hadoop
#!/bin/bash
  # Reference: http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
  SOURCE="${BASH_SOURCE[0]}"
  BIN_DIR="$( dirname "$SOURCE" )"
  while [ -h "$SOURCE" ]
  do
    SOURCE="$(readlink "$SOURCE")"
    [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
    BIN_DIR="$( cd -P "$( dirname "$SOURCE"  )" && pwd )"
  done
  BIN_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  LIB_DIR=$BIN_DIR/../lib

# Autodetect JAVA_HOME if not defined
. $LIB_DIR/bigtop-utils/bigtop-detect-javahome

export HADOOP_LIBEXEC_DIR=//$LIB_DIR/hadoop/libexec

exec $LIB_DIR/hadoop/bin/hadoop "$@"

 

In /var/lib/alternatives I can check with cat hadoop and get

auto
/usr/bin/hadoop

/opt/cloudera/parcels/CDH-5.4.8-1.cdh5.4.8.p0.4/bin/hadoop
10

 

I dont know what could be the reason that it works everywhere but on the Host 1 which is also the NameNode.

 

I would be happy if someone has any suggestions and if the issue is resolved in another post I want to apologies cause I didn`t found something which quite matches my problem by myself.

 

best regards

 

 

 

New Contributor
Posts: 1
Registered: ‎02-07-2019

Re: hdfs and hive command not found

Hi, 

 

I am facing the same issue. Did you get yours resolved and if yes can you please share the solution?

 

Expert Contributor
Posts: 76
Registered: ‎02-23-2018

Re: hdfs and hive command not found

Hi @Octa,

 

Can you show any logs?

 

Regards,

Manu.

Announcements