Skip to content
This repository was archived by the owner on Mar 27, 2022. It is now read-only.

Commit

Permalink
platforms/hdp: re-use functions from hadoop_helpers, and do a check o…
Browse files Browse the repository at this point in the history
…f gcs.
seanorama committed Jan 24, 2015
1 parent 5ffd186 commit bbe30dd
Showing 3 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions platforms/hdp/ambari_env.sh
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ COMMAND_GROUPS+=(
"install-gcs-connector-on-ambari:
platforms/hdp/install_gcs_connector_on_ambari.sh
"

"update-ambari-config:
platforms/hdp/update_ambari_config.sh
"
8 changes: 1 addition & 7 deletions platforms/hdp/install_ambari_components.sh
Original file line number Diff line number Diff line change
@@ -100,10 +100,4 @@ ${AMBARI_CURL} -X POST -d @${CLUSTER_TEMPLATE_FILE} \
loginfo "Waiting for ambari cluster creation to complete (may take awhile)."
ambari_wait_requests_completed

# Set up HDFS /user directories.
loginfo "Setting up HDFS /user directories."
for USER in $(getent passwd | grep '/home' | cut -d ':' -f 1); do
echo "Creating HDFS directory for user '${USER}'"
sudo -u hdfs hdfs dfs -mkdir -p "/user/${USER}"
sudo -u hdfs hdfs dfs -chown "${USER}" "/user/${USER}"
done
loginfo "Ambari is now available at http://${PREFIX}-m:8080/"
14 changes: 13 additions & 1 deletion platforms/hdp/update_ambari_config.sh
Original file line number Diff line number Diff line change
@@ -12,8 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Makes post-cluster build configuration changes
# finalize the cluster configuration

source hadoop_helpers.sh

# initialize hdfs dirs
if [ "${DEFAULT_FS}" = 'hdfs' ]; then
loginfo "Set up HDFS /tmp and /user dirs"
initialize_hdfs_dirs
fi

# update hadoop configuration to include the gcs connector
if (( ${INSTALL_GCS_CONNECTOR} )) ; then
loginfo "adding /usr/local/lib/hadoop/lib to mapreduce.application.classpath."
NEW_CLASSPATH=$(/var/lib/ambari-server/resources/scripts/configs.sh get localhost ${PREFIX} mapred-site | grep -E '^"mapreduce.application.classpath"' | tr -d \" | awk '{print "/usr/local/lib/hadoop/lib/*,"$3}' | sed 's/,$//')
@@ -27,4 +36,7 @@ if (( ${INSTALL_GCS_CONNECTOR} )) ; then
ambari_service_start
ambari_wait_requests_completed
done

# check if GCS is accessible
check_filesystem_accessibility
fi

0 comments on commit bbe30dd

Please sign in to comment.