diff --git a/platforms/hdp/ambari_env.sh b/platforms/hdp/ambari_env.sh index 4529256..7737778 100644 --- a/platforms/hdp/ambari_env.sh +++ b/platforms/hdp/ambari_env.sh @@ -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 " diff --git a/platforms/hdp/install_ambari_components.sh b/platforms/hdp/install_ambari_components.sh index 7955598..af6a118 100644 --- a/platforms/hdp/install_ambari_components.sh +++ b/platforms/hdp/install_ambari_components.sh @@ -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/" diff --git a/platforms/hdp/update_ambari_config.sh b/platforms/hdp/update_ambari_config.sh index f87a510..97cdc9a 100644 --- a/platforms/hdp/update_ambari_config.sh +++ b/platforms/hdp/update_ambari_config.sh @@ -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