[HDP2] Add ambari element

New version of HDP plugin uses this element for installing Ambari

partially implements bp: hdp-22-support

Change-Id: Icdbd1832fb0f1a64a0a41dd67b840f0d2a38b8b0
This commit is contained in:
Sergey Reshetnyak 2015-05-10 16:55:55 +03:00
parent f02b223a4c
commit 2853c54590
7 changed files with 110 additions and 2 deletions

View File

@ -27,7 +27,7 @@ NOTE: Do not create all images for all plugins with the same mirrors. Different
.. sourcecode:: bash
tox -e venv -- sahara-image-create -p [vanilla|spark|hdp|cloudera|storm|mapr]
tox -e venv -- sahara-image-create -p [vanilla|spark|hdp|cloudera|storm|mapr|ambari]
5. To select which hadoop version to target use the '-v' commandline option like this:
@ -39,7 +39,7 @@ NOTE: Do not create all images for all plugins with the same mirrors. Different
.. sourcecode:: bash
tox -e venv -- sahara-image-create -i [ubuntu|fedora|centos]
tox -e venv -- sahara-image-create -i [ubuntu|fedora|centos|centos7]
7. If the host system is missing packages required for diskimage-create.sh, the '-u' commandline option will instruct the script to install them without prompt.

View File

@ -227,6 +227,16 @@ case "$PLUGIN" in
;;
esac
;;
"ambari")
case "$BASE_IMAGE_OS" in
"" | "centos" | "centos7" | "ubuntu" )
;;
* )
echo "\"$BASE_IMAGE_OS\" image type is not supported by \"$PLUGIN\".\nAborting"
exit 1
;;
esac
;;
"mapr")
case "$BASE_IMAGE_OS" in
"" | "ubuntu" | "centos");;
@ -614,6 +624,44 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "hdp" ]; then
unset BASE_IMAGE_FILE DIB_IMAGE_SIZE DIB_CLOUD_IMAGES
fi
############################
# Images for Ambari plugin #
############################
if [ -z "$PLUGIN" -o "$PLUGIN" = "ambari" ]; then
export DIB_AMBARI_VERSION="$HADOOP_VERSION"
if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "ubuntu" ]; then
ambari_ubuntu_image_name=${ambari_ubuntu_image_name:-ubuntu_sahara_ambari}
ambari_element_sequence="vm ntp ubuntu ambari $JAVA_ELEMENT"
if [ -n "$USE_MIRRORS" -a "$UBUNTU_MIRROR" ]; then
ambari_element_sequence="$ambari_element_sequence apt-mirror"
fi
export DIB_RELEASE="precise"
disk-image-create $TRACING $ambari_element_sequence -o $ambari_ubuntu_image_name
unset DIB_RELEASE
fi
if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "centos" ]; then
export BASE_IMAGE_FILE="CentOS-6.6-cloud-init-20150821.qcow2"
export DIB_CLOUD_IMAGES="http://sahara-files.mirantis.com"
ambari_centos_image_name=${ambari_centos_image_name:-centos_sahara_ambari}
ambari_element_sequence="vm ntp centos ambari $JAVA_ELEMENT"
if [ -n "$USE_MIRRORS" -a "$CENTOS_MIRROR" ]; then
ambari_element_sequence="$ambari_element_sequence centos-mirror"
fi
if [ "$DEBUG_MODE" = "true" ]; then
ambari_element_sequence="$ambari_element_sequence root-passwd"
fi
disk-image-create $ambari_element_sequence -o $ambari_centos_image_name
unset BASE_IMAGE_FILE DIB_CLOUD_IMAGES
fi
if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "centos7" ]; then
ambari_centos7_image_name=${ambari_centos7_image_name:-"centos7-sahara-ambari"}
ambari_element_sequence="vm ntp centos7 disable-selinux ambari $JAVA_ELEMENT"
disk-image-create $ambari_element_sequence -o $ambari_centos7_image_name
fi
unset DIB_AMBARI_VERSION
fi
#########################
# Images for CDH plugin #
#########################

View File

@ -0,0 +1,14 @@
======
ambari
======
Installs Ambari Management Console
Environment Variables
---------------------
AMBARI_VERSION
:Required: No
:Default: 2.0.1
:Description: Version of Ambari Management Console to install
:Example: ``AMBARI_VERSION="2.0.0"`` installs Ambari 2.0.0

View File

@ -0,0 +1,3 @@
disable-firewall
java
package-installs

View File

@ -0,0 +1,7 @@
wget:
phase: pre-install.d
ambari-agent:
ambari-log4j:
ambari-metrics-hadoop-sink:
ambari-metrics-monitor:
ambari-server:

View File

@ -0,0 +1,14 @@
#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
case "${DISTRO_NAME}" in
rhel | centos | centos7 )
chkconfig ambari-server off
chkconfig ambari-agent off
;;
esac

View File

@ -0,0 +1,22 @@
#!/bin/bash
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
DIB_AMBARI_VERSION="${DIB_AMBARI_VERSION:-2.1.0}"
case "${DISTRO_NAME}" in
rhel | centos )
wget http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/$DIB_AMBARI_VERSION/ambari.repo -O /etc/yum.repos.d/ambari.repo
;;
centos7 )
wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/$DIB_AMBARI_VERSION/ambari.repo -O /etc/yum.repos.d/ambari.repo
;;
ubuntu )
wget http://public-repo-1.hortonworks.com/ambari/ubuntu12/2.x/updates/$DIB_AMBARI_VERSION/ambari.list -O /etc/apt/sources.list.d/ambari.list
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD
;;
esac