Skip to content

Instantly share code, notes, and snippets.

@jheidt jheidt/CDH5.sh
Created Sep 19, 2014

Embed
What would you like to do?
configures cloudera CDH5.1.0 for use on a standalone development machine
# ===================================================
# CLOUDERA 5.1.0
# ===================================================
declare CDH_SUFFIX=cdh5.1.0
declare CDH_HOME=/opt/${CDH_SUFFIX}
declare AVRO_DIR_NAME=avro-1.7.5-${CDH_SUFFIX}
declare DATAFU_DIR_NAME=datafu-1.1.0
declare HADOOP_DIR_NAME=hadoop-2.3.0-${CDH_SUFFIX}
declare HBASE_DIR_NAME=hbase-0.98.1-${CDH_SUFFIX}
declare HIVE_DIR_NAME=hive-0.12.0-${CDH_SUFFIX}
declare OOZIE_DIR_NAME=oozie-4.0.0-${CDH_SUFFIX}
declare PARQUETFORMAT_DIR_NAME=parquet-format-1.0.0-${CDH_SUFFIX}
declare PIG_DIR_NAME=pig-0.12.0-${CDH_SUFFIX}
declare SPARK_DIR_NAME=spark-1.0.0-${CDH_SUFFIX}
declare SQOOP_DIR_NAME=sqoop-1.4.4-${CDH_SUFFIX}
declare WHIRR_DIR_NAME=whirr-0.9.0-${CDH_SUFFIX}
declare ZOOKEEPER_DIR_NAME=zookeeper-3.4.5-${CDH_SUFFIX}
# ===================================================
# hadoop-2.3.0-cdh5.1.0
# ===================================================
if [[ -d "${CDH_HOME}/${HADOOP_DIR_NAME}" ]]; then
export HADOOP_PREFIX=${CDH_HOME}/${HADOOP_DIR_NAME};
export HADOOP_COMMON_HOME=${HADOOP_PREFIX};
export HADOOP_HDFS_HOME=${HADOOP_PREFIX};
export HADOOP_MAPRED_HOME=${HADOOP_PREFIX};
export HADOOP_YARN_HOME=${HADOOP_PREFIX};
export PATH=${HADOOP_PREFIX}/bin:${PATH};
export HADOOP_CONF_DIR=${HADOOP_PREFIX}/etc/hadoop;
else
echo "CDH 5.1.0 HADOOP NOT FOUND!"
fi
# ===================================================
# hive-0.12.0-cdh5.1.0
# ===================================================
if [[ -d "${CDH_HOME}/${HIVE_DIR_NAME}" ]]; then
export HIVE_HOME=${CDH_HOME}/${HIVE_DIR_NAME};
export HIVE_CONF_DIR=${HIVE_HOME}/conf;
export HCAT_HOME=${HIVE_HOME}/hcatalog;
[[ -d "${HIVE_HOME}/bin" ]] && export PATH=${HIVE_HOME}/bin:${PATH};
fi
# ===================================================
# pig-0.12.0-cdh5.1.0
# ===================================================
if [[ -d "${CDH_HOME}/${PIG_DIR_NAME}}" ]]; then
export PIG_HOME=${CDH_HOME}/${PIG_DIR_NAME};
export PIG_CONF_DIR=${PIG_HOME}/conf;
[[ -d "${PIG_HOME}/bin" ]] && export PATH=${PIG_HOME}/bin:${PATH};
fi
# ===================================================
# sqoop-1.4.4-cdh5.1.0
# ===================================================
if [[ -d "${CDH_HOME}/${SQOOP_DIR_NAME}" ]]; then
export SQOOP_HOME=${CDH_HOME}/${SQOOP_DIR_NAME};
export SQOOP_CONF_DIR=${SQOOP_HOME}/conf;
[[ -d "${SQOOP_HOME}/bin" ]] && export PATH=${SQOOP_HOME}/bin:${PATH};
fi
# ===================================================
if [[ -d "${CDH_HOME}/${SPARK_DIR_NAME}" ]]; then
export SPARK_HOME=${CDH_HOME}/${SPARK_DIR_NAME};
export SPARK_CONF_DIR=${SPARK_DIR_NAME}/conf;
[[ -d "${SPARK_HOME}/bin" ]] && export PATH=${SPARK_HOME}/bin:${PATH};
fi
# ===================================================
if [[ -d "${CDH_HOME}/${OOZIE_DIR_NAME}" ]]; then
export OOZIE_HOME=${CDH_HOME}/${OOZIE_DIR_NAME};
export OOZIE_CONF_DIR=${OOZIE_HOME}/conf;
[[ -d "${OOZIE_HOME}/bin" ]] && export PATH=${OOZIE_HOME}/bin:${PATH};
fi
# ===================================================
if [[ -d "${CDH_HOME}/${ZOOKEEPER_DIR_NAME}" ]]; then
export ZOOKEEPER_HOME=${CDH_HOME}/${ZOOKEEPER_DIR_NAME};
export ZOOKEEPER_CONF_DIR=${ZOOKEEPER_HOME}/conf;
[[ -d "${ZOOKEEPER_HOME}/bin" ]] && export PATH=${ZOOKEEPER_HOME}/bin:${PATH};
fi
# ===================================================
if [[ -d "${CDH_HOME}/${HBASE_DIR_NAME}" ]]; then
export HBASE_HOME=${CDH_HOME}/${HBASE_DIR_NAME};
export HBASE_CONF_DIR=${HBASE_HOME}/conf;
[[ -d "${HBASE_HOME}/bin" ]] && export PATH=${HBASE_HOME}/bin:${PATH};
fi
# ===================================================
if [[ -d "${CDH_HOME}/${WHIRR_DIR_NAME}" ]]; then
export WHIRR_HOME=${CDH_HOME}/${WHIRR_DIR_NAME};
export WHIRR_CONF_DIR=${WHIRR_HOME}/conf;
[[ -d "${WHIRR_HOME}/bin" ]] && export PATH=${WHIRR_HOME}/bin:${PATH};
fi
unset CDH_HOME
unset CDH_SUFFIX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.