Skip to content

Commit

Permalink
K8S-853: Enable spark metrics for external tenant (apache#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarjeet2013 authored and ekrivokonmapr committed Sep 19, 2019
1 parent 19d6183 commit f8ca50d
Showing 1 changed file with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,22 @@ function configureSecurity() {

if [ "$SECURE_CLUSTER" == "true" ]; then
MAPR_SECURE="-secure"

# FIXME: (Copy Metrics ticket)
METRICS_TICKET_DIR=$(dirname "${MAPR_TICKETFILE_LOCATION}")
METRICS_TICKET_FILE=$METRICS_TICKET_DIR/METRICS_TICKET
cp $METRICS_TICKET_FILE $MAPR_HOME/conf/mapruserticket
else
MAPR_SECURE="-unsecure"
fi

/opt/mapr/server/configure.sh -c -C $MAPR_CLDB_HOSTS -Z $MAPR_ZK_HOSTS -N $MAPR_CLUSTER "${MAPR_SECURE}"
local args="-no-autostart -on-prompt-cont y -v -f -nocerts"
/opt/mapr/server/configure.sh $MAPR_SECURE $args -c -C $MAPR_CLDB_HOSTS -Z $MAPR_ZK_HOSTS -N $MAPR_CLUSTER -OT $MAPR_TSDB_HOSTS -ES $MAPR_ES_HOSTS

# Configure collectd
echo "Configuring collectd.."
echo $MAPR_CLUSTER_ID >> $MAPR_HOME/conf/clusterid
/opt/mapr/collectd/collectd-${collectd_version}/bin/configure.sh $MAPR_SECURE -nocerts -OT "$MAPR_TSDB_HOSTS"
}

function configureK8SProperties() {
Expand All @@ -79,12 +90,28 @@ spark.ui.filters org.apache.spark.ui.filters.MultiauthWebUiFilter
EOM
}

function startCollectdForMetrics() {

if [ -v SPARK_EXECUTOR_ID ]; then
echo "Skipping collectd for spark executor pod.."
else
echo "Starting CollectD for spark driver pod.."
local collectd="/opt/mapr/collectd/collectd-${collectd_version}/etc/init.d/collectd"

if [ ! -f $collectd ]; then
echo "Could not find collectd start file at: ${collectd}"
else
${collectd} start &
fi
fi
}

function configurePod() {
validateUserCredentials
createUser
createUserGroups
copySecurity
configureSecurity
startCollectdForMetrics
configureK8SProperties
}

0 comments on commit f8ca50d

Please sign in to comment.