浏览代码

AMBARI-537. Cleaning up references. (Contributed by Vikram)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1347830 13f79535-47bb-0310-9956-ffa450edef68
Hitesh Shah 13 年之前
父节点
当前提交
1c4ce2639c
共有 84 个文件被更改,包括 43 次插入4868 次删除
  1. 2 0
      CHANGES.txt
  2. 0 245
      hmc/archive/ShellScripts/configureClusterAdvanced.sh
  3. 0 176
      hmc/archive/ShellScripts/dbLib.sh
  4. 0 179
      hmc/archive/ShellScripts/deploy.sh
  5. 0 55
      hmc/archive/ShellScripts/discoverNodes.sh
  6. 0 105
      hmc/archive/ShellScripts/easyInstallerLib.sh
  7. 0 98
      hmc/archive/ShellScripts/generateNodeFiles.sh
  8. 0 70
      hmc/archive/ShellScripts/pdshDiscoverNodes.sh
  9. 0 227
      hmc/archive/ShellScripts/pdshSuggestMem.sh
  10. 0 207
      hmc/archive/ShellScripts/servicesLib.sh
  11. 0 227
      hmc/archive/ShellScripts/suggestMemSize.sh
  12. 0 115
      hmc/archive/ShellScripts/suggestNodes.sh
  13. 0 54
      hmc/archive/ShellScripts/templates/gsCluster.properties.in
  14. 0 206
      hmc/archive/ShellScripts/templates/gsInstaller.properties.in
  15. 0 40
      hmc/archive/ShellScripts/templates/monInstaller.properties.in
  16. 0 166
      hmc/archive/php/assignHosts.php
  17. 0 163
      hmc/archive/php/configureCluster.php
  18. 0 35
      hmc/archive/php/createCluster.php
  19. 0 335
      hmc/archive/php/dbLib.php
  20. 0 129
      hmc/archive/php/deploy.php
  21. 0 77
      hmc/archive/php/displayLogs.php
  22. 0 18
      hmc/archive/php/displayNodeProgress.php
  23. 0 18
      hmc/archive/php/dummyDeploy.php
  24. 0 22
      hmc/archive/php/dummyFetchTxnLogs.php
  25. 0 53
      hmc/archive/php/dummyFetchTxnProgressReport.php
  26. 0 17
      hmc/archive/php/globals.inc
  27. 0 216
      hmc/archive/php/gsInstallerUtils.php
  28. 0 281
      hmc/archive/php/initializeCluster.php
  29. 0 38
      hmc/archive/php/listClusters.php
  30. 0 2
      hmc/archive/php/memorySuggestor-data.txt
  31. 0 54
      hmc/archive/php/options.php
  32. 0 24
      hmc/archive/php/pluggableDisplayHeaderFooter.php
  33. 0 91
      hmc/archive/php/serviceAdmin.php
  34. 0 181
      hmc/archive/php/servicesStatus.php
  35. 0 280
      hmc/archive/php/tmpInitializeCluster.php
  36. 0 45
      hmc/archive/php/uploadFiles.php
  37. 0 24
      hmc/archive/php/utils.php
  38. 0 86
      hmc/archive/playground/assignHosts.php
  39. 0 71
      hmc/archive/playground/configureCluster.php
  40. 0 3
      hmc/archive/playground/data.txt
  41. 0 5
      hmc/archive/playground/input/hostsFile.txt
  42. 0 27
      hmc/archive/playground/input/va_rsa
  43. 0 7
      hmc/archive/playground/mergeTest.php
  44. 0 60
      hmc/archive/playground/nodessugg.php
  45. 0 1
      hmc/archive/playground/output/DashboardSuggest.out
  46. 0 1
      hmc/archive/playground/output/GangliaCollectorSuggest.out
  47. 0 1
      hmc/archive/playground/output/GatewaySuggest.out
  48. 0 1
      hmc/archive/playground/output/HBaseMasterSuggest.out
  49. 0 1
      hmc/archive/playground/output/HCatalogServerSuggest.out
  50. 0 5
      hmc/archive/playground/output/HostDiscovery.out
  51. 0 1
      hmc/archive/playground/output/JobTrackerSuggest.out
  52. 0 1
      hmc/archive/playground/output/NagiosServerSuggest.out
  53. 0 4
      hmc/archive/playground/output/NameNodeMountPointsSuggest.out
  54. 0 1
      hmc/archive/playground/output/NameNodeSuggest.out
  55. 0 1
      hmc/archive/playground/output/OozieServerSuggest.out
  56. 0 1
      hmc/archive/playground/output/SecondaryNameNodeSuggest.out
  57. 0 1
      hmc/archive/playground/output/TempletonNodeSuggest.out
  58. 0 120
      hmc/archive/playground/readFromProps.php
  59. 0 15
      hmc/archive/playground/rez.php
  60. 0 11
      hmc/archive/playground/testing.php
  61. 2 2
      hmc/html/header.htmli
  62. 二进制
      hmc/images/logo-micro.gif
  63. 二进制
      hmc/images/logo-small.gif
  64. 二进制
      hmc/images/logo.jpg
  65. 0 99
      hmc/package/rpm/SOURCES/hmc.init.in
  66. 0 21
      hmc/package/rpm/SOURCES/hmc_hdp.repo
  67. 3 3
      hmc/package/rpm/SPECS/hmc.spec
  68. 3 3
      hmc/package/rpm/hmc-php53.spec
  69. 8 8
      hmc/php/conf/MessageResources-en.inc
  70. 0 1
      hmc/php/frontend/configUtils.php
  71. 0 1
      hmc/puppet/modules/hdp-nagios/files/check_oozie_status.sh
  72. 0 6
      hmc/puppet/modules/hdp/templates/hdp103.repo.erb
  73. 2 2
      hmc/tests/php/orchestrator/test.php
  74. 二进制
      hmc/tests/php/puppet/test.db
  75. 3 3
      mon_dashboard/package/rpm/hdp_mon_dashboard.spec
  76. 3 3
      mon_dashboard/package/rpm/hdp_mon_ganglia_addons.spec
  77. 3 3
      mon_dashboard/package/rpm/hdp_mon_nagios_addons.spec
  78. 0 1
      mon_dashboard/src/addOns/nagios/plugins/check_oozie_status.sh
  79. 2 2
      mon_dashboard/src/ui/hbase.html
  80. 2 2
      mon_dashboard/src/ui/hdfs.html
  81. 2 2
      mon_dashboard/src/ui/home.html
  82. 5 5
      mon_dashboard/src/ui/js/common.js
  83. 2 2
      mon_dashboard/src/ui/mapreduce.html
  84. 1 1
      mon_dashboard/test/dataServices/jmx/data/sample_hbasemaster_jmx.json

+ 2 - 0
CHANGES.txt

@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-537. Cleaning up references. (Vikram via Hitesh)
+
   AMBARI-528. Fix oozie smoke test failure (Ramya via Vikram)
 
   AMBARI-525. Javascript should not pass flag in case of post install add nodes. (Vikram)

+ 0 - 245
hmc/archive/ShellScripts/configureClusterAdvanced.sh

@@ -1,245 +0,0 @@
-#!/bin/sh
-
-#/*
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# *
-# *     http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# */
-
-baseDir=`dirname ${0}`;
-
-source ${baseDir}/easyInstallerLib.sh;
-source ${baseDir}/dbLib.sh;
-source ${baseDir}/servicesLib.sh;
-
-###########################
-### FILE-SCOPED GLOBALS ###
-###########################
-
-# TODO XXX Take this in from the UI in the future (and likely store it as a 
-# marker on disk, to really be of any use).
-clusterName="MyHDPCluster";
-
-#############################
-### FILE-SCOPED FUNCTIONS ###
-#############################
-
-function getServiceHost
-{
-  local serviceHost="";
-
-  local serviceName="${1}";
-
-  if [ "x" != "x${serviceName}" ]
-  then
-    serviceHostFile=`fetchDbFileForCluster "${clusterName}" "${serviceName}"`;
-    serviceHost=`getFirstWordFromFile "${serviceHostFile}"`;
-  fi
-
-  echo "${serviceHost}";
-}
-
-function generateServiceConfigChoiceXml
-{
-  local serviceConfigChoiceXml="";
-
-  local serviceHostFileName="${1}";
-  local serviceConfigKey="${2}";
-
-  if [ "x" != "x${serviceHostFileName}" ] && [ "x" != "x${serviceConfigKey}" ]
-  then
-    local serviceHostValue=`getServiceHost "${serviceHostFileName}"`;
-
-    serviceConfigChoiceXml="<hudson.model.ChoiceParameterDefinition>\
-<name>${serviceConfigKey}</name>\
-<description></description>\
-<choices class=\\\"java.util.Arrays\\\$ArrayList\\\">\
-<a class=\\\"string-array\\\">\
-<string>${serviceHostValue}</string>\
-</a>\
-</choices>\
-</hudson.model.ChoiceParameterDefinition>";
-  fi
-
-  echo "${serviceConfigChoiceXml}";
-}
-
-function generateOptionalServicesConfigChoicesXml
-{
-  local optionalServicesConfigChoicesXml="";
-
-  local isHBaseInstalled="${1}"; 
-  local isHCatalogInstalled="${2}";
-  local isTempletonInstalled="${3}";
-  local isOozieInstalled="${4}";
-
-  if [ "xyes" == "x${isHBaseInstalled}" ]
-  then
-    hBaseConfigChoicesXml=`generateServiceConfigChoiceXml "hbasemaster" "HDPHBaseMasterHost"`;
-    optionalServicesConfigChoicesXml="${optionalServicesConfigChoicesXml}${hBaseConfigChoicesXml}";
-  fi
-
-  if [ "xyes" == "x${isHCatalogInstalled}" ]
-  then
-    hCatalogConfigChoicesXml=`generateServiceConfigChoiceXml "hcatserver" "HDPHCatalogServerHost"`;
-    optionalServicesConfigChoicesXml="${optionalServicesConfigChoicesXml}${hCatalogConfigChoicesXml}";
-  fi
-
-  if [ "xyes" == "x${isTempletonInstalled}" ]
-  then
-    templetonConfigChoicesXml=`generateServiceConfigChoiceXml "templetonnode" "HDPTempletonNodeHost"`;
-    optionalServicesConfigChoicesXml="${optionalServicesConfigChoicesXml}${templetonConfigChoicesXml}";
-  fi
-
-  if [ "xyes" == "x${isOozieInstalled}" ]
-  then
-    oozieConfigChoicesXml=`generateServiceConfigChoiceXml "oozieserver" "HDPOozieServerHost"`;
-    optionalServicesConfigChoicesXml="${optionalServicesConfigChoicesXml}${oozieConfigChoicesXml}";
-  fi
-
-  echo "${optionalServicesConfigChoicesXml}";
-}
-
-#############
-### SETUP ###
-#############
-
-# XXX XXX RESUME FROM HERE
-###checkpointedStageNumber=`fetchDbCookieForCluster "${clusterName}" "${CHECKPOINTED_STAGE_NUMBER_COOKIE_NAME}"`;
-###
-###currentStageName="1-HDP-Initialize-Cluster";
-###currentStageNumber=`getStageNumberFromName "${currentStageName}"`;
-###
-###currentStageCanRun=`isStageTransitionAdmissable "${checkpointedStageNumber}" "${currentStageNumber}"`;
-###
-###if [ "${currentStageCanRun}" != "1" ]
-###then
-###  echo "Inadmissable stage transition attempted - bailing out.";
-###  exit 1;
-###fi
-
-# Create our per-build workspace - it's a shame Jenkins doesn't provide this for us.
-perBuildWorkspace=${WORKSPACE}/${BUILD_NUMBER};
-
-cmd="mkdir ${perBuildWorkspace}";
-
-echo "${cmd}";
-eval "${cmd}";
-
-######################
-### PRE-PROCESSING ###
-######################
-
-# Do nothing.
-
-######################
-### THE MAIN EVENT ###
-######################
-
-# Do nothing.
-
-#######################
-### POST-PROCESSING ###
-#######################
-
-# Store the data we've gotten from the user into our DB.
-read -r -d '' gsClusterConf << EOConf
-s!@HDPHadoopHeapSize@!${HDPHadoopHeapSize}!g
-s!@HDPNameNodeHeapSize@!${HDPNameNodeHeapSize}!g
-s!@HDPNameNodeOptNewSize@!${HDPNameNodeOptNewSize}!g
-s!@HDPDataNodeDuReserved@!${HDPDataNodeDuReserved}!g
-s!@HDPDataNodeHeapSize@!${HDPDataNodeHeapSize}!g
-s!@HDPJobTrackerOptNewSize@!${HDPJobTrackerOptNewSize}!g
-s!@HDPJobTrackerOptMaxNewSize@!${HDPJobTrackerOptMaxNewSize}!g
-s!@HDPJobTrackerHeapSize@!${HDPJobTrackerHeapSize}!g
-s!@HDPMapRedMapTasksMax@!${HDPMapRedMapTasksMax}!g
-s!@HDPMapRedReduceTasksMax@!${HDPMapRedReduceTasksMax}!g
-s!@HDPMapRedClusterMapMemoryMB@!${HDPMapRedClusterMapMemoryMB}!g
-s!@HDPMapRedClusterReduceMemoryMB@!${HDPMapRedClusterReduceMemoryMB}!g
-s!@HDPMapRedClusterMaxMapMemoryMB@!${HDPMapRedClusterMaxMapMemoryMB}!g
-s!@HDPMapRedClusterMaxReduceMemoryMB@!${HDPMapRedClusterMaxReduceMemoryMB}!g
-s!@HDPMapRedJobMapMemoryMB@!${HDPMapRedJobMapMemoryMB}!g
-s!@HDPMapRedJobReduceMemoryMB@!${HDPMapRedJobReduceMemoryMB}!g
-s!@HDPMapRedChildJavaOptsSize@!${HDPMapRedChildJavaOptsSize}!g
-s!@HDPIoSortMB@!${HDPIoSortMB}!g
-s!@HDPIoSortSpillPercent@!${HDPIoSortSpillPercent}!g
-s!@HDPMapReduceUserLogRetainHours@!${HDPMapReduceUserLogRetainHours}!g
-s!@HDPMaxTasksPerJob@!${HDPMaxTasksPerJob}!g
-s!@HDPDFSDataNodeFailedVolumeTolerated@!${HDPDFSDataNodeFailedVolumeTolerated}!g
-s!@HDPHBaseMasterHeapSize@!${HDPHBaseMasterHeapSize:-1024m}!g
-s!@HDPHBaseRegionServerHeapSize@!${HDPHBaseRegionServerHeapSize:-1024m}!g
-EOConf
-
-# The escaped quotes around ${gsClusterConf} are important because 
-# we're passing in a multi-line blob as a string, so the command-line 
-# invocation needs to have the blob quoted so storeDbConfForCluster can treat
-# it as a single string.
-cmd="storeDbConfForCluster ${clusterName} ${GSCLUSTER_PROPERTIES_CONF_NAME} \"${gsClusterConf}\"";
-
-echo "${cmd}";
-eval "${cmd}";
-
-# Fetch the next stage's configuration
-nextJobName="5-HDP-Deploy";
-nextJobConfigFile="${perBuildWorkspace}/${nextJobName}.config.xml";
-
-cmd="fetchJobConfigTemplate ${nextJobName} ${nextJobConfigFile}";
-
-echo "${cmd}";
-eval "${cmd}";
-
-# Modify this fetched config to take into account the output of all the jobs till now.
-
-isHBaseInstalled=`isServiceInstalledForCluster "${clusterName}" "HBase"`;
-isPigInstalled=`isServiceInstalledForCluster "${clusterName}" "Pig"`;
-isHCatalogInstalled=`isServiceInstalledForCluster "${clusterName}" "HCatalog"`;
-isTempletonInstalled=`isServiceInstalledForCluster "${clusterName}" "Templeton"`;
-isOozieInstalled=`isServiceInstalledForCluster "${clusterName}" "Oozie"`;
-isSqoopInstalled=`isServiceInstalledForCluster "${clusterName}" "Sqoop"`;
-
-nameNodeHost=`getServiceHost "namenode"`;
-secondaryNameNodeHost=`getServiceHost "snamenode"`;
-jobTrackerHost=`getServiceHost "jobtracker"`;
-gangliaCollectorHost=`getServiceHost "gangliaserver"`;
-nagiosServerHost=`getServiceHost "nagiosserver"`;
-
-optionalServicesConfigChoicesXml=`generateOptionalServicesConfigChoicesXml \
-  "${isHBaseInstalled}" "${isHCatalogInstalled}" "${isTempletonInstalled}" "${isOozieInstalled}"`;
-
-cmd="sed -i.prev \
-	-e \"s!@HDPInstallHBaseChoice@!${isHBaseInstalled}!g\" \
-	-e \"s!@HDPInstallPigChoice@!${isPigInstalled}!g\" \
-	-e \"s!@HDPInstallHCatalogChoice@!${isHCatalogInstalled}!g\" \
-	-e \"s!@HDPInstallTempletonChoice@!${isTempletonInstalled}!g\" \
-	-e \"s!@HDPInstallOozieChoice@!${isOozieInstalled}!g\" \
-	-e \"s!@HDPInstallSqoopChoice@!${isSqoopInstalled}!g\" \
-	-e \"s!@HDPNameNodeHostChoice@!${nameNodeHost}!g\" \
-	-e \"s!@HDPSecondaryNameNodeHostChoice@!${secondaryNameNodeHost}!g\" \
-	-e \"s!@HDPJobTrackerHostChoice@!${jobTrackerHost}!g\" \
-	-e \"s!@HDPGangliaCollectorHostChoice@!${gangliaCollectorHost}!g\" \
-	-e \"s!@HDPNagiosServerHostChoice@!${nagiosServerHost}!g\" \
-	-e \"s!@HDPOptionalServicesConfigChoices@!${optionalServicesConfigChoicesXml}!g\" \
-      ${nextJobConfigFile}";
-
-echo "${cmd}";
-eval "${cmd}";
-
-# "Pipe" the output of this job into the next one's configuration.
-cmd="curl -H \"Content-Type: text/xml\" -d @${nextJobConfigFile} ${JENKINS_URL}job/${nextJobName}/config.xml";
-
-echo "${cmd}";
-eval "${cmd}";
-
-# XXX TODO Advance the stage disk cookie.

+ 0 - 176
hmc/archive/ShellScripts/dbLib.sh

@@ -1,176 +0,0 @@
-#!/bin/sh
-
-#/*
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# *
-# *     http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# */
-
-##################################
-###### INCLUDE REQUIREMENTS ######
-##################################
-#
-# * dbLib.sh
-#
-##################################
-
-PREVIOUS_VERSION_SUFFIX=".prev";
-
-function getClusterDbDir
-{
-  clusterName=${1};
-
-  if [ "x" != "x${clusterName}" ]
-  then
-    echo "${EASYINSTALLER_DB_DIR}/${clusterName}";
-  fi
-}
-
-function initDbForCluster
-{
-  clusterDbDir=`getClusterDbDir ${1}`;
-
-  if [ "x" != "x${clusterDbDir}" ]
-  then
-    clusterDbDirVersioned="${clusterDbDir}.`date +%s`";
-
-    # Create the actual new DB directory (versioned with a timestamp).
-    mkdir -p "${clusterDbDirVersioned}";
-
-    if [ -L "${clusterDbDir}" ] 
-    then
-      clusterDbDirPrevious="${clusterDbDir}${PREVIOUS_VERSION_SUFFIX}";
-
-      # There's about to be a new ${clusterDbDirPrevious}, so get the existing
-      # one out of the way.
-      if [ -L "${clusterDbDirPrevious}" ]
-      then
-        rm -f "${clusterDbDirPrevious}";
-      fi
-
-      # Roll the current "current" over...
-      ln -s `readlink -n "${clusterDbDir}"` "${clusterDbDirPrevious}";
-      # ...and make way for the new "current".
-      rm -f "${clusterDbDir}";
-    fi
-
-    # Mark the newly-created version as "current".
-    ln -s ${clusterDbDirVersioned} ${clusterDbDir};
-
-    # And from here on, work with ${clusterDbDir} as if it were the only version in existence.
-    mkdir -p ${clusterDbDir}/conf;
-    mkdir -p ${clusterDbDir}/cookies;
-    mkdir -p ${clusterDbDir}/files;
-  else
-    echo "Can't init DB for empty clusterName"
-    return 1;
-  fi
-}
-
-function storeDbFileForCluster
-{
-  clusterDbDir=`getClusterDbDir ${1}`;
-
-  if [ "x" != "x${clusterDbDir}" ] && [ "x" != "x${2}" ] && [ "x" != "x${3}" ]
-  then
-    storedFile="${clusterDbDir}/files/${2}";
-    sourceFile="${3}";
-
-    # Make sure we preserve modes, perms etc.
-    [ -e "${sourceFile}" ] && cp -pf "${sourceFile}" "${storedFile}" && echo "${storedFile}";
-  fi 
-}
-
-function fetchDbFileForCluster
-{
-  clusterDbDir=`getClusterDbDir ${1}`;
-
-  if [ "x" != "x${clusterDbDir}" ] && [ "x" != "x${2}" ]
-  then
-    storedFile="${clusterDbDir}/files/${2}";
-
-    [ -e "${storedFile}" ] && echo "${storedFile}";
-  fi 
-}
-
-function storeDbConfForCluster
-{
-  clusterDbDir=`getClusterDbDir ${1}`;
-
-  if [ "x" != "x${clusterDbDir}" ] && [ "x" != "x${2}" ] && [ "x" != "x${3}" ]
-  then
-    storedConfFile="${clusterDbDir}/conf/${2}";
-    newConfReplacements="${3}";
-
-    # The first store needs us to copy in the template for ${storedConfFile}.
-    # Subsequent stores will build on this previously-partially-instantiated 
-    # template.
-    if [ ! -e "${storedConfFile}" ]
-    then
-      confTemplateFile="${EASYINSTALLER_CONF_TEMPLATES_DIR}/${2}.in";
-      cp "${confTemplateFile}" "${storedConfFile}";
-    fi
-
-    sedCmd="sed -i.prev";
-
-    # It's crucial that ${newConfReplacements} not be quoted here so it behaves
-    # like a stream with one expression per line.
-    for sedExpression in ${newConfReplacements}
-    do
-      sedCmd="${sedCmd} -e \"${sedExpression}\""; 
-    done
-
-    sedCmd="${sedCmd} ${storedConfFile}";
-
-    echo "${sedCmd}";
-    eval "${sedCmd}";
-  fi
-}
-
-function fetchDbConfForCluster
-{
-  clusterDbDir=`getClusterDbDir ${1}`;
-
-  if [ "x" != "x${clusterDbDir}" ] && [ "x" != "x${2}" ]
-  then
-    storedConfFile="${clusterDbDir}/conf/${2}";
-
-    [ -e "${storedConfFile}" ] && echo "${storedConfFile}";
-  fi 
-}
-
-function storeDbCookieForCluster
-{
-  clusterDbDir=`getClusterDbDir ${1}`;
-
-  if [ "x" != "x${clusterDbDir}" ] && [ "x" != "x${2}" ] && [ "x" != "x${3}" ]
-  then
-    storedCookieFile="${clusterDbDir}/cookies/${2}";
-
-    echo "${3}" > "${storedCookieFile}";
-  fi 
-}
-
-function fetchDbCookieForCluster
-{
-  clusterDbDir=`getClusterDbDir ${1}`;
-
-  if [ "x" != "x${clusterDbDir}" ] && [ "x" != "x${2}" ]
-  then
-    storedCookieFile="${clusterDbDir}/cookies/${2}";
-
-    [ -e "${storedCookieFile}" ] && getFirstWordFromFile "${storedCookieFile}";
-  fi 
-}

+ 0 - 179
hmc/archive/ShellScripts/deploy.sh

@@ -1,179 +0,0 @@
-#!/bin/sh
-
-#/*
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# *
-# *     http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# */
-
-baseDir=`dirname ${0}`;
-
-source ${baseDir}/easyInstallerLib.sh;
-source ${baseDir}/dbLib.sh;
-source ${baseDir}/servicesLib.sh;
-
-###########################
-### FILE-SCOPED GLOBALS ###
-###########################
-
-# TODO XXX Take this in from the UI in the future (and likely store it as a 
-# marker on disk, to really be of any use).
-clusterName="MyHDPCluster";
-
-#############
-### SETUP ###
-#############
-
-# XXX XXX RESUME FROM HERE
-###checkpointedStageNumber=`fetchDbCookieForCluster "${clusterName}" "${CHECKPOINTED_STAGE_NUMBER_COOKIE_NAME}"`;
-###
-###currentStageName="1-HDP-Initialize-Cluster";
-###currentStageNumber=`getStageNumberFromName "${currentStageName}"`;
-###
-###currentStageCanRun=`isStageTransitionAdmissable "${checkpointedStageNumber}" "${currentStageNumber}"`;
-###
-###if [ "${currentStageCanRun}" != "1" ]
-###then
-###  echo "Inadmissable stage transition attempted - bailing out.";
-###  exit 1;
-###fi
-
-# Create our per-build workspace - it's a shame Jenkins doesn't provide this for us.
-perBuildWorkspace=${WORKSPACE}/${BUILD_NUMBER};
-
-cmd="mkdir ${perBuildWorkspace}";
-
-echo "${cmd}";
-eval "${cmd}";
-
-######################
-### PRE-PROCESSING ###
-######################
-
-# Stage gsInstaller.
-
-# 0) Create the staging directory.
-stagingDirectory="${perBuildWorkspace}/gsInstaller";
-
-cmd="mkdir ${stagingDirectory}";
-
-echo "${cmd}";
-eval "${cmd}";
-
-# 1) Copy the sources over to ${stagingDirectory}.
-cmd="cp -r ${GSINSTALLER_SCRIPTS_DIR}/* ${stagingDirectory}";
-
-echo "${cmd}";
-eval "${cmd}";
-
-# 2) Pull in the customized (till this point in the flow) .properties files.
-for propertiesFile in "${GSINSTALLER_PROPERTIES_CONF_NAME}" "${GSCLUSTER_PROPERTIES_CONF_NAME}"
-do
-  storedPropertiesFile=`fetchDbConfForCluster "${clusterName}" "${propertiesFile}"`;
-
-  cmd="cp -pf ${storedPropertiesFile} ${stagingDirectory}";
-
-  echo "${cmd}";
-  eval "${cmd}";
-done
- 
-# 3) Pull in all the flat node files.
-for nodeFile in "namenode" "snamenode" "jobtracker" "dashboard" "gangliaserver" "gateway" "hbasemaster" "hbasenodes" "hcatserver" "nagiosserver" "nodes" "oozieserver" "templetonnode" "zknodes"
-do
-  storedNodeFile=`fetchDbFileForCluster "${clusterName}" "${nodeFile}"`;
-
-  cmd="cp -pf ${storedNodeFile} ${stagingDirectory}";
-
-  echo "${cmd}";
-  eval "${cmd}";
-done
-
-# And we're done!
-
-######################
-### THE MAIN EVENT ###
-######################
-
-# XXX TODO Break this into separate commands and work upon the exit code of each.
-jobCmd="cd ${stagingDirectory}; sh createUsers.sh; sh gsPreRequisites.sh; echo y | sh gsInstaller.sh; echo y | sh monInstaller.sh;";
-#jobCmd="cd ${stagingDirectory}; echo *******xxxyyyzzz********;";
-
-echo "${jobCmd}";
-eval "${jobCmd}";
-
-jobExitCode=$?;
-
-#######################
-### POST-PROCESSING ###
-#######################
-
-# Mark the start/stop status of all the installed services on disk.
-
-for serviceName in "HDFS" "MapReduce" "HBase" "HCatalog" "Templeton" "Oozie"
-do
-  serviceIsInstalled=`isServiceInstalledForCluster "${clusterName}" "${serviceName}"`;
-
-  # Generate customized variables, one for each ${serviceName}, for use below.
-  eval "is${serviceName}Installed=${serviceIsInstalled}";
-
-  if [ "xyes" == "x${serviceIsInstalled}" ]
-  then
-    if [ "x0" == "x${jobExitCode}" ]
-    then
-      markServiceAsStartedForCluster "${clusterName}" "${serviceName}";
-    else
-      markServiceAsStoppedForCluster "${clusterName}" "${serviceName}";
-    fi
-  fi
-done
-
-# Update the downstream pages' configurations accordingly.
-
-# Fetch the next page's configuration.
-nextJobName="HDP-Manage-Services";
-nextJobConfigFile="${perBuildWorkspace}/${nextJobName}.config.xml";
-
-cmd="fetchJobConfigTemplate ${nextJobName} ${nextJobConfigFile}";
-
-echo "${cmd}";
-eval "${cmd}";
-
-# Modify this fetched config to take into account the output of all the jobs till now.
-
-hdfsStatusChoices=`generateServiceStatusChoicesForCluster "${clusterName}" "HDFS"`;
-mapReduceStatusChoices=`generateServiceStatusChoicesForCluster "${clusterName}" "MapReduce"`;
-
-# Note that the is${serviceName}Installed variables were generated and set in the
-# loop above that invokes markServiceAsStartedForCluster() for each ${serviceName}.
-optionalServicesStatusChoicesXml=`generateOptionalServicesStatusChoicesXmlForCluster \
-  "${clusterName}" \
-  "${isHBaseInstalled}" "${isHCatalogInstalled}" "${isTempletonInstalled}" "${isOozieInstalled}"`;
-
-cmd="sed -i.prev \
-	-e \"s!@HDPHDFSStatusChoices@!${hdfsStatusChoices}!g\" \
-	-e \"s!@HDPMapReduceStatusChoices@!${mapReduceStatusChoices}!g\" \
-	-e \"s!@HDPOptionalServicesStatusChoices@!${optionalServicesStatusChoicesXml}!g\" \
-      ${nextJobConfigFile}";
-
-echo "${cmd}";
-eval "${cmd}";
-
-# "Pipe" the output of this job into the relevant job's configuration.
-cmd="curl -H \"Content-Type: text/xml\" -d @${nextJobConfigFile} ${JENKINS_URL}job/${nextJobName}/config.xml";
-
-echo "${cmd}";
-eval "${cmd}";
-
-# XXX TODO Advance the stage disk cookie.

+ 0 - 55
hmc/archive/ShellScripts/discoverNodes.sh

@@ -1,55 +0,0 @@
-maxNodes=0
-maxNodesFile=$(wc -l $easyInstallInput)
-
-for words in $maxNodesFile
-do
-  maxNodes=$words
-  break
-done
-
-nodes=$(cat $easyInstallInput)
-
-cmd=
-cmdOut=
-maxMem=
-maxCPU=
-node=
-
-execSshCmd() {
-  echo "Executing cmd: "
-  [ "$sshkey" == "" ] && echo "ssh $HDPClusterDeployUser@$node $cmd" && cmdOut=`ssh -o StrictHostKeyChecking=no $HDPClusterDeployUser@$node $cmd`
-  [ "$sshkey" != "" ] && echo "ssh -o StrictHostKeyChecking=no -i $sshkey $HDPClusterDeployUser@$node $cmd" \
-&& cmdOut=`ssh -o StrictHostKeyChecking=no -i $sshkey $HDPClusterDeployUser@$node $cmd` 
-}
-
-echo "SSHKEY is : " $sshkey
-echo "OutputFile: " $easyInstallOut
-
-for node in $nodes
-do
-  echo "Node: $node"
-  cmd='free -mt | tail -1'
-  execSshCmd
-  echo "$node: run free"
-  memFree=`echo $cmdOut | awk '{ print $NF }'`
-
-  cmd='grep -c processor /proc/cpuinfo'
-  execSshCmd
-  echo "$node: find proc count"
-  cpuCount=$cmdOut
-
-  cmd='uname -m'
-  execSshCmd
-  echo "$node: find processor arch"
-  osType=$cmdOut
-
-  cmd='df -klh | grep -v Filesystem'
-  execSshCmd
-  echo "$node: find disks"
-  MountPoints=$cmdOut
-  echo "xxx"
-
-  echo $node $memFree $cpuCount $osType >> $easyInstallOut
-  echo "yyy"
-done
-

+ 0 - 105
hmc/archive/ShellScripts/easyInstallerLib.sh

@@ -1,105 +0,0 @@
-#!/bin/sh
-
-#/*
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# *
-# *     http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# */
-
-#################
-### CONSTANTS ###
-#################
-
-# Meant to be used in the future to deal with upgrades and downgrades.
-# XXX Remember to update this with every release of EasyInstaller. 
-HDP_VERSION_STRING="HDP-1.0.4-Preview-6";
-
-# We assume these are created by the RPM.
-EASYINSTALLER_DB_DIR="/var/db/hdp/easyInstaller";
-EASYINSTALLER_CONF_TEMPLATES_DIR="/etc/hdp/easyInstaller/templates";
-EASYINSTALLER_SCRIPTS_DIR="/usr/libexec/hdp/easyInstaller";
-GSINSTALLER_SCRIPTS_DIR="/usr/libexec/hdp/gsInstaller";
-
-GSINSTALLER_PROPERTIES_CONF_NAME="gsInstaller.properties";
-GSCLUSTER_PROPERTIES_CONF_NAME="gsCluster.properties";
-
-INSTALLED_HDP_VERSION_COOKIE_NAME="installedHDPVersion";
-CHECKPOINTED_STAGE_NUMBER_COOKIE_NAME="checkpointedStageNumber";
-
-CLUSTER_DEPLOY_USER_IDENTITY_FILE_NAME="clusterDeployUserIdentity";
-CLUSTER_HOSTS_FILE_NAME="clusterHosts";
-NAMENODE_MOUNT_POINTS_FILE_NAME="NameNodeMountPointsSuggest.out";
-
-# XXX TODO Remove this temporary hack once we figure out why Jenkins is not 
-#          pushing the advertised keys into the environment.
-JENKINS_URL="http://localhost:9040/"
-
-#################
-### FUNCTIONS ###
-#################
-
-function true2yes
-{
-  # Anything other than exactly "true" results in "no".
-  local answer="no";
-
-  if [ "xtrue" == "x${1}" ]
-  then
-    answer="yes";
-  fi
-
-  echo "${answer}";
-}
-
-function fetchJobConfigTemplate
-{
-  local jobName="${1}";
-  local jobConfigTemplateDestinationFile="${2}";
-
-  if [ "x" != "x${jobName}" ] && [ "x" != "x${jobConfigTemplateDestinationFile}" ]
-  then
-    cp -pf "${EASYINSTALLER_CONF_TEMPLATES_DIR}/jobs/${jobName}/config.xml" "${jobConfigTemplateDestinationFile}";
-  else
-    return 1;
-  fi
-}
-
-function getFirstWordFromFile
-{
-  local firstWord="";
-  local absFilePath="${1}";
-
-  if [ "x" != "x${absFilePath}" ] && [ -e "${absFilePath}" ]
-  then
-    firstWord=`head -1 ${absFilePath} | awk '{print $1;}'`;
-  fi
-
-  echo "${firstWord}";
-}
-
-function wrapWithXMLTag
-{
-  local wrappedOutput="";
-
-  local xmlTag="${1}";
-  local wrappedEntity="${2}";
-
-  if [ "x" != "x${xmlTag}" ] && [ "x" != "x${wrappedEntity}" ]
-  then
-    wrappedOutput="<${xmlTag}>${wrappedEntity}</${xmlTag}>";
-  fi
-
-  echo "${wrappedOutput}";
-}

+ 0 - 98
hmc/archive/ShellScripts/generateNodeFiles.sh

@@ -1,98 +0,0 @@
-property=$1
-OutputDir=$2
-
-[ -f $property ] && source $property
-
-`echo $HDPNameNodeHost > $OutputDir/namenode`
-`echo $HDPSecondaryNameNodeHost > $OutputDir/snamenode`
-`echo $HDPJobTrackerHost > $OutputDir/jobtracker`
-`echo $HDPHBaseMasterHost > $OutputDir/hbasemaster`
-`echo $HDPHCatalogServerHost > $OutputDir/hcatserver`
-`echo $HDPGangliaCollectorHost > $OutputDir/gangliaserver`
-`echo $HDPNagiosServerHost > $OutputDir/nagiosserver`
-`echo $HDPOozieServerHost > $OutputDir/oozieserver`
-`echo $HDPTempletonNodeHost > $OutputDir/templetonnode`
-
-## dashboardhost same as nagios.
-`echo $HDPNagiosServerHost > $OutputDir/dashboardhost`
-
-## slaves are present in the file referred by the nodes env variable
-## gateway = any slave.
-`cat $HDPClusterHostsFile | grep -vwE "$HDPNameNodeHost|$HDPSecondaryNameNode|$HDPJobTrackerHost|$HDPHBaseMasterHost|$HDPHCatServerHost|$HDPGangliaCollectorHost|$HDPNagiosServerHost|$HDPOozieServerHost|$HDPTempletonHost" | sort | uniq > $OutputDir/nodes`
-
-maxNodes=
-getLineCountofNodes()
-{
-  lineCount=`wc -l $OutputDir/nodes`
-  for words in $lineCount
-  do
-    maxNodes=$words
-    break
-  done
-}
-
-getLineCountofNodes
-[ $maxNodes == 0 ] `cat $HDPClusterHostsFile > $OutputDir/nodes`
-getLineCountofNodes
-
-linenum=0
-getNodeAtLineNum()
-{
-  linenum=$((linenum+1))  
-  if [ "$linenum" -gt "$maxNodes" ]; then
-    if [ "$maxNodes" -gt 0 ]; then
-      linenum=1
-    else
-      linenum=$maxNodes
-    fi
-  fi
-}
-
-outFile=
-writeNodeToFile()
-{
-  `awk "NR==$linenum{print;exit}" $OutputDir/nodes > $outFile`
-}
-
-appendNodeToFile()
-{
-  `awk "NR==$linenum{print;exit}" $OutputDir/nodes >> $outFile`
-}
-
-## Gateway host out
-outFile=$OutputDir/gateway
-if [ "$gwhost" != "" ]; then
-  `echo $gwhost > $outFile`
-else
-  getNodeAtLineNum
-  writeNodeToFile
-fi
-
-## Zookeeper
-## zknodes = 3 or lesser if lesser slaves.
-outFile=$OutputDir/zknodes
-if [ $maxNodes -gt 3 ]; then
-  getNodeAtLineNum
-  writeNodeToFile
-  getNodeAtLineNum
-  appendNodeToFile
-  getNodeAtLineNum
-  appendNodeToFile
-else
-  `cat $OutputDir/nodes > $outFile`
-fi
-
-
-## HBase slaves are all slave nodes
-`cat $OutputDir/nodes > $OutputDir/hbasenodes`
-
-getNameNodeMountPoint()
-{
-  cmd="df -klh | sed \"1 d\" | grep -vw \"/boot\" | grep -vw \"/dev\/shm\" | grep -vw \"/home\" | grep -vw \/ | awk '{ print \$(NF)}'"
-  [ "$HDPClusterDeployUserIdentityFile" == "" ] && `ssh -o StrictHostKeyChecking=no $HDPClusterDeployUser@$HDPNameNodeHost $cmd > $1`
-  [ "$HDPClusterDeployUserIdentityFile" != "" ] && `ssh -o StrictHostKeyChecking=no -i $HDPClusterDeployUserIdentityFile $HDPClusterDeployUser@$HDPNameNodeHost $cmd > $1`
-}
-
-outfile=$OutputDir/NameNodeMountPointsSuggest.out
-getNameNodeMountPoint $outfile
-

+ 0 - 70
hmc/archive/ShellScripts/pdshDiscoverNodes.sh

@@ -1,70 +0,0 @@
-maxNodes=0
-maxNodesFile=$(wc -l $easyInstallInput)
-
-for words in $maxNodesFile
-do
-  maxNodes=$words
-  break
-done
-
-nodes=$(cat $easyInstallInput)
-
-pdshExists=`which pdsh`
-if [ "x" != "x${pdshExists}" ]; then
-  usePdsh="yes"
-fi
-
-cmd=
-cmdOut=
-maxMem=
-maxCPU=
-node=
-
-execSshCmd() {
-  echo "Executing cmd: "
-  [ "$sshkey" == "" ] && echo "ssh $HDPClusterDeployUser@$node $cmd" && cmdOut=`ssh -o StrictHostKeyChecking=no $HDPClusterDeployUser@$node $cmd`
-  [ "$sshkey" != "" ] && echo "ssh -o StrictHostKeyChecking=no -i $sshkey $HDPClusterDeployUser@$node $cmd" \
-&& cmdOut=`ssh -o StrictHostKeyChecking=no -i $sshkey $HDPClusterDeployUser@$node $cmd` 
-}
-
-echo "SSHKEY is : " $sshkey
-echo "OutputFile: " $easyInstallOut
-
-execPdsh () {
-  commaSepNodes=`commaSeparatedHostList ${nodes}`
-  if [ "$sshkey" == "" ]; then
-    pdsh -R exec -w $commaSepNodes $*
-  fi
-}
-
-if [ $usepdsh == "yes" ]; then
-fi
-
-for node in $nodes
-do
-  echo "Node: $node"
-  cmd='free -mt | tail -1'
-  execSshCmd
-  echo "$node: run free"
-  memFree=`echo $cmdOut | awk '{ print $NF }'`
-
-  cmd='grep -c processor /proc/cpuinfo'
-  execSshCmd
-  echo "$node: find proc count"
-  cpuCount=$cmdOut
-
-  cmd='uname -m'
-  execSshCmd
-  echo "$node: find processor arch"
-  osType=$cmdOut
-
-  cmd='df -klh | grep -v Filesystem'
-  execSshCmd
-  echo "$node: find disks"
-  MountPoints=$cmdOut
-  echo "xxx"
-
-  echo $node $memFree $cpuCount $osType >> $easyInstallOut
-  echo "yyy"
-done
-

+ 0 - 227
hmc/archive/ShellScripts/pdshSuggestMem.sh

@@ -1,227 +0,0 @@
-inputDir=$1
-outputFile=$3
-inputFile=$2
-maxMapsPerNode=4
-maxRedsPerNode=2
-check=$4
-echo XXXX $inputFile XXXX
-echo XXXX $inputDir XXXX
-echo XXXX $outputFile XXXX
-
-source $inputFile
-
-cd $inputDir
-[[ -f "gateway" ]] && gwhost=$(cat gateway)
-[[ -f "namenode" ]] && nnhost=$(cat namenode)
-[[ -f "snamenode" ]] && snhost=$(cat snamenode)
-[[ -f "jobtracker" ]] && jthost=$(cat jobtracker)
-[[ -f "hbasemaster" ]] && hbmhost=$(cat hbasemaster)
-[[ -f "hcatserver" ]] && hcshost=$(cat hcatserver)
-[[ -f "templetonnode" ]] && ttonhosts=$(cat templetonnode)
-[[ -f "oozieserver" ]] && oozieshost=$(cat oozieserver)
-[[ -f "nodes" ]] && slaves=$(cat nodes)
-[[ -f "hbasenodes" ]] && rshosts=$(cat hbasenodes)
-[[ -f "zknodes" ]] && zkhosts=$(cat zknodes)
-[[ -f "gangliaserver" ]] && gangliahost=$(cat gangliaserver)
-[[ -f "nagiosserver" ]] && nagioshost=$(cat nagiosserver)
-
-maxMem=
-heapSizeSuggest=
-ConnectTimeOut=3
-sshCmdOnHost ()
-{
-  local cmd="ssh -o ConnectTimeOut=$ConnectTimeOut -o StrictHostKeyChecking=no -i $HDPClusterDeployUserIdentityFile $HDPClusterDeployUser@$1 \"$2\" > $3"
-  echo $cmd
-  eval $cmd
-}
-
-findMaxMemOnHost ()
-{
-  #  echo "SSHCMD: ssh -i /var/db/hdp/easyInstaller/MyHDPCluster/files/clusterDeployUserIdentity root@$1 \"free -m | sed \\\"1 d\\\" | awk '{print \\\$4}' | sed -n 1p\""
-  sshCmdOnHost $1 "free -m" "${PWD}/tmpMem.out"
-#  ssh -i $HDPClusterDeployUserIdentityFile $HDPClusterDeployUser@$1 "free -m" > tmpMem.out
-  maxMem=`cat $PWD/tmpMem.out | sed "1 d" | awk '{print $4}' | sed -n 1p`
-}
-
-scaleByThreads=2
-scaleRelativeMapsReds=3
-minMapsPerNode=1000
-minRedsPerNode=1000
-findMaxCoresOnHost ()
-{
-  sshCmdOnHost $1 "grep -c processor /proc/cpuinfo" ${PWD}/tmpCpu.out
-  cpuCount=`cat ${PWD}/tmpCpu.out`
-  maxMapsPerNode=`expr $cpuCount \* $scaleByThreads \* 2 / $scaleRelativeMapsReds`
-  maxRedsPerNode=`expr $cpuCount \* $scaleByThreads - $maxMapsPerNode`
-  totalProcessesPerSlave=`expr $maxMapsPerNode + $maxRedsPerNode`
-
-  if [ $maxMapsPerNode -lt 1 ]; then 
-    maxMapsPerNode=1
-  fi
-
-  if [ $maxRedsPerNode -lt 1 ]; then
-    maxRedsPerNode=1
-  fi
-
-  if [ $maxMapsPerNode -lt $minMapsPerNode ]; then
-    minMapsPerNode=$maxMapsPerNode
-  fi
-
-  if [ $maxRedsPerNode -lt $minRedsPerNode ]; then
-    minRedsPerNode=$maxRedsPerNode
-  fi
-  
-  echo CPUCOUNT: $cpuCount
-}
-
-list=
-for slave in $(echo $slaves)
-do
-  findMaxCoresOnHost $slave
-done
-
-maxMapsPerNode=$minMapsPerNode
-maxRedsPerNode=$minRedsPerNode
-
-if [ $check -eq 1 ]; then
-  userInputProperties=$5
-  source $userInputProperties
-fi
-
-#### -2 because -1 for count to go to 0 and -1 for allHosts
-totalProcessesPerSlave=`expr $maxMapsPerNode + $maxRedsPerNode - 2`
-list=$slaves
-while [ $totalProcessesPerSlave -ne 0 ];
-do
-totalProcessesPerSlave=`expr $totalProcessesPerSlave - 1`
-list="$list $slaves"
-done
-
-
-allHosts=`echo $slaves $jthost $nnhost $snhost $gwhost $hbmhost $hcshost $rshosts $zkhosts $nagioshost $gangliahost $list`
-# echo ALLHOSTS: $allHosts
-
-findForNodeType ()
-{
-  echo Hostname: $1
-  hostname=$1
-  echo "grep -o $1 <<< \"$allHosts\" | wc -l"
-  procCount=`grep -o $1 <<< "$allHosts" | wc -l`
-  echo PROCCOUNT: $procCount
-  findMaxMemOnHost $1
-#  findMaxCoresOnHost $1
-  echo MAXMEM: $maxMem
-  heapSizeSuggest=`expr $maxMem / $procCount`
-}
-
-echo NAMENODE $nnhost
-findForNodeType $nnhost
-nameNodeHeapSizeSuggest=$heapSizeSuggest
-echo "HDPNameNodeHeapSize ${heapSizeSuggest}" > $outputFile
-
-echo JOBTRACKER $jthost
-findForNodeType $jthost
-jobTrackerHeapSizeSuggest=$heapSizeSuggest
-echo "HDPJobTrackerHeapSize ${heapSizeSuggest}" >> $outputFile
-
-echo HBASEMASTER $hbmhost
-if [ "x" != "x$hbmhost" ]; then
-  findForNodeType $hbmhost
-  hbmHeapSizeSuggest=$heapSizeSuggest
-  echo "HDPHBaseMasterHeapSize=${heapSizeSuggest}" >> $outputFile
-fi
-
-# for now max value assumed to be 100G 
-minSuggest=100000000000
-for node in $(echo $slaves)
-do
-  findForNodeType $node
-  if [ "$minSuggest" -gt "$heapSizeSuggest" ]; then
-    minSuggest=$heapSizeSuggest
-  fi
-done
-
-echo DATANODE
-dataNodeHeapSizeSuggest=$minSuggest
-echo "HDPDataNodeHeapSize ${minSuggest}" >> $outputFile
-echo HADOOPHEAP
-hadoopHeapSizeSuggest=$minSuggest
-echo "HDPHadoopHeapSize ${minSuggest}" >> $outputFile
-echo CHILDOPTS
-childJavaOptsSize=$minSuggest
-echo "HDPMapRedChildJavaOptsSize ${minSuggest}" >> $outputFile
-
-echo "HDPMapRedMapTasksMax ${maxMapsPerNode}" >> $outputFile
-echo "HDPMapRedReduceTasksMax ${maxRedsPerNode}" >> $outputFile
-
-rm -f $PWD/tmpCpu.out $PWD/tmpMem.out
-
-checkAlpha ()
-{
-  num=$1
-  expr $num + 1 2> /dev/null
-  if [ $? = 0 ]; then
-    echo -n ""
-  else
-    echo "ERROR: Value was non-numeric"
-    exit 1;
-  fi
-
-  if [ $num -lt 0 ]; then
-    echo "ERROR: Invalid value less than 0"
-    exit 1;
-  fi
-}
-
-checkConfig ()
-{
-  echo "Checking Namenode heap size"
-  checkAlpha $nameNodeHeapSizeSuggest
-
-  echo "Checking Namenode heap size"
-  checkAlpha $jobTrackerHeapSizeSuggest
-
-  echo "Checking Namenode heap size"
-  checkAlpha $hbmHeapSizeSuggest
-
-  echo "Checking Namenode heap size"
-  checkAlpha $dataNodeHeapSizeSuggest
-
-  echo "Checking Namenode heap size"
-  checkAlpha $hadoopHeapSizeSuggest
-
-  if [ $HDPNameNodeHeapSize -gt $nameNodeHeapSizeSuggest ]; then
-    exit 1;
-    echo ERROR: Insufficient heap size for Name Node.
-  fi
-
-  if [ $HDPJobTrackerHeapSize -gt $jobTrackerHeapSizeSuggest ]; then
-    exit 1;
-    echo ERROR: Insufficient heap size for JobTracker.
-  fi
-
-  if [ $HDPHBaseMasterHeapSize -gt $hbmHeapSizeSuggest ]; then
-    exit 1;
-    echo ERROR: Insufficient heap size for HBase Master.
-  fi
-
-  if [ $HDPDataNodeHeapSize -gt $dataNodeHeapSizeSuggest ]; then
-    exit 1;
-    echo ERROR: Insufficient heap size for Data Node.
-  fi
-
-  ## May not be checked. If the user does not want to use the 
-  ## above conservative method, this can be masked
-  if [ $HDPHadoopHeapSize -gt $hadoopHeapSizeSuggest ]; then
-    exit 1;
-    echo ERROR: Insufficient heap size for Hadoop Heap.
-  fi
-
-#  if [ $HDPMapRedChildJavaOptsSize -gt $childJavaOptsSize ]; then
-#    echo ERROR: Insufficient heap size for Child Java Opts.
-#  fi
-}
-
-if [ $check -eq 1 ]; then
-  checkConfig
-fi

+ 0 - 207
hmc/archive/ShellScripts/servicesLib.sh

@@ -1,207 +0,0 @@
-#!/bin/sh
-
-#/*
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# *
-# *     http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# */
-
-##################################
-###### INCLUDE REQUIREMENTS ######
-##################################
-#
-# * easyInstallerLib.sh
-# * dbLib.sh
-#
-##################################
-
-#################
-### FUNCTIONS ###
-#################
-
-function getServiceStatusForCluster
-{
-  local serviceStatus="";
-
-  local clusterName="${1}";
-  local serviceName="${2}";
-
-  if [ "x" != "x${clusterName}" ] && [ "x" != "x${serviceName}" ]
-  then
-    serviceStatus=`fetchDbCookieForCluster "${clusterName}" "${serviceName}"`;
-  fi
-
-  echo "${serviceStatus}";
-}
-
-function isServiceInstalledForCluster
-{
-  local serviceIsInstalled="no";
-
-  local serviceStatus=`getServiceStatusForCluster "$@"`;
-
-  if [ "x" != "x${serviceStatus}" ]
-  then
-    serviceIsInstalled="yes";
-  fi
-
-  echo "${serviceIsInstalled}";
-}
-
-function isServiceStartedForCluster
-{
-  local serviceIsStarted="no";
-
-  local serviceStatus=`getServiceStatusForCluster "$@"`;
-
-  if [ "x1" == "x${serviceStatus}" ]
-  then
-    serviceIsStarted="yes";
-  fi
-
-  echo "${serviceIsStarted}";
-}
-
-function isServiceStoppedForCluster
-{
-  local serviceIsStopped="no";
-
-  local serviceStatus=`getServiceStatusForCluster "$@"`;
-
-  if [ "x0" == "x${serviceStatus}" ]
-  then
-    serviceIsStopped="yes";
-  fi
-
-  echo "${serviceIsStopped}";
-}
-
-function setServiceStatusForCluster
-{
-  local clusterName="${1}";
-  local serviceName="${2}";
-  local serviceStatus="${3}";
-
-  if [ "x" != "x${clusterName}" ] && [ "x" != "x${serviceName}" ] && [ "x" != "x${serviceStatus}" ]
-  then
-    storeDbCookieForCluster "${clusterName}" "${serviceName}" "${serviceStatus}";
-  fi
-}
-
-function markServiceAsStartedForCluster
-{
-  setServiceStatusForCluster "$@" "1";
-}
-
-function markServiceAsStoppedForCluster
-{
-  setServiceStatusForCluster "$@" "0";
-}
-
-function generateServiceStatusChoicesForCluster
-{
-  local serviceStatusChoices="";
-
-  local clusterName="${1}";
-  local serviceName="${2}";
-
-  if [ "x" != "x${clusterName}" ] && [ "x" != "x${serviceName}" ]
-  then
-    local currentStatusChoice="";
-
-    local serviceIsStarted=`isServiceStartedForCluster "${clusterName}" "${serviceName}"`;
-
-    if [ "xyes" == "x${serviceIsStarted}" ]
-    then
-      currentStatusChoice=`wrapWithXMLTag "string" "Started"`;
-    else
-      currentStatusChoice=`wrapWithXMLTag "string" "Stopped"`;
-    fi 
-
-    serviceStatusChoices="${currentStatusChoice}";
-  fi
-
-  echo "${serviceStatusChoices}";
-}
-
-function generateServiceStatusChoicesXmlForCluster
-{
-  local serviceStatusChoicesXml="";
-
-  local clusterName="${1}";
-  local serviceName="${2}";
-
-  if [ "x" != "x${clusterName}" ] && [ "x" != "x${serviceName}" ]
-  then
-    serviceStatusChoices=`generateServiceStatusChoicesForCluster "${clusterName}" "${serviceName}"`;
-
-    serviceStatusChoicesXml="<hudson.model.ChoiceParameterDefinition>\
-<name>HDP${serviceName}Status</name>\
-<description></description>\
-<choices class=\\\"java.util.Arrays\\\$ArrayList\\\">\
-<a class=\\\"string-array\\\">\
-${serviceStatusChoices}\
-</a>\
-</choices>\
-</hudson.model.ChoiceParameterDefinition>";
-  fi
-
-  echo "${serviceStatusChoicesXml}";
-}
-
-function generateOptionalServicesStatusChoicesXmlForCluster
-{
-  local optionalServicesStatusChoicesXml="";
-
-  local clusterName="${1}";
-
-  local isHBaseInstalled="${2}"; 
-  local isHCatalogInstalled="${3}";
-  local isTempletonInstalled="${4}";
-  local isOozieInstalled="${5}";
-
-  if [ "x" != "x${clusterName}" ]
-  then
-    if [ "xyes" == "x${isHBaseInstalled}" ]
-    then
-      hBaseStatusChoicesXml=`generateServiceStatusChoicesXmlForCluster \
-        "${clusterName}" "HBase"`;
-      optionalServicesStatusChoicesXml="${optionalServicesStatusChoicesXml}${hBaseStatusChoicesXml}";
-    fi
-
-    if [ "xyes" == "x${isHCatalogInstalled}" ]
-    then
-      hCatalogStatusChoicesXml=`generateServiceStatusChoicesXmlForCluster \
-        "${clusterName}" "HCatalog"`;
-      optionalServicesStatusChoicesXml="${optionalServicesStatusChoicesXml}${hCatalogStatusChoicesXml}";
-    fi
-
-    if [ "xyes" == "x${isTempletonInstalled}" ]
-    then
-      templetonStatusChoicesXml=`generateServiceStatusChoicesXmlForCluster \
-        "${clusterName}" "Templeton"`;
-      optionalServicesStatusChoicesXml="${optionalServicesStatusChoicesXml}${templetonStatusChoicesXml}";
-    fi
-
-    if [ "xyes" == "x${isOozieInstalled}" ]
-    then
-      oozieStatusChoicesXml=`generateServiceStatusChoicesXmlForCluster \
-        "${clusterName}" "Oozie"`;
-      optionalServicesStatusChoicesXml="${optionalServicesStatusChoicesXml}${oozieStatusChoicesXml}";
-    fi
-  fi
-
-  echo "${optionalServicesStatusChoicesXml}";
-}

+ 0 - 227
hmc/archive/ShellScripts/suggestMemSize.sh

@@ -1,227 +0,0 @@
-inputDir=$1
-outputFile=$3
-inputFile=$2
-maxMapsPerNode=4
-maxRedsPerNode=2
-check=$4
-echo XXXX $inputFile XXXX
-echo XXXX $inputDir XXXX
-echo XXXX $outputFile XXXX
-
-source $inputFile
-
-cd $inputDir
-[[ -f "gateway" ]] && gwhost=$(cat gateway)
-[[ -f "namenode" ]] && nnhost=$(cat namenode)
-[[ -f "snamenode" ]] && snhost=$(cat snamenode)
-[[ -f "jobtracker" ]] && jthost=$(cat jobtracker)
-[[ -f "hbasemaster" ]] && hbmhost=$(cat hbasemaster)
-[[ -f "hcatserver" ]] && hcshost=$(cat hcatserver)
-[[ -f "templetonnode" ]] && ttonhosts=$(cat templetonnode)
-[[ -f "oozieserver" ]] && oozieshost=$(cat oozieserver)
-[[ -f "nodes" ]] && slaves=$(cat nodes)
-[[ -f "hbasenodes" ]] && rshosts=$(cat hbasenodes)
-[[ -f "zknodes" ]] && zkhosts=$(cat zknodes)
-[[ -f "gangliaserver" ]] && gangliahost=$(cat gangliaserver)
-[[ -f "nagiosserver" ]] && nagioshost=$(cat nagiosserver)
-
-maxMem=
-heapSizeSuggest=
-ConnectTimeOut=3
-sshCmdOnHost ()
-{
-  local cmd="ssh -o ConnectTimeOut=$ConnectTimeOut -o StrictHostKeyChecking=no -i $HDPClusterDeployUserIdentityFile $HDPClusterDeployUser@$1 \"$2\" > $3"
-  echo $cmd
-  eval $cmd
-}
-
-findMaxMemOnHost ()
-{
-  #  echo "SSHCMD: ssh -i /var/db/hdp/easyInstaller/MyHDPCluster/files/clusterDeployUserIdentity root@$1 \"free -m | sed \\\"1 d\\\" | awk '{print \\\$4}' | sed -n 1p\""
-  sshCmdOnHost $1 "free -m" "${PWD}/tmpMem.out"
-#  ssh -i $HDPClusterDeployUserIdentityFile $HDPClusterDeployUser@$1 "free -m" > tmpMem.out
-  maxMem=`cat $PWD/tmpMem.out | sed "1 d" | awk '{print $4}' | sed -n 1p`
-}
-
-scaleByThreads=2
-scaleRelativeMapsReds=3
-minMapsPerNode=1000
-minRedsPerNode=1000
-findMaxCoresOnHost ()
-{
-  sshCmdOnHost $1 "grep -c processor /proc/cpuinfo" ${PWD}/tmpCpu.out
-  cpuCount=`cat ${PWD}/tmpCpu.out`
-  maxMapsPerNode=`expr $cpuCount \* $scaleByThreads \* 2 / $scaleRelativeMapsReds`
-  maxRedsPerNode=`expr $cpuCount \* $scaleByThreads - $maxMapsPerNode`
-  totalProcessesPerSlave=`expr $maxMapsPerNode + $maxRedsPerNode`
-
-  if [ $maxMapsPerNode -lt 1 ]; then 
-    maxMapsPerNode=1
-  fi
-
-  if [ $maxRedsPerNode -lt 1 ]; then
-    maxRedsPerNode=1
-  fi
-
-  if [ $maxMapsPerNode -lt $minMapsPerNode ]; then
-    minMapsPerNode=$maxMapsPerNode
-  fi
-
-  if [ $maxRedsPerNode -lt $minRedsPerNode ]; then
-    minRedsPerNode=$maxRedsPerNode
-  fi
-  
-  echo CPUCOUNT: $cpuCount
-}
-
-list=
-for slave in $(echo $slaves)
-do
-  findMaxCoresOnHost $slave
-done
-
-maxMapsPerNode=$minMapsPerNode
-maxRedsPerNode=$minRedsPerNode
-
-if [ $check -eq 1 ]; then
-  userInputProperties=$5
-  source $userInputProperties
-fi
-
-#### -2 because -1 for count to go to 0 and -1 for allHosts
-totalProcessesPerSlave=`expr $maxMapsPerNode + $maxRedsPerNode - 2`
-list=$slaves
-while [ $totalProcessesPerSlave -ne 0 ];
-do
-totalProcessesPerSlave=`expr $totalProcessesPerSlave - 1`
-list="$list $slaves"
-done
-
-
-allHosts=`echo $slaves $jthost $nnhost $snhost $gwhost $hbmhost $hcshost $rshosts $zkhosts $nagioshost $gangliahost $list`
-# echo ALLHOSTS: $allHosts
-
-findForNodeType ()
-{
-  echo Hostname: $1
-  hostname=$1
-  echo "grep -o $1 <<< \"$allHosts\" | wc -l"
-  procCount=`grep -o $1 <<< "$allHosts" | wc -l`
-  echo PROCCOUNT: $procCount
-  findMaxMemOnHost $1
-#  findMaxCoresOnHost $1
-  echo MAXMEM: $maxMem
-  heapSizeSuggest=`expr $maxMem / $procCount`
-}
-
-echo NAMENODE $nnhost
-findForNodeType $nnhost
-nameNodeHeapSizeSuggest=$heapSizeSuggest
-echo "HDPNameNodeHeapSize ${heapSizeSuggest}" > $outputFile
-
-echo JOBTRACKER $jthost
-findForNodeType $jthost
-jobTrackerHeapSizeSuggest=$heapSizeSuggest
-echo "HDPJobTrackerHeapSize ${heapSizeSuggest}" >> $outputFile
-
-echo HBASEMASTER $hbmhost
-if [ "x" != "x$hbmhost" ]; then
-  findForNodeType $hbmhost
-  hbmHeapSizeSuggest=$heapSizeSuggest
-  echo "HDPHBaseMasterHeapSize=${heapSizeSuggest}" >> $outputFile
-fi
-
-# for now max value assumed to be 100G 
-minSuggest=100000000000
-for node in $(echo $slaves)
-do
-  findForNodeType $node
-  if [ "$minSuggest" -gt "$heapSizeSuggest" ]; then
-    minSuggest=$heapSizeSuggest
-  fi
-done
-
-echo DATANODE
-dataNodeHeapSizeSuggest=$minSuggest
-echo "HDPDataNodeHeapSize ${minSuggest}" >> $outputFile
-echo HADOOPHEAP
-hadoopHeapSizeSuggest=$minSuggest
-echo "HDPHadoopHeapSize ${minSuggest}" >> $outputFile
-echo CHILDOPTS
-childJavaOptsSize=$minSuggest
-echo "HDPMapRedChildJavaOptsSize ${minSuggest}" >> $outputFile
-
-echo "HDPMapRedMapTasksMax ${maxMapsPerNode}" >> $outputFile
-echo "HDPMapRedReduceTasksMax ${maxRedsPerNode}" >> $outputFile
-
-rm -f $PWD/tmpCpu.out $PWD/tmpMem.out
-
-checkAlpha ()
-{
-  num=$1
-  expr $num + 1 2> /dev/null
-  if [ $? = 0 ]; then
-    echo -n ""
-  else
-    echo "ERROR: Value was non-numeric"
-    exit 1;
-  fi
-
-  if [ $num -lt 0 ]; then
-    echo "ERROR: Invalid value less than 0"
-    exit 1;
-  fi
-}
-
-checkConfig ()
-{
-  echo "Checking Namenode heap size"
-  checkAlpha $nameNodeHeapSizeSuggest
-
-  echo "Checking Namenode heap size"
-  checkAlpha $jobTrackerHeapSizeSuggest
-
-  echo "Checking Namenode heap size"
-  checkAlpha $hbmHeapSizeSuggest
-
-  echo "Checking Namenode heap size"
-  checkAlpha $dataNodeHeapSizeSuggest
-
-  echo "Checking Namenode heap size"
-  checkAlpha $hadoopHeapSizeSuggest
-
-  if [ $HDPNameNodeHeapSize -gt $nameNodeHeapSizeSuggest ]; then
-    exit 1;
-    echo ERROR: Insufficient heap size for Name Node.
-  fi
-
-  if [ $HDPJobTrackerHeapSize -gt $jobTrackerHeapSizeSuggest ]; then
-    exit 1;
-    echo ERROR: Insufficient heap size for JobTracker.
-  fi
-
-  if [ $HDPHBaseMasterHeapSize -gt $hbmHeapSizeSuggest ]; then
-    exit 1;
-    echo ERROR: Insufficient heap size for HBase Master.
-  fi
-
-  if [ $HDPDataNodeHeapSize -gt $dataNodeHeapSizeSuggest ]; then
-    exit 1;
-    echo ERROR: Insufficient heap size for Data Node.
-  fi
-
-  ## May not be checked. If the user does not want to use the 
-  ## above conservative method, this can be masked
-  if [ $HDPHadoopHeapSize -gt $hadoopHeapSizeSuggest ]; then
-    exit 1;
-    echo ERROR: Insufficient heap size for Hadoop Heap.
-  fi
-
-#  if [ $HDPMapRedChildJavaOptsSize -gt $childJavaOptsSize ]; then
-#    echo ERROR: Insufficient heap size for Child Java Opts.
-#  fi
-}
-
-if [ $check -eq 1 ]; then
-  checkConfig
-fi

+ 0 - 115
hmc/archive/ShellScripts/suggestNodes.sh

@@ -1,115 +0,0 @@
-property=$1
-
-[ -f $property ] && source $property
-
-sshkey=$HDPClusterDeployUserIdentityFile
-
-PreConfigOutputDir=$2
-
-easyInstallInput=$HDPClusterHostsFile
-easyInstallOut=$PreConfigOutputDir/HostDiscovery.out
-
-mkdir -p $PreConfigOutputDir
-if [ -f $easyInstallOut ]; then
-  rm -f $easyInstallOut
-fi
-
-cd `dirname ${0}`;
-echo $PWD
-source ./discoverNodes.sh 
-
-##### Find fat nodes from the discovered nodes #####
-##### Parse the output file from the DiscoverNodes.sh output #####
-
-##### For master nodes, we need to choose 64 bit Fat nodes #####
-##### Fat nodes are nodes with the highest memory #####
-`cat $easyInstallOut | grep x86_64 | sort -r -k 2 > $PreConfigOutputDir/temp64.out`
-
-maxNodes=0
-maxNodesFile=$(wc -l $PreConfigOutputDir/temp64.out)
-for words in $maxNodesFile
-do
-  maxNodes=$words
-  break
-done
-
-[ $maxNodes == 0 ] 
-
-linenum=0
-outfile=
-
-getNodeAtLineNum()
-{
-  linenum=$((linenum+1))
-  if [ "$linenum" -gt "$maxNodes" ]; then
-    if [ "$maxNodes" -gt 0 ]; then
-      linenum=1
-    else
-      linenum=$maxNodes
-    fi
-  fi
-}
-
-writeNodeToFile()
-{
-  `awk "NR==$linenum{print;exit}" $PreConfigOutputDir/temp64.out > $outfile`
-}
-
-namenode=
-cmd=
-getNameNodeMountPoint()
-{
-  cmd="df -klh | sed \"1 d\" | grep -vw \"/boot\" | grep -vw \"/dev\/shm\" | grep -vw \"/home\" | grep -vw \/ | awk '{ print \$(NF)}'"
-  [ "$sshkey" == "" ] && `ssh -o StrictHostKeyChecking=no $HDPClusterDeployUser@$node $cmd > $outfile`
-  [ "$sshkey" != "" ] && `ssh -o StrictHostKeyChecking=no -i $sshkey $HDPClusterDeployUser@$node $cmd > $outfile`
-}
-
-getNodeAtLineNum
-outfile=$PreConfigOutputDir/NameNodeSuggest.out
-writeNodeToFile
-
-namenode=`cat $PreConfigOutputDir/NameNodeSuggest.out | awk '{print $1}'`
-outfile=$PreConfigOutputDir/NameNodeMountPointsSuggest.out
-getNameNodeMountPoint
-
-getNodeAtLineNum
-outfile=$PreConfigOutputDir/SecondaryNameNodeSuggest.out
-writeNodeToFile
-
-getNodeAtLineNum
-outfile=$PreConfigOutputDir/HBaseMasterSuggest.out
-writeNodeToFile
-
-getNodeAtLineNum
-outfile=$PreConfigOutputDir/JobTrackerSuggest.out
-writeNodeToFile
-
-getNodeAtLineNum
-outfile=$PreConfigOutputDir/GatewaySuggest.out
-writeNodeToFile
-
-getNodeAtLineNum
-outfile=$PreConfigOutputDir/HCatalogServerSuggest.out
-writeNodeToFile
-
-getNodeAtLineNum
-outfile=$PreConfigOutputDir/GangliaCollectorSuggest.out
-writeNodeToFile
-
-getNodeAtLineNum
-outfile=$PreConfigOutputDir/NagiosServerSuggest.out
-writeNodeToFile
-
-getNodeAtLineNum
-outfile=$PreConfigOutputDir/DashboardSuggest.out
-writeNodeToFile
-
-getNodeAtLineNum
-outfile=$PreConfigOutputDir/OozieServerSuggest.out
-writeNodeToFile
-
-getNodeAtLineNum
-outfile=$PreConfigOutputDir/TempletonNodeSuggest.out
-writeNodeToFile
-
-rm -f $PreConfigOutputDir/temp64.out

+ 0 - 54
hmc/archive/ShellScripts/templates/gsCluster.properties.in

@@ -1,54 +0,0 @@
-#/*
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# *
-# *     http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# */
-
-hadoop_heap_size=@HDPHadoopHeapSize@
-
-namenode_javaheap=@HDPNameNodeHeapSize@
-namenode_opt_newsize=@HDPNameNodeOptNewSize@
-
-datanode_du_reserved=@HDPDataNodeDuReserved@
-dt_heapsize=@HDPDataNodeHeapSize@
-
-jtnode_opt_newsize=@HDPJobTrackerOptNewSize@
-jtnode_opt_maxnewsize=@HDPJobTrackerOptMaxNewSize@
-jt_heapsize=@HDPJobTrackerHeapSize@
-
-mapred_map_tasks_max=@HDPMapRedMapTasksMax@
-mapred_red_tasks_max=@HDPMapRedReduceTasksMax@
-mapred_cluster_map_mem_mb=@HDPMapRedClusterMapMemoryMB@
-mapred_cluster_red_mem_mb=@HDPMapRedClusterReduceMemoryMB@
-mapred_cluster_max_map_mem_mb=@HDPMapRedClusterMaxMapMemoryMB@
-mapred_cluster_max_red_mem_mb=@HDPMapRedClusterMaxReduceMemoryMB@
-mapred_job_map_mem_mb=@HDPMapRedJobMapMemoryMB@
-mapred_job_red_mem_mb=@HDPMapRedJobReduceMemoryMB@
-mapred_child_java_opts_sz=@HDPMapRedChildJavaOptsSize@
-io_sort_mb=@HDPIoSortMB@
-io_sort_spill_percent=@HDPIoSortSpillPercent@
-mapreduce_userlog_retainhours=@HDPMapReduceUserLogRetainHours@
-max_tasks_per_job=@HDPMaxTasksPerJob@
-dfs_datanode_failed_volume_tolerated=@HDPDFSDataNodeFailedVolumeTolerated@
-
-#ENTER VALUES FOR zoo.cfg
-tickTime=2000
-initLimit=10
-syncLimit=5
-clientPort=2181
-
-#HBASE MEMORY SETTINGS
-hbase_master_heapsize=@HDPHBaseMasterHeapSize@
-hbase_regionserver_heapsize=@HDPHBaseRegionServerHeapSize@

+ 0 - 206
hmc/archive/ShellScripts/templates/gsInstaller.properties.in

@@ -1,206 +0,0 @@
-#/*
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# *
-# *     http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# */
-
-#========================================================================================================================#
-#======================================== CORE PROPERTIES =====================================#
-#========================================================================================================================#
-
-#============================================================#
-# GENERAL INSTALLER PROPERTIES
-#============================================================#
-#ENTER THE DEPLOY USERNAME FOR TAR INSTALLATION
-deployuser=@HDPDeployUser@
-
-#ENTER THE FULL PATH TO THE INSTALLATION DIRECTORY FOR HDP (For tar installation only)
-installdir=
-
-#ENTER A VALUE FOR 32 BIT javahome AND 64 BIT javahome IF THE NODES HAVE JAVA INSTALLED.
-# ELSE IT WILL BE DEFAULTED TO ${installdir}/jdk1.6.0_26 (for tar install) AND /usr (for rpm install) AND JAVA WILL BE INSTALLED FROM ORACLE SITE
-java32home=
-java64home=
-
-#SUPPORTS ONLY rpm/tar - deb SUPPORT IS WORK IN PROGRESS
-package=rpm
-
-#TAKES yes/no VALUE AND ENABLES SECUIRTY IF SET TO yes. Defaults to no
-# Oozie should be turned off by setting installoozie=no when security=yes
-# Templeton should be turned off by setting installtempleton=no when security=yes
-security=no
-
-#============================================================#
-# HADOOP CONFIGURATION DETAILS
-#============================================================#
-
-#ENTER THE USER THAT HDFS/MAPRED SERVICES SHOULD USE.
-hdfsuser=hdfs
-mapreduser=mapred
-
-#TO ENABLE HBASE APPEND SET enableappend VALUE TO true
-enableappend=true
-
-#TO ENABLE WEBHDFS SET enablewebhdfs TO true
-enablewebhdfs=true
-
-#HADOOP DATA, LOG AND PID DIRECTORIES
-datanode_dir=@HDPDataNodeDataDir@
-namenode_dir=@HDPNameNodeDataDir@
-mapred_dir=@HDPMapReduceLocalDir@
-log_dir=/var/log/hadoop
-pid_dir=/var/run/hadoop
-
-#SCHEDULER TO USE
-taskscheduler="org.apache.hadoop.mapred.CapacityTaskScheduler"
-
-#FULL PATH TO KEYTAB LOCATION FOR HDFS USER - [ REQUIRED WHILE security IS SET TO yes ]
-hdfs_user_keytab="/homes/${hdfsuser}/${hdfsuser}.headless.keytab"
-
-#FULL PATH TO KINIT EXECUTABLE - [ REQUIRED WHILE security IS SET TO yes ]
-kinitpath=/usr/kerberos/bin/kinit
-
-#PATH TO NAMENODE/SNAMENODE/JOBTRACKER/DATANODE/HBASEMASTER/HCATSERVER/TASKTRACKER SERVCE KEYTABS - [ REQUIRED WHILE security IS SET TO yes ]
-keytabdir=/etc/security/keytabs
-
-#KERBEROS REALM FOR SECURED CLUSETR - [ REQUIRED WHILE security IS SET TO yes ]
-realm=EXAMPLE.COM
-
-#SPECIFY FULL PATH TO SSHKEY WHEN PASSWORDLESS REQUIRES A SSHKEY
-sshkey=@HDPSshKey@
-
-#TO ENABLE LZO COMPRESSION
-enablelzo=@HDPEnableLzo@
-
-#TO ENABLE snappy COMPRESSION
-enablesnappy=yes
-
-#============================================================#
-# PIG CONFIGURATION DETAILS
-#============================================================#
-
-#ENTER yes TO INSTALL PIG ; no OTHERWISE ; DEFAULTS TO yes
-installpig=@HDPInstallPig@
-
-#============================================================#
-# HBASE CONFIGURATION DETAILS
-# Hbase requires zookeeper, please enter zookeeper settings
-# defined below.
-#============================================================#
-
-#ENTER yes TO INSTALL HBASE ; no OTHERWISE ; DEFAULTS TO yes
-installhbase=@HDPInstallHBase@
-
-#ENTER THE LOG DIR AND PID DIR LOCATION FOR HBASE
-hbase_log_dir=/var/log/hbase
-hbase_pid_dir=/var/run/hbase
-
-#ENTER THE USER THAT HBASE SERVICES SHOULD USE.
-hbaseuser=hbase
-
-#ENTER true/false TO ENABLE/DISABLE SHORTCIRCUIT READS
-enableshortcircuit=true
-
-#============================================================#
-# ZOOKEEPER CONFIGURATION DETAILS
-# Required by Hbase and Templeton
-#============================================================#
-
-#ENTER THE LOG DIR AND DATA DIR LOCATION FOR ZOOKEEPER
-zk_log_dir=/var/log/zookeeper
-zk_pid_dir=/var/run/zookeeper
-zk_data_dir=@HDPZookeeperDataDir@
-zkuser=zookeeper
-
-#============================================================#
-# HCAT CONFIGURATION DETAILS
-#============================================================#
-
-#ENTER yes TO INSTALL HCAT ; no OTHERWISE ; DEFAULTS TO yes
-installhcat=@HDPInstallHCatalog@
-
-#ENTER THE LOG DIR AND PID DIR LOCATION FOR HCATALOG
-hcat_log_dir=/var/log/hcatalog
-hcat_pid_dir=/var/run/hcatalog
-
-#MYSQL SERVER HOST NAME
-mysqldbhost=@HDPHCatalogMySqlDbHost@
-
-#MYSQL DATABASE NAME, USERNAME AND PASSWORD
-databasename=@HDPHCatalogMySqlDbName@
-mysqldbuser=@HDPHCatalogMySqlDbUser@
-mysqldbpasswd=@HDPHCatalogMySqlDbPassword@
-
-#ENTER THE USER THAT HCAT SERVICE SHOULD USE.
-hcatuser=hcat
-
-#ENTER THE USER WHO SHOULD EXECUTE THE SMOKE TEST
-smoke_test_user="${hdfsuser}"
-#FULL PATH TO KEYTAB LOCATION FOR SMOKE TEST USER - [ REQUIRED WHILE security IS SET TO yes ]
-smoke_test_user_keytab="/homes/${smoke_test_user}/${smoke_test_user}.headless.keytab"
-
-
-#============================================================#
-# TEMPLETON CONFIGURATION DETAILS
-# Requires Hcatalog and Zookeeper installed, please fill
-# appropriate settings.
-#============================================================#
-#ENTER yes TO INSTALL TEMPLETON ; no OTHERWISE ; DEFAULTS TO yes
-installtempleton=@HDPInstallTempleton@
-
-#ENTER THE USER THAT TEMPLETON SERVICE SHOULD USE.
-templetonuser=mapred
-
-#ENTER THE LOG DIR AND PID DIR LOCATION FOR TEMPLETON
-templeton_log_dir=/var/log/templeton
-templeton_pid_dir=/var/run/templeton
-#============================================================#
-# SQOOP CONFIGURATION DETAILS
-#============================================================#
-
-#ENTER yes TO INSTALL SQOOP ; no OTHERWISE ; DEFAULTS TO yes
-installsqoop=@HDPInstallSqoop@
-
-#============================================================#
-# OOZIE CONFIGURATION DETAILS
-#============================================================#
-
-#ENTER yes TO INSTALL OOZIE ; no OTHERWISE ; DEFAULTS TO yes
-installoozie=@HDPInstallOozie@
-
-#ENTER THE LOG DIR, PID DIR and DB DIR LOCATION FOR OOZIE 
-oozie_log_dir=/var/log/oozie
-oozie_pid_dir=/var/run/oozie
-oozie_db_dir=@HDPOozieDbDir@
-
-#ENTER THE USER THAT OOZIE SERVICE SHOULD USE.
-oozieuser=oozie
-
-
-#========================================================================================================================#
-#======================================== UNIVR PROPERTIES =================================#
-#========================================================================================================================#
-
-#============================================================#
-# MONITORING PROPERTIES FOR GANGLIA AND NAGIOS
-#============================================================#
-#TO ENABLE NAGIOS AND GANGLIA INTEGRATION WITH HADOOP
-enablemon=yes
-
-outputlogfile=@HDPGSInstallLogFile@
-
-forceclean=true
-
-statusdumpfile=@HDPGSInstallStatusDumpFile@

+ 0 - 40
hmc/archive/ShellScripts/templates/monInstaller.properties.in

@@ -1,40 +0,0 @@
-#/*
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# *
-# *     http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# */
-
-#======================================================================#
-# MONITORING CONFIGURATION DETAILS      
-#======================================================================#
-installnagios=yes
-# Note: Some of the nagios alerts checks require snmp
-installsnmp=yes
-installganglia=yes
-installdashboard=yes
-snmpcommunity=hadoop
-# snmp source is used to configure source in snmpd.conf
-# snmpsource is a host or network addresses in CIDR notation 
-# e.g. 192.168.0.0/24 => means all the machines from 192.168.0.0 to
-# 192.168.0.255 are allowed to access data from snmp daemons
-# Note: Make sure Gateway and Nagios Server belong to snmpsource address range
-snmpsource=default
-nagioscontact=monitor\@monitor.com
-nagios_web_login=nagiosadmin
-nagios_web_password=admin
-gmetad_user=nobody
-gmond_user=nobody
-webserver_group=apache
-#======================================================================#

+ 0 - 166
hmc/archive/php/assignHosts.php

@@ -1,166 +0,0 @@
-<?php
-include 'dbLib.php';
-include 'utils.php';
-
-$requestdata = file_get_contents('php://input');
-$obj = json_decode($requestdata, true);
-/*
-$obj = array(
-         "clusterName"=> "MyCluster-12345",
-         "ClusterDeployUser"=> "hortonva",
-         "ClusterDeployUserIdentityFile"=> "va_rsa",
-         "ClusterHostsFile"=> "../hostsFile.txt",
-         "nameNode"=> "hrt12n15",
-         "secondaryNameNode"=> "hrt12n16",
-         "jobTracker"=> "hrt12n17",
-         "hbaseMaster"=> "hrt12n18",
-         "hcatServer"=> "hrt12n19",
-         "gangliaCollector"=> "hrt12n15",
-         "nagiosServer"=> "hrt12n16",
-         "oozieServer"=> "hrt12n17",
-         "templetonNode"=> "hrt12n18",
-         );
-*/
-
-
-$clusterName = $_GET['clusterName'];
-$clusterDir = getClusterDir($clusterName);
-
-/*
-$MapredName = "mapReduce";
-$HDFSName = "hdfs";
-$HBaseName = "hBase";
-$PigName = "pig";
-$HcatName = "hCatalog";
-$TempletonName = "templeton";
-$OozieName = "oozie";
-$SqoopName = "sqoop";
-$GatewayName = "gateway";
-
-
-*/
-
-/////////////// Persist final master-server names ///////////////////////////////
-$serviceMasters = array();
-
-$serviceMasters[$HDFSName] = array(
-          $NameNodeName => $obj["nameNodeHost"],
-          $SecondaryNameNodeName => $obj["secondaryNameNodeHost"]
-  );
-$serviceMasters[$MapredName] = array(
-          $JobTrackerName => $obj["jobTrackerHost"],
-          );
-if(isServiceEnabled($clusterName, $HBaseName)) {
-  $serviceMasters[$HBaseName] = array ( $HBaseMasterName => $obj["hBaseMasterHost"] );
-}
-if(isServiceEnabled($clusterName, $HCatName)) {
-  $serviceMasters[$HCatName] = array ( $HCatServerName => $obj["hCatServerHost"] );
-}
-if(isServiceEnabled($clusterName, $OozieName)) {
-  $serviceMasters[$OozieName] = array ( $OozieServerName => $obj["oozieServerHost"] );
-}
-if(isServiceEnabled($clusterName, $TempletonName)) {
-  $serviceMasters[$TempletonName] = array ( $TempletonNodeName => $obj["templetonNodeHost"] );
-}
-
-storeServiceMasters($clusterName, $serviceMasters);
-/////////////// End of persisting final master-server names /////////////////////
-
-$inputDirForGetMountPointsScript = $clusterDir."/inputDirForGetMountPointsScript/";
-$cmd="rm -rf $inputDirForGetMountPointsScript/*; mkdir -p $inputDirForGetMountPointsScript";
-error_log("Running cmd : $cmd");
-system("rm -rf $inputDirForGetMountPointsScript/*; mkdir -p $inputDirForGetMountPointsScript"); // TODO: Error codes
-$outputDirForGetMountPointsScript = getInstallerInputDir($clusterName);
-
-// Hard code host and identity files for now
-//$obj['ClusterDeployUserIdentityFile']="va_rsa";
-//$obj['ClusterHostsFile']="hostsFile.txt";
-
-// write the input file to the mountPointsScript
-$fp = fopen($inputDirForGetMountPointsScript."data.txt", 'w');
-//TODO: FIXME hardcoded. Need to persist and recover.
-//fwrite($fp, 'HDPClusterDeployUser='.$obj['ClusterDeployUser']."\n");
-fwrite($fp, 'HDPClusterDeployUser='.getClusterDeployUser($clusterName)."\n");
-fwrite($fp, 'HDPClusterDeployUserIdentityFile='.getSshKeyFilePath($clusterName)."\n");
-fwrite($fp, 'HDPClusterHostsFile='.getHostsFilePath($clusterName)."\n");
-fwrite($fp, 'HDPNameNodeHost='.$obj['nameNodeHost']."\n");
-fwrite($fp, 'HDPSecondaryNameNodeHost='.$obj['secondaryNameNodeHost']."\n");
-fwrite($fp, 'HDPJobTrackerHost='.$obj['jobTrackerHost']."\n");
-fwrite($fp, 'HDPGangliaCollectorHost='.$obj['gangliaCollectorHost']."\n");
-fwrite($fp, 'HDPNagiosServerHost='.$obj['nagiosServerHost']."\n");
-if(isServiceEnabled($clusterName, $HBaseName)) {
-  fwrite($fp, 'HDPHBaseMasterHost='.$obj['hBaseMasterHost']."\n");
-}
-if(isServiceEnabled($clusterName, $HCatName)) {
-  fwrite($fp, 'HDPHCatalogServerHost='.$obj['hCatServerHost']."\n");
-}
-if(isServiceEnabled($clusterName, $OozieName)) {
-  fwrite($fp, 'HDPOozieServerHost='.$obj['oozieServerHost']."\n");
-}
-if(isServiceEnabled($clusterName, $TempletonName)) {
-  fwrite($fp, 'HDPTempletonNodeHost='.$obj['templetonNodeHost']."\n");
-}
-fclose($fp);
-
-$cmd = "/var/www/html/KickAssHDPUI/archive/ShellScripts/generateNodeFiles.sh ".$inputDirForGetMountPointsScript."data.txt ".$outputDirForGetMountPointsScript;
-error_log("Running cmd: $cmd");
-$handle = popen($cmd, "r");
-// Do some checks on return status: TODO
-//print $cmd;
-//echo "'$handle'; " . gettype($handle) . "\n";
-while (!feof($handle)) {
-  $read = fread($handle, 2096);
-}
-pclose($handle);
-
-$AllMountPoints = ReadNthWordsOfAllLinesFromFile($outputDirForGetMountPointsScript."/NameNodeMountPointsSuggest.out", 1);
-
-/*
-function generateDirs($allMountPts, $suffix) {
-  $result = "";
-  $first = true;
-  foreach ($allMountPts as $mountPt) {
-    if($first) {
-      $first = false;
-    } else {
-      $result = ",".$result;
-    }
-    $result = $result.$mountPt."/".$suffix;
-  }
-  return $result;
-}
-
-function generateSingleDir($allMountPts, $suffix) {
-  $result="";
-  foreach ($allMountPts as $mountPt) {
-    $result = $result.$mountPt."/".$suffix;
-    return $result;
-  }
-}
-*/
-
-$outjson = array(
-            "clusterName" => $clusterName,
-            "mountPoints" => $AllMountPoints,
-            "servicesInfo" => array (
-                                array( "keyName" => "nameNodeDataDir", "displayName" => "NameNode Data Directories", "maxDirectoriesNeeded" => -1, "suffix" => "hadoop/hdfs/namenode"),
-                                array( "keyName" => "dataNodeDataDir", "displayName" => "DataNode Data Directories", "maxDirectoriesNeeded" => -1, "suffix" => "hadoop/hdfs/data"),
-                                array( "keyName" => "mapReduceLocalDir", "displayName" => "MapReduce Data Directories", "maxDirectoriesNeeded" => -1, "suffix" => "hadoop/mapred"),
-                                array( "keyName" => "oozieDbDir", "displayName" => "Oozie DB Directory", "maxDirectoriesNeeded" => 1, "suffix" => "hadoop/oozie"),
-                                array( "keyName" => "zooKeeperDataDir", "displayName" => "ZooKeeper Data Directory", "maxDirectoriesNeeded" => 1 , "suffix" => "hadoop/zookeeper"),
-                                )
-            );
-/*            "nameNodeDataDir"=> generateDirs($AllMountPoints, "hadoop/hdfs/namenode"),
-            "dataNodeDataDir"=> generateDirs($AllMountPoints, "hadoop/hdfs/data"),
-            "mapreduceDataDir"=> generateDirs($AllMountPoints, "hadoop/mapred"),
-            "oozieDbDir"=> generateSingleDir($AllMountPoints, "hadoop/oozie"),
-            "zookeeperDataDir"=> generateSingleDir($AllMountPoints, "hadoop/zookeeper"),
-           );
-            */
-
-header("Content-type: application/json");
-print (json_encode($outjson));
-//var_dump($AllHosts);
-//print "hello";
-//var_dump(json_encode($outjson));
-?>

+ 0 - 163
hmc/archive/php/configureCluster.php

@@ -1,163 +0,0 @@
-<?php
-
-include 'dbLib.php';
-include 'utils.php';
-
-$requestdata = file_get_contents('php://input');
-$obj = json_decode($requestdata, true);
-
-/*
-$obj = array(
-         "clusterName"=> "MyCluster-12345",
-         "ClusterDeployUser"=> "hortonva",
-         "ClusterDeployUserIdentityFile"=> "va_rsa",
-         "ClusterHostsFile"=> "../hostsFile.txt",
-         "nameNode"=> "hrt12n15",
-         "secondaryNameNode"=> "hrt12n16",
-         "jobTracker"=> "hrt12n17",
-         "hbaseMaster"=> "hrt12n18",
-         "hcatServer"=> "hrt12n19",
-         "gangliaCollector"=> "hrt12n15",
-         "nagiosServer"=> "hrt12n16",
-         "oozieServer"=> "hrt12n17",
-         "templetonNode"=> "hrt12n18",
-         "mountPoints" => array ( "/grid/0", "/grid/1" );
-         );
-*/
-
-$clusterName = $_GET['clusterName'];
-$clusterDir = getClusterDir($clusterName);
-$installerInputDir = getInstallerInputDir($clusterName);
-
-// persist mount points 
-storeConfiguredDirectories($clusterName, $obj);
-
-$json_Output = array(
-  "clusterName" => $clusterName,
-  "services" => array (
-    "$MapredName" => array (
-      "enabled" => isServiceEnabled($clusterName, $MapredName),
-      "properties" => array (
-      "jobTrackerHeapSize" => array(
-        "type" => "text",
-        "displayName" => "JobTracker heap size",
-        "value" => "",
-      ),
-      "childJavaOptions" => array(
-        "type" => "text",
-        "displayName" => "Child Java options for MR tasks",
-        "value" => "",
-      ),
-      "maxMapsPerNode" => array(
-        "type" => "text",
-        "displayName" => "Maximum number of maps per node",
-        "value" => "",
-      ),
-      "maxRedsPerNode" => array(
-        "type" =>"text",
-        "displayName" => "Maximum number of reducers per node",
-        "value" => "",
-      ),
-      ),
-    ),
-    "$HDFSName" => array (
-      "enabled" => isServiceEnabled($clusterName, $HDFSName),
-      "properties" => array (
-      "nameNodeHeapSize" => array(
-        "type" => "text",
-        "displayName" => "Maximum heap size for NameNode",
-        "value" => "",
-      ),
-      "dataNodeHeapSize" => array(
-        "type" => "text",
-        "displayName" => "Maximum heap size for DataNodes",
-        "value" => "",
-      ),
-      ),
-    ),
-    "$PigName" => array (
-      "enabled" => isServiceEnabled($clusterName, $PigName),
-      "properties" => array (
-      ),
-    ),
-    "$HBaseName" => array (
-      "enabled" => isServiceEnabled($clusterName, $HBaseName),
-      "properties" => array (
-      ),
-    ),
-    "$OozieName" => array (
-      "enabled" => isServiceEnabled($clusterName, $OozieName),
-      "properties" => array (
-      ),
-    ),
-    "$HCatName" => array (
-      "enabled" => isServiceEnabled($clusterName, $HCatName),
-      "properties" => array (
-        "mysqlHost" => array (
-          "type" => "text",
-          "displayName" => "MySql host",
-          "value" => "",
-        ),
-
-        "mysqlDB" => array (
-          "type" => "text",
-          "displayName" => "MySql DBRoot",
-          "value" => "",
-        ),
-        "mysqlUser" => array (
-          "type" => "text",
-          "displayName" => "MySql DBUser",
-          "value" => "",
-        ),
-        "mysqlPasswd" => array (
-          "type" => "password",
-          "displayName" => "MySql Passwd",
-          "value" => "",
-        ),
-      ),
-    ),
-    "$TempletonName" => array (
-      "enabled" => isServiceEnabled($clusterName, $TempletonName),
-      "properties" => array (
-      ),
-    ),
-    "$SqoopName" => array (
-      "enabled" => isServiceEnabled($clusterName, $SqoopName),
-      "properties" => array (
-      ),
-    ),
-    "$GatewayName" => array (
-      "enabled" => isServiceEnabled($clusterName, $GatewayName),
-      "properties" => array (
-      ),
-    ),
-    "$ZooKeeperName" => array (
-      "enabled" => isServiceEnabled($clusterName, $ZooKeeperName),
-      "properties" => array (
-      ),
-    ),
-    "$MiscName" => array (
-      "enabled" => true,
-      "properties" => array (
-        "enableLZO" => array (
-          "type" => "checkbox",
-          "displayName" => "Enable LZO",
-          "value" => false,
-        ),
-      ),
-    ),
-    "$GangliaCollectorName" => array (
-      "enabled" => isServiceEnabled($clusterName, $GangliaCollectorName),
-      "properties" => array (
-      ),
-    ),
-    "$NagiosName" => array (
-      "enabled" => isServiceEnabled($clusterName, $NagiosName),
-      "properties" => array (
-      ),
-    ),
-  ),
-);
-print(json_encode($json_Output));
-
-?>

+ 0 - 35
hmc/archive/php/createCluster.php

@@ -1,35 +0,0 @@
-<?php
-include 'dbLib.php';
-
-/*
-function initCluster($clusterName) {
-  $clusterDir = getClusterDir($clusterName);
-  // TODO: FIXME: All die calls below
-  if (!is_dir($clusterDir) && !mkdir($clusterDir, 0700, true)) {
-        die('Failed to create directory...');
-  }
-  $dbDir = getClusterDBDir($clusterName);
-  if (!is_dir($dbDir) && !mkdir($dbDir, 0700, true)) {
-        die('Failed to create db-directory...');
-  }
-  $installerInputDir = getInstallerInputDir($clusterName);
-  if (!is_dir($installerInputDir) && !mkdir($installerInputDir, 0700, true)) {
-        die('Failed to create installer directory...');
-  }
-}
-*/
-
-// Read from the input
-$requestdata = file_get_contents('php://input');
-//error_log($requestdata, 3, "/tmp/rez.log");
-$requestObj = json_decode($requestdata, true);
-
-$clusterName = $requestObj["clusterName"];
-// Validate clusterName: TODO; FIXME
-initCluster($clusterName);
-
-$output = array( "clusterName" => $clusterName );
-
-header("Content-type: application/json");
-print (json_encode($output));
-?>

+ 0 - 335
hmc/archive/php/dbLib.php

@@ -1,335 +0,0 @@
-<?php
-
-// Valid constant names
-$rootDir = "/var/run/HMCDir/";
-$allClustersDir = $rootDir."clusters/";
-
-$SshKeyFileName = "user-ssh-key";
-$HostsFileName = "hosts.txt";
-
-$MapredName = "mapReduce";
-$HDFSName = "hdfs";
-$HBaseName = "hBase";
-$PigName = "pig";
-$HCatName = "hCatalog";
-$TempletonName = "templeton";
-$OozieName = "oozie";
-$ZooKeeperName = "zookeeper";
-$SqoopName = "sqoop";
-$GatewayName = "gateway";
-$MiscName = "miscellaneous";
-$GangliaCollectorName = "gangliaCollector";
-$NagiosName = "nagios";
-
-$JobTrackerName = "jobTracker";
-$NameNodeName = "nameNode";
-$SecondaryNameNodeName = "secondaryNameNode";
-$HBaseMasterName = "hBaseMaster";
-$OozieServerName = "oozieServer";
-$HCatServerName = "hCatServer";
-$MySqlServerName = "mySqlServer";
-$TempletonNodeName = "templetonNode";
-$NagiosServerName = "nagiosServer";
-
-function getAllClustersDir(){
-  global $allClustersDir;
-  return $allClustersDir;
-}
-
-function getClusterDir($clusterId) {
-  if (!isset($clusterId) || $clusterId == "") {
-    error_log("**** Got invalid clusterId **** ");
-    error_log(print_r(debug_backtrace(), true));
-  }
-  global $allClustersDir;
-  return $allClustersDir.$clusterId."/";
-}
-
-function getSshKeyFilePath($clusterId) {
-  global $SshKeyFileName;
-  $clusterDir = getClusterDir($clusterId);
-  return $clusterDir.$SshKeyFileName;
-}
-
-function getHostsFilePath($clusterId) {
-  global $HostsFileName;
-  $clusterDir = getClusterDir($clusterId);
-  return $clusterDir.$HostsFileName;
-}
-
-// TODO: FIX: Create a separate installer php page.
-function getInstallerInputDir($clusterId) {
-  $clusterDir = getClusterDir($clusterId);
-  return $clusterDir."/installer-input/";
-}
-
-// Till we have a db, we use filebased db
-function getDBDir() {
-  global $rootDir;
-  return $rootDir."my-db/";
-}
-
-function getClusterDBDir($clusterId) {
-  $dbdir = getDBDir().$clusterId."/";
-  return $dbdir;
-}
-
-/* Moved to createCluster.php. Not needed anymore
-function initCluster($clusterId) {
-  $clusterDir = getClusterDir($clusterId);
-  // TODO: FIXME: All die calls below
-  if (!is_dir($clusterDir) && !mkdir($clusterDir, 0700, true)) {
-        die('Failed to create directory...');
-  }
-  $dbDir = getClusterDBDir($clusterId);
-  if (!is_dir($dbDir) && !mkdir($dbDir, 0700, true)) {
-        die('Failed to create db-directory...');
-  }
-  $installerInputDir = getInstallerInputDir($clusterId);
-  if (!is_dir($installerInputDir) && !mkdir($installerInputDir, 0700, true)) {
-        die('Failed to create installer directory...');
-  }
-}
-*/
-
-/*
-function storeSelectedServiceNames($servicesArray) {
-  $dbDir = getDBDir();
-  foreach ($servicesArray as $service) {
-    touch($dbDir."SERVICE-".$service); // TODO: FIX: error code
-  }
-}
-*/
-
-function getClusterDeployUser($clusterId) {
-  $cluster_info = getPersistedClusterInfo($clusterId);
-  return $cluster_info["installInfo"]["deployUser"];
-}
-
-function storeServiceMasters($clusterId, $serviceMasters) {
-  $cluster_info = getPersistedClusterInfo($clusterId);
-  foreach ($serviceMasters as $svc=>$arr) {
-    foreach ($arr as $role=>$host) {
-      $cluster_info["services"][$svc]["masters"][$role]["hostName"] = $host;
-    }
-  }
-  persistClusterInfo($clusterId, $cluster_info);
-}
-
-function isServiceEnabled($clusterId, $serviceName) {
-  // $dbDir = getDBDir();
-  // return file_exists($dbDir."SERVICE-".$serviceName);
-  $info = getPersistedClusterInfo($clusterId);
-  if (!$info) { return false; }
-
-  if (isset($info["services"][$serviceName])
-      && isset($info["services"][$serviceName]["enabled"])
-      && $info["services"][$serviceName]["enabled"] == true) {
-    return true;
-  }
-  return false;
-}
-
-function storeOptions($clusterId, $optionsFromUser) {
-  $cluster_info = getPersistedClusterInfo($clusterId);
-  $services = $cluster_info["services"];
-
-  // Loop through the options and save them
-  error_log(json_encode($optionsFromUser), 0);
-  foreach ($optionsFromUser as $serviceName => $propertiesList) {
-    $serviceProperties = $services[$serviceName]["properties"];
-    //error_log($serviceName, 0);
-    //error_log(json_encode($propertiesList["properties"]), 0);
-    foreach($propertiesList["properties"] as $singlePropKey => $singlePropObj) {
-      $serviceProperties[$singlePropKey] = $singlePropObj;
-    }
-    //$serviceProperties = array_merge($serviceProperties, $propertiesList["properties"]);
-
-    // Persist back
-    $services[$serviceName]["properties"] = $serviceProperties;
-  }
-
-  // Store the final data back again
-  $cluster_info["services"] = $services;
-  persistClusterInfo($clusterId, $cluster_info);
-}
-
-function storeConfiguredDirectories($clusterId, $mountInfo) {
-
-  $cluster_info = getPersistedClusterInfo($clusterId);
-  $services = $cluster_info["services"];
-
-  // Store the list of all mount-points
-  $cluster_info["sysInfo"]["mountPoints"] = $mountInfo["mountPoints"];
-
-  // MapReduce properties
-  $mapRedServiceProperties = $services[$GLOBALS['MapredName']]["properties"];
-  $mapRedServiceProperties["mapReduceLocalDir"] = array( "displayName" => "MapReduce local directories", "value" => $mountInfo["clusterConfig"]["mapReduceLocalDir"]);
-  $services[$GLOBALS['MapredName']]["properties"] = $mapRedServiceProperties;
-
-  // HDFS properteis
-  $hdfsProperties = $services[$GLOBALS['HDFSName']]["properties"];
-  $hdfsProperties["nameNodeDataDir"] = array( "displayName" => "NameNode meta-data directories", "value" =>$mountInfo["clusterConfig"]["nameNodeDataDir"]);
-  $hdfsProperties["dataNodeDataDir"] = array( "displayName" => "DataNode data directories", "value" => $mountInfo["clusterConfig"]["dataNodeDataDir"]);
-  $services[$GLOBALS['HDFSName']]["properties"] = $hdfsProperties;
-
-  // Oozie properties
-  $oozieProperties = $services[$GLOBALS['OozieName']]["properties"];
-  $oozieProperties["oozieDbDir"] = array( "displayName" => "Oozie database directory", "value" => $mountInfo["clusterConfig"]["oozieDbDir"]);
-  $services[$GLOBALS['OozieName']]["properties"] = $oozieProperties;
-
-  // Zookeeper properties
-  $zooKeeperProperties = $services[$GLOBALS['ZooKeeperName']]["properties"];
-  $zooKeeperProperties["zooKeeperDir"] = array( "displayName" => "ZooKeeper data directory", "value" => $mountInfo["clusterConfig"]["zooKeeperDataDir"]);
-  $services[$GLOBALS['ZooKeeperName']]["properties"] = $zooKeeperProperties;
-
-  // Store the final data
-  $cluster_info["services"] = $services;
-  persistClusterInfo($clusterId, $cluster_info);
-}
-
-function storeMemoryOptionSuggestions($clusterId, $memoryOptionsSuggestions) {
-
-  $cluster_info = getPersistedClusterInfo($clusterId);
-  $services = $cluster_info["services"];
-
-  // MapReduce properties
-  $mapRedServiceProperties = $services[$GLOBALS['MapredName']]["properties"];
-  $mapRedServiceProperties["JobTrackerHeapSize"] = array( "displayName" => "Maximium Heap size for JobTracker", "value" => $memoryOptionsSuggestions["HDPJobTrackerHeapSize"]);
-  $mapRedServiceProperties["ChildJavaOptsSize"]= array( "displayName" => "Child Java options for MR tasks", "value" => $memoryOptionsSuggestions["HDPMapRedChildJavaOptsSize"]);
-  $mapRedServiceProperties["MapTasksMax"] = array( "displayName" => "Maximum number of maps per node", "value" => $memoryOptionsSuggestions["HDPMapRedMapTasksMax"]);
-  $mapRedServiceProperties["ReduceTasksMax"] = array( "displayName" => "Maximum number of reduces per node", "value" => $memoryOptionsSuggestions["HDPMapRedReduceTasksMax"]);
-  $services[$GLOBALS['MapredName']]["properties"] = $mapRedServiceProperties;
-
-  // HDFS properteis
-  $hdfsProperties = $services[$GLOBALS['HDFSName']]["properties"];
-  $hdfsProperties["NameNodeHeapSize"] = array( "displayName" => "Maximum heap size for NameNode", "value" => $memoryOptionsSuggestions["HDPNameNodeHeapSize"]);
-  $hdfsProperties["DataNodeHeapSize"] = array( "displayName" => "Maximum heap size for DataNodes", "value" => $memoryOptionsSuggestions["HDPDataNodeHeapSize"]);
-  $services[$GLOBALS['HDFSName']]["properties"] = $hdfsProperties;
-
-  // Store the final data
-  $cluster_info["services"] = $services;
-  error_log("STORE MEM OPTIONS");
-  error_log(print_r($cluster_info, true));
-  persistClusterInfo($clusterId, $cluster_info);
-}
-
-function persistClusterInfo($clusterId, $info) {
-  $filename = "ClusterInfo.out";
-  $GLOBALS["CLUSTER_INFO"][$clusterId]["info"] = $info;
-  persistData($clusterId, $filename, $info);
-}
-
-
-function getPersistedClusterInfo($clusterId) {
-  if (isset($GLOBALS["CLUSTER_INFO"][$clusterId]["info"])) {
-    return $GLOBALS["CLUSTER_INFO"][$clusterId]["info"];
-  }
-
-  $filename = "ClusterInfo.out";
-  $data = getPersistedData($clusterId, $filename);
-  $GLOBALS["CLUSTER_INFO"][$clusterId]["info"] = $data;
-  return $data;
-}
-
-/*
- * filename to persist in
- * data mixed array which will be stored as serialized json
- */
-function persistData($clusterId, $filename, $data) {
-  $filepath = getClusterDBDir($clusterId).$filename;
-  $json_data = json_encode($data);
-  if (!file_put_contents($filepath, $json_data)) {
-    die("Failed to persist data to $filename");
-  } 
-}
-
-function getPersistedData($clusterId, $filename) {
-  $filepath = getClusterDBDir($clusterId).$filename; 
-  $data = file_get_contents($filepath);
-  if ($data != FALSE && isset($data) && $data != "") {
-    return json_decode($data, true);
-  }
-  error_log("Could not retrieve any data from $filepath");
-  return NULL;
-}
-
-function setInstallStarted($clusterId) {
-  $clusterInfo = getPersistedClusterInfo($clusterId);
-  $clusterInfo["install"] = array();
-  $clusterInfo["install"]["started"] = true;
-  persistClusterInfo($clusterId, $clusterInfo);
-
-  global $CLUSTER_STATUS_INSTALL_IN_PROGRESS;
-  setClusterStatus($clusterId, $CLUSTER_STATUS_INSTALL_IN_PROGRESS);
-}
-
-function hasInstallStarted($clusterId) {
-  $clusterInfo = getPersistedClusterInfo($clusterId);
-
-  if (isset( $clusterInfo["install"]["started"])
-      &&  $clusterInfo["install"]["started"] == true) {
-    return TRUE;
-  }
-  return FALSE;
-}
-
-$CLUSTER_STATUS_CONFIG_IN_PROGRESS = "CONFIG IN PROGRESS";
-$CLUSTER_STATUS_INSTALL_IN_PROGRESS = "INSTALL IN PROGRESS";
-$CLUSTER_STATUS_INSTALL_DONE = "INSTALL DONE";
-$CLUSTER_STATUS_UNINSTALL_IN_PROGRESS = "UNINSTALL IN PROGRESS";
-$CLUSTER_STATUS_INSTALL_SUCCESSFUL = "SUCCESSFUL INSTALL";
-$CLUSTER_STATUS_INSTALL_UNSUCCESSFUL = "UNSUCCESSFUL INSTALL";
-$CLUSTER_STATUS_DOES_NOT_EXIST = "DOES NOT EXIST";
-
-function setClusterStatus($clusterId, $status) {
-  global $CLUSTER_STATUS_CONFIG_IN_PROGRESS;
-  global $CLUSTER_STATUS_INSTALL_IN_PROGRESS;
-  global $CLUSTER_STATUS_INSTALL_DONE;
-  global $CLUSTER_STATUS_UNINSTALL_IN_PROGRESS;
-  global $CLUSTER_STATUS_INSTALL_SUCCESSFUL;
-  global $CLUSTER_STATUS_INSTALL_UNSUCCESSFUL;
-  if ($status != $CLUSTER_STATUS_CONFIG_IN_PROGRESS
-      && $status != $CLUSTER_STATUS_INSTALL_IN_PROGRESS
-      && $status != $CLUSTER_STATUS_INSTALL_DONE
-      && $status != $CLUSTER_STATUS_UNINSTALL_IN_PROGRESS
-      && $status != $CLUSTER_STATUS_INSTALL_SUCCESSFUL
-      && $status != $CLUSTER_STATUS_INSTALL_UNSUCCESSFUL) {
-    die ("Invalid status : $status");
-  }
-  $clusterInfo = getPersistedClusterInfo($clusterId);
-  if (!isset($clusterInfo["clusterStatus"])) {
-    $clusterInfo["clusterStatus"] = array();
-  }
-  $clusterInfo["clusterStatus"]["status"] = $status;
-  persistClusterInfo($clusterId, $clusterInfo);
-} 
-
-function getClusterStatus($clusterId) {
-  global $CLUSTER_STATUS_DOES_NOT_EXIST;
-  $clusterInfo = getPersistedClusterInfo($clusterId);
-  if (NULL == $clusterInfo || !isset($clusterInfo["clusterStatus"]["status"])) {
-    return $CLUSTER_STATUS_DOES_NOT_EXIST;
-  }
-  return $clusterInfo["clusterStatus"]["status"];
-}
-
-function initCluster($clusterId) {
-  $clusterDir = getClusterDir($clusterId);
-  // TODO: FIXME: All die calls below
-  if (!is_dir($clusterDir) && !mkdir($clusterDir, 0700, true)) {
-        die('Failed to create directory...');
-  }
-  $dbDir = getClusterDBDir($clusterId);
-  if (!is_dir($dbDir) && !mkdir($dbDir, 0700, true)) {
-        die('Failed to create db-directory...');
-  }
-  $installerInputDir = getInstallerInputDir($clusterId);
-  if (!is_dir($installerInputDir) && !mkdir($installerInputDir, 0700, true)) {
-        die('Failed to create installer directory...');
-  }
-}
-
-
-
-?>

+ 0 - 129
hmc/archive/php/deploy.php

@@ -1,129 +0,0 @@
-<?php
-include 'dbLib.php';
-include 'utils.php';
-include 'gsInstallerUtils.php';
-
-$clusterName = $_GET['clusterName'];
-// $clusterName = "MyCluster-12345";
-// Validate clusterName: TODO; FIXME
-//$clusterDir = getClusterDir($clusterName);
-$clusterInfo = getPersistedClusterInfo($clusterName);
-
-/*
-function generateDirs($allMountPts, $suffix) {
-  $result = "";
-  $first = true;
-  foreach ($allMountPts as $mountPt) {
-    if($first) {
-      $first = false;
-    } else {
-      $result = $result.",";
-    }
-    $result = $result.$mountPt."/".$suffix;
-  }
-  return $result;
-}
-*/
-
-//////////////////////////////// Write out the gsInstaller.properties file
-// Read the template into memory
-$templatedData = file_get_contents('/var/www/html/KickAssHDPUI/archive/ShellScripts/templates/gsInstaller.properties.in');
-// Templated variables
-$allMountPoints = $clusterInfo["sysInfo"]["mountPoints"];
-$services = $clusterInfo["services"];
-$mySqlBase = $services[$HCatName]["properties"];
-// TODO: Declare the dirs suffixes as constants
-$replacements = array(
-                     #"@HDPDeployUser@" => $clusterInfo["installInfo"]["deployUser"],
-                     "@HDPDeployUser@" => "root",
-                     "@HDPSshKey@" => getClusterDir($clusterName)."/"."user-ssh-key", // TODO: Make the name constant
-                     "@HDPEnableLzo@" => ( $services[$MiscName]["properties"]["enableLZO"]["value"] ? "yes" : "no" ),
-                     "@HDPInstallPig@" => ( $services[$PigName]["enabled"] ? "yes" : "no" ),
-                     "@HDPInstallHBase@" => ( $services[$HBaseName]["enabled"] ? "yes" : "no" ),
-                     "@HDPInstallHCatalog@" => ( $services[$HCatName]["enabled"] ? "yes" : "no" ), 
-                     "@HDPInstallTempleton@" => ( $services[$TempletonName]["enabled"] ? "yes" : "no" ),
-                     "@HDPInstallSqoop@" => ( $services[$SqoopName]["enabled"] ? "yes" : "no" ),
-                     "@HDPInstallOozie@" => ( $services[$OozieName]["enabled"] ? "yes" : "no" ), 
-                     "@HDPDataNodeDataDir@" => $services[$HDFSName]["properties"]["dataNodeDataDir"]["value"],
-                     "@HDPNameNodeDataDir@" => $services[$HDFSName]["properties"]["nameNodeDataDir"]["value"],
-                     "@HDPMapReduceLocalDir@" => $services[$MapredName]["properties"]["mapReduceLocalDir"]["value"],
-                     "@HDPZookeeperDataDir@" => $services[$ZooKeeperName]["properties"]["zooKeeperDataDir"]["value"],
-                     "@HDPOozieDbDir@" => $services[$OozieName]["properties"]["oozieDbDir"]["value"],
-                     "@HDPHCatalogMySqlDbHost@" => ( isset($mySqlBase["mysqlHost"]["value"]) ? $mySqlBase["mysqlHost"]["value"] : "" ),
-                     "@HDPHCatalogMySqlDbName@" => ( isset($mySqlBase["mysqlDB"]["value"]) ? $mySqlBase["mysqlDB"]["value"] : "" ),
-                     "@HDPHCatalogMySqlDbUser@" => ( isset($mySqlBase["mysqlUser"]["value"]) ? $mySqlBase["mysqlUser"]["value"] : "" ),
-                     "@HDPHCatalogMySqlDbPassword@" => ( isset($mySqlBase["mysqlPasswd"]["value"]) ? $mySqlBase["mysqlPasswd"]["value"] : "" ),
-                     "@HDPGSInstallLogFile@" => getGsInstallerLogPath($clusterName),
-                     "@HDPGSInstallStatusDumpFile@" => getGsInstallerStatusDumpPath($clusterName)
-                     );
-// Replace all the tags with correspond values
-$finalGsInstallerPropsContents = str_replace(array_keys($replacements), array_values($replacements), $templatedData);
-// Write out the completed file into gsInstaller-input-dir
-$finalGsInstallerPropsFile = getInstallerInputDir($clusterName)."gsInstaller.properties";
-file_put_contents($finalGsInstallerPropsFile, $finalGsInstallerPropsContents);
-//////////////////////////////// End of writing out the gsInstaller.properties file
-
-//////////////////////////////// Write out the gsCluster.properties file
-
-/* Dead code 
-// Templated variables
-// All props to be replace eventually. TODO:
-#$varsToBeReplaced = array("@HDPHadoopHeapSize@", "@HDPNameNodeHeapSize@", "@HDPNameNodeOptNewSize@", "@HDPDataNodeDuReserved@", "@HDPDataNodeHeapSize@", "@HDPJobTrackerOptNewSize@", "@HDPJobTrackerOptMaxNewSize@", "@HDPJobTrackerHeapSize@", "@HDPMapRedMapTasksMax@", "@HDPMapRedReduceTasksMax@", "@HDPMapRedClusterMapMemoryMB@", "@HDPMapRedClusterReduceMemoryMB@", "@HDPMapRedClusterMaxMapMemoryMB@", "@HDPMapRedClusterMaxReduceMemoryMB@", "@HDPMapRedJobMapMemoryMB@", "@HDPMapRedJobReduceMemoryMB@", "@HDPMapRedChildJavaOptsSize@", "@HDPIoSortMB@", "@HDPIoSortSpillPercent@", "@HDPMapReduceUserLogRetainHours@", "@HDPMaxTasksPerJob@", "@HDPDFSDataNodeFailedVolumeTolerated@", "@HDPHBaseMasterHeapSize@", "@HDPHBaseRegionServerHeapSize@");
-#$varsToBeReplaced = array( "@HDPNameNodeHeapSize@", "@HDPJobTrackerHeapSize@", "@HDPHBaseMasterHeapSize@", "@HDPDataNodeHeapSize@", "@HDPHadoopHeapSize@", "@HDPMapRedChildJavaOptsSize@" );
-$valuesToReplaceWith = array($memoryOptionsSuggestions["HDPNameNodeHeapSize"], $memoryOptionsSuggestions["HDPJobTrackerHeapSize"], $memoryOptionsSuggestions["HDPHBaseMasterHeapSize"], $memoryOptionsSuggestions["HDPDataNodeHeapSize"], $memoryOptionsSuggestions["HDPHadoopHeapSize"], $memoryOptionsSuggestions["HDPMapRedChildJavaOptsSize"]);
-// Replace all the tags with correspond values
-$finalGsClusterPropsContents = str_replace($varsToBeReplaced, $valuesToReplaceWith, $templatedData);
-End dead code */
-
-// Read the template into memory
-$templatedData = file_get_contents('/var/www/html/KickAssHDPUI/ShellScripts/templates/gsCluster.properties.in');
-// get mem suggestions 
-$memoryOptionsSuggestions = $clusterInfo["sysInfo"]["memoryOptionsSuggestions"];
-
-$gsClusterProps = array();
-$gsClusterProps["@HDPNameNodeHeapSize@"] = $memoryOptionsSuggestions["HDPNameNodeHeapSize"];
-$gsClusterProps["@HDPJobTrackerHeapSize@"] = $memoryOptionsSuggestions["HDPJobTrackerHeapSize"];
-$gsClusterProps["@HDPHBaseMasterHeapSize@"] = $memoryOptionsSuggestions["HDPHBaseMasterHeapSize"];
-$gsClusterProps["@HDPDataNodeHeapSize@"] = $memoryOptionsSuggestions["HDPDataNodeHeapSize"];
-$gsClusterProps["@HDPHadoopHeapSize@"] = $memoryOptionsSuggestions["HDPHadoopHeapSize"];
-$gsClusterProps["@HDPMapRedChildJavaOptsSize@"] = $memoryOptionsSuggestions["HDPMapRedChildJavaOptsSize"];
-$gsClusterProps["@HDPHBaseRegionServerHeapSize@"] = "1024m";
-$gsClusterProps["@HDPNameNodeOptNewSize@"] = "640m";
-$gsClusterProps["@HDPDataNodeDuReserved@"] = "1073741824";
-$gsClusterProps["@HDPJobTrackerOptNewSize@"] = "200m";
-$gsClusterProps["@HDPJobTrackerOptMaxNewSize@"] = "200m";
-$gsClusterProps["@HDPMapRedMapTasksMax@"] = "4";
-$gsClusterProps["@HDPMapRedReduceTasksMax@"] = "2";
-$gsClusterProps["@HDPMapRedClusterMapMemoryMB@"] = "-1";
-$gsClusterProps["@HDPMapRedClusterReduceMemoryMB@"] = "-1";
-$gsClusterProps["@HDPMapRedClusterMaxMapMemoryMB@"] = "-1";
-$gsClusterProps["@HDPMapRedClusterMaxReduceMemoryMB@"] = "-1";
-$gsClusterProps["@HDPMapRedJobMapMemoryMB@"] = "-1";
-$gsClusterProps["@HDPMapRedJobReduceMemoryMB@"] = "-1";
-$gsClusterProps["@HDPIoSortMB@"] = "200m";
-$gsClusterProps["@HDPIoSortSpillPercent@"] = "0.9";
-$gsClusterProps["@HDPMapReduceUserLogRetainHours@"] = "24";
-$gsClusterProps["@HDPMaxTasksPerJob@"] = "-1";
-$gsClusterProps["@HDPDFSDataNodeFailedVolumeTolerated@"] = "0";
- 
-$finalGsClusterPropsContents = str_replace(array_keys($gsClusterProps),
-    array_values($gsClusterProps), $templatedData);
-
-// Write out the completed file into gsInstaller-input-dir
-$finalGsClusterPropsFile = getInstallerInputDir($clusterName)."gsCluster.properties";
-file_put_contents($finalGsClusterPropsFile, $finalGsClusterPropsContents);
-//////////////////////////////// End of writing out the gsCluster.properties file
-
-// Copy monInstaller as is for now until we add templating support
-$copyDir = getInstallerInputDir($clusterName);
-system("cp -f /var/www/html/KickAssHDPUI/ShellScripts/templates/monInstaller.properties.in $copyDir/monInstaller.properties");
-
-header("Content-type: text/plain");
-print "";
-setupGsInstaller($clusterName);
-copyHostRoleFilesToRunDir($clusterName);
-setInstallStarted($clusterName);
-triggerGsInstaller($clusterName);
-
-
-?>

+ 0 - 77
hmc/archive/php/displayLogs.php

@@ -1,77 +0,0 @@
-<?php
-
-include 'dbLib.php';
-include 'utils.php';
-include 'gsInstallerUtils.php';
-
-// TODO: Hardcoded for now
-$clusterName = $_GET['clusterName'];
-//$clusterName = "MyCluster-12345";
-
-$getAll = FALSE;
-$lastN = 50;
-if (isset($_GET["lines"])) {
-  if ($_GET["lines"] == "all" ) {
-    $getAll = TRUE;
-  }
-  else if (is_numeric($_GET["lines"])) {
-    $lastN = $_GET["lines"];
-  }
-}
-
-$output = "";
-if ($getAll == TRUE) {
-  $output = getGsInstallLogs($clusterName);
-}
-else {
-  $output = getLastNLinesFromGsInstallLogs($clusterName, $lastN);
-}
-
-$gsInstallDone = isGsInstallDone($clusterName);
-
-header("Content-type: application/json");
-
-$response = array();
-
-$installstatus = getGsInstallExitStatus($clusterName);
-
-// NULL for error
-// 0 for success
-// 1 for error
-// -1 for installer running
-// -2 for not installed
-if ($installstatus === NULL) {
-   $response["installExitStatus"] = "UNKNOWN";
-} else if ($installstatus === 0) {
-   $response["installExitStatus"] = "SUCCESS";
-} else if ($installstatus === 1) {
-   $response["installExitStatus"] = "FAILURE";
-} else if ($installstatus === -1) {
-   $response["installExitStatus"] = "INSTALLING";
-} else if ($installstatus === -2) {
-   $response["installExitStatus"] = "NOTINSTALLED";
-} else {
-   $response["installExitStatus"] = "UNKNOWN";
-}
-
-if ($output === FALSE) {
-   $response["error"] = TRUE;
-   $response["logs"] = "";
-}
-else {
-   $response["error"] = FALSE;
-   $response["logs"] = $output;
-}
-
-$response["clusterName"] = $clusterName;
-$response["gsInstallDone"] = $gsInstallDone;
-
-print (json_encode($response));
-
-/*
-header("Content-type: text/plain");
-print $output;
-*/
-
-
-?>

+ 0 - 18
hmc/archive/php/displayNodeProgress.php

@@ -1,18 +0,0 @@
-<?php
-
-$logs = '';
-
-/* Generate long logs. */
-for($i = 0; $i < 100; $i++) {
-  $logs .= "1111 <br/>";
-}
-
-$jsonOutput = array( 
-    'txnId' => $txnId, 
-    'logs' => $logs );
-
-header("Content-type: application/json");
-
-print (json_encode($jsonOutput));
-
-?>

+ 0 - 18
hmc/archive/php/dummyDeploy.php

@@ -1,18 +0,0 @@
-<?php
-
-$clusterName = $_GET['clusterName'];
-
-header("Content-type: application/json");
-
-/* All we need to do is give back a new txnId. */
-$txnId = rand();
-
-error_log( 'Generated new txnId: ' . $txnId );
-
-$jsonOutput = array( 
-  'txnId' => $txnId,
-  'clusterName' => $clusterName );
-
-print (json_encode($jsonOutput));
-
-?>

+ 0 - 22
hmc/archive/php/dummyFetchTxnLogs.php

@@ -1,22 +0,0 @@
-<?php
-
-$txnId = $_GET['txnId'];
-
-define('LAST_PROGRESS_STATE_INDEX_FILE', '/tmp/rezDeployProgressStateIndex' . $txnId);
-
-$logs = '';
-
-/* Generate long logs. */
-for($i = 0; $i < 100; $i++) {
-  $logs .= "1111 <br/>";
-}
-
-$jsonOutput = array( 
-    'txnId' => $txnId, 
-    'logs' => $logs );
-
-header("Content-type: application/json");
-
-print (json_encode($jsonOutput));
-
-?>

+ 0 - 53
hmc/archive/php/dummyFetchTxnProgressReport.php

@@ -1,53 +0,0 @@
-<?php
-
-$txnId = $_GET['txnId'];
-
-define('LAST_PROGRESS_STATE_INDEX_FILE', '/tmp/rezDeployProgressStateIndex' . $txnId);
-
-function fetchLastProgressStateIndex()
-{
-  $lastProgressStateIndex = 0;
-
-  if( file_exists(LAST_PROGRESS_STATE_INDEX_FILE) )
-  {
-    $lastProgressStateIndex = trim( file_get_contents(LAST_PROGRESS_STATE_INDEX_FILE) );
-  }
-
-  return $lastProgressStateIndex;
-}
-
-function storeLastProgressStateIndex( $latestProgressStateIndex )
-{
-  file_put_contents(LAST_PROGRESS_STATE_INDEX_FILE, $latestProgressStateIndex);
-}
-
-$lastProgressStateIndex = fetchLastProgressStateIndex();
-
-$progressStates = array( 'State1', 'State2', 'State3', 'State4', 'State5' );
-$currentProgressStateIndex = $lastProgressStateIndex;
-
-/* Progress to the next state only if we haven't already reached the end. 
- *
- * We expect callers to stop to call this webservice once this condition is
- * reached in any case, but let's be safe all the same.
- */
-if( $lastProgressStateIndex < count($progressStates) )
-{
-  /* Randomize the rate of our progress, in steps of 1. */
-  $currentProgressStateIndex = (rand() % 2) ? ($lastProgressStateIndex + 1) : ($lastProgressStateIndex);
-
-  /* Update our disk cookie. */
-  storeLastProgressStateIndex( $currentProgressStateIndex );
-}
-
-$jsonOutput = array( 
-    'txnId' => $txnId, 
-    'progressStates' => $progressStates,
-    'currentProgressStateIndex' => $currentProgressStateIndex,
-    'encounteredError' => (rand() % 20) ? false : true );
-
-header("Content-type: application/json");
-
-print (json_encode($jsonOutput));
-
-?>

+ 0 - 17
hmc/archive/php/globals.inc

@@ -1,17 +0,0 @@
-<?php
-
-# Globals 
-
-$GLOBALS["CLUSTER_INFO"] = array();
-
-/*
-CLUSTER_INFO/cluster_id/services -> name, enabled, display name, masters ( name, display name, hostname ) 
-            /cluster_id/hosts/host - mem, cpu, disk info
-            /cluster_id/sys_info/mount_points
-            /
-            
-*/
-
-
-
-?>

+ 0 - 216
hmc/archive/php/gsInstallerUtils.php

@@ -1,216 +0,0 @@
-<?php
-
-$gsInstallerInstallDir = "/var/lib/gsInstaller/";
-
-/**
- * Function to copy over gsInstaller into a working dir
- * where we can override settings and execute the deploy
- */
-function setupGsInstaller($clusterId) {
-  // empty work dir
-  $workDir = getClusterDir($clusterId)."gsInstaller/";
-  $retval = 0;
-  system("rm -rf $workDir/*", $retval);
-  // if ($retval != 0) {
-    // die("Could not empty $workDir, error=$retval");
-  //}
-  $retval = 0;
-  system("mkdir -p $workDir", $retval);
-  //if ($retval != 0) {
-    //die("Could not empty $workDir, error=$retval");
-  //}
-  
-  // copy gs install code into work dir
-  global $gsInstallerInstallDir;
-  system("cp -rf $gsInstallerInstallDir/* $workDir/", $retval);
-  if ($retval != 0) {
-    die("Could not copy gsInstaller into $workDir, error=$retval");
-  }  
-}
-
-function copyGsInstallPropsToRunDir($clusterId, $gsInstallPropsFile) {
-  $workDir = getClusterDir($clusterId)."gsInstaller/";
-  $retval = 0;
-  system("cp -f $gsInstallPropsFile $workDir/*", $retval);
-  if ($retval != 0) {
-    die("Could not copy $gsInstallPropsFile into $workDir, error=$retval");
-  }
-}
-
-function copyHostRoleFilesToRunDir($clusterId) {
-  $workDir = getClusterDir($clusterId)."gsInstaller/";
-  
-  $file_list = array (
-     "dashboardhost",
-     "gangliaserver",
-     "gateway",
-     "hbasemaster",
-     "hbasenodes",
-     "hcatserver",
-     "jobtracker",
-     "nagiosserver",
-     "namenode",
-     "nodes",
-     "oozieserver",
-     "snamenode",
-     "templetonnode",
-     "zknodes",
-     "gsInstaller.properties",
-     "gsCluster.properties",
-     "monInstaller.properties",
-   );
-
-  $errors = "";
-  $installerInputDir = getInstallerInputDir($clusterId);
-  
-  foreach ($file_list as $filename) {
-    $filepath = $installerInputDir.$filename;
-    $retval = 0;
-    system("cp -f $filepath $workDir/$filename", $retval);
-    if ($retval != 0) {
-      $errors .= ", could not copy $filepath to $workDir: error=$retval";
-    }
-  }
-  
-  if ($errors != "") {
-    die ("Copy of host roles files failed, $errors");
-  }
-}
-
-function triggerGsUnInstaller($clusterId) {
-  $workDir = getClusterDir($clusterId)."gsInstaller/";
-  $retval = 0;
-
-  error_log("Running gs Uninstaller");
-  $logfile = $workDir."gsUnInstall-console.out";
-  $cmd="/var/www/html/KickAssHDPUI/cpp/runscriptasroot \""
-          . " cd $workDir; "
-          . " echo \"\" > $logfile " 
-          . " echo y | sh ./gsUninstaller.sh 2>&1 >> $logfile; "
-          . " \"";
-
-  $handle = popen($cmd, "r");
-  // Do some checks on return status: TODO
-  //print $cmd;
-  pclose($handle);
-}
-
-function triggerGsInstaller($clusterId) {
-  $workDir = getClusterDir($clusterId)."gsInstaller/";
-  $retval = 0;
-
-
-  error_log("Running gs installer");
-  $logfile = $workDir."gsInstall-console.out";
-  $cmd="/var/www/html/KickAssHDPUI/cpp/runscriptasroot \""
-          . " cd $workDir; "
-          . " echo \"\" > $logfile " 
-          . " sh createUsers.sh 2>&1 >> $logfile; "
-          . " sh gsPreRequisites.sh 2>&1 >> $logfile; "
-          . " echo y | sh ./gsInstaller.sh 2>&1 >> $logfile; "
-          . " \"";
-
-  error_log("Starting gsinstaller with $cmd".date("U"));
-  $handle = popen($cmd, "r");
-  // Do some checks on return status: TODO
-  //print $cmd;
-  pclose($handle);
-
-  // shell_exec($cmd);
-  error_log("Done with gsinstaller".date("U"));
-
-  # TODO error check
-
-  # TODO run moninstaller
-
-  return $retval;
-}
-
-function getGsInstallerLogPath($clusterId) {
-  return getClusterDir($clusterId)."gsInstaller/gsInstall.log";
-}
-
-function getGsInstallerStatusDumpPath($clusterId) {
-  return getClusterDir($clusterId)."gsInstaller/gsInstallStatusDump.out";
-}
-
-function getLastNLinesFromGsInstallLogs($clusterId, $lastNlines) {
-  $cmd = "tail -".$lastNlines." ".getGsInstallerLogPath($clusterId);
-  $handle = popen($cmd, "r");
-  // TODO error check
-  $output = "";
-  while (!feof($handle)) {
-    $read = fread($handle, 2096);
-    $output .= $read;
-  }
-  pclose($handle);
-  return $output;
-}
-
-function getGsInstallLogs($clusterId) {
-  if (!file_exists(getGsInstallerLogPath($clusterId))) {
-     return FALSE;
-  }
-  return file_get_contents(getGsInstallerLogPath($clusterId));
-}
-
-function isGsInstallDone($clusterId) {
-  $retval = 0;
-  $outdump = array();
-  $psGrepOutput = exec("ps -ef | grep -i \"gsInstaller.sh\" | grep -v grep | wc -l", $outdump, $retval);
-  $output = trim($psGrepOutput);
-
-  if ($retval != 0 || $output == "0") {
-    return TRUE;
-  }
-  return FALSE;
-}
-
-// NULL for error
-// 0 for success
-// 1 for error
-// -1 for installer running
-// -2 for not installed
-function getGsInstallExitStatus($clusterId) {
-  $statusFile = getGsInstallerStatusDumpPath($clusterId);
-  if (!file_exists($statusFile)) {
-    return NULL;
-  }
-  $cmd = "grep \"^EXIT \" $statusFile";
-  $retval = "";
-  $output = array();
-  $retcode = 0;
-  $retval = exec($cmd, $output, $retcode);
-
-  $installDone = isGsInstallDone($clusterId);
-  if (!$installDone) {
-     return -1;
-  }
-
-  if (!hasInstallStarted($clusterId)) {
-     return -2;
-  }
-
-  if ($retcode != 0 && $installDone) {
-     error_log("Install done but no exit stmt in status output");
-     return NULL;
-  }
-
-  if (!defined($retval) || $retval == "") {
-    return NULL;
-  }
-
-  if (strpos($retval, "EXIT OK") == 0) {
-     return 0;
-  }
-
-  if (strpos($retval, "EXIT ERROR") == 0) {
-     return 1;
-  }
-
-  return NULL;
-}
-
-
-
-?>

+ 0 - 281
hmc/archive/php/initializeCluster.php

@@ -1,281 +0,0 @@
-<?php
-include './dbLib.php';
-include './utils.php';
-
-// Read from the input
-$requestdata = file_get_contents('php://input');
-//error_log($requestdata, 3, "/tmp/rez.log");
-$requestObj = json_decode($requestdata, true);
-
-$clusterName = $_GET['clusterName'];
-// Validate clusterName: TODO; FIXME
-$clusterDir = getClusterDir($clusterName);
-/*
-if(!is_dir($clusterDir)) {
-  print "Cluster ".$clusterName." doesn't exist";
-  exit 1;
-}
-*/
-
-$suggestNodesScriptInputDir = $clusterDir."/suggestNodesScriptInputDir/";
-$suggestNodesScriptOutputDir = $clusterDir."/suggestNodesScriptOutputDir/";
-mkdir($suggestNodesScriptInputDir); // TODO: Check error conditions
-mkdir($suggestNodesScriptOutputDir);// TODO: Check error conditions
-
-// Hard code host and identity files for now
-//$requestObj['ClusterDeployUserIdentityFile']="va_rsa";
-//$requestObj['ClusterHostsFile']="hostsFile.txt";
-
-// write the input file to the node-suggestor
-$fp = fopen($suggestNodesScriptInputDir."/data.txt", 'w');
-fwrite($fp, 'HDPClusterDeployUser='.$requestObj['ClusterDeployUser']."\n");
-fwrite($fp, 'HDPClusterDeployUserIdentityFile='.getSshKeyFilePath($clusterName)."\n");
-fwrite($fp, 'HDPClusterHostsFile='.getHostsFilePath($clusterName)."\n");
-fclose($fp);
-
-// invoke the node-suggstor
-$cmd = "/var/www/html/KickAssHDPUI/archive/ShellScripts/suggestNodes.sh ".$suggestNodesScriptInputDir."/data.txt ".$suggestNodesScriptOutputDir;
-$handle = popen($cmd, "r");
-// Do some checks on return status: TODO
-while (!feof($handle)) {
-  $read = fread($handle, 2096);
-  #error_log($read, 3, "/tmp/errors.txt");
-}
-pclose($handle);
-
-function ReadHostNameFromFile ($fileName)
-{
-  $fp = fopen($fileName, "r");
-  $fsize = filesize($fileName);
-  if ($fsize == 0) {
-    return "";
-  }
-  $retval = fread($fp, $fsize);
-  $retval = explode(' ', $retval);
-  fclose($fp);
-  return $retval[0];
-}
-
-// Read the output from the node-suggestor
-
-$GatewaySuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/GatewaySuggest.out");
-$NameNodeSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/NameNodeSuggest.out");
-$JobTrackerSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/JobTrackerSuggest.out");
-$SecondaryNameNodeSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/SecondaryNameNodeSuggest.out");
-$HBaseMasterSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/HBaseMasterSuggest.out");
-$HCatalogServerSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/HCatalogServerSuggest.out");
-$OozieServerSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/OozieServerSuggest.out");
-$TempletonNodeSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/TempletonNodeSuggest.out");
-$GangliaCollectorSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/GangliaCollectorSuggest.out");
-$NagiosServerSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/NagiosServerSuggest.out");
-/// TODO: FIXME: Why is monitoring dashboard different from management console
-$DashboardSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/DashboardSuggest.out");
-$AllHosts = ReadNthWordsOfAllLinesFromFile($suggestNodesScriptOutputDir."/HostDiscovery.out", 1);
-
-/// TODO: Move to next phase
-$NameNodeMountPointsSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/NameNodeMountPointsSuggest.out");
-
-$jsonOutput = array(
-            "clusterName" => $clusterName,
-            "services" => array(
-             "$MapredName" =>   array (
-                 "name" => $MapredName,
-                 "enabled" => true,
-                 "displayName" => "Mapreduce",
-                 "masters" => array(
-                                     $JobTrackerName => array (
-                                       "name" => $JobTrackerName,
-                                       "displayName" => "JobTracker",
-                                       "hostName" => $JobTrackerSuggestOut,
-                                       ),
-                                  ),
-                 "properties" => array(),
-                ),
-             "$HDFSName" =>  array (
-                 "name" => $HDFSName,
-                 "enabled" => true,
-                 "displayName" => "HDFS",
-                 "masters" => array(
-                                     $NameNodeName => array (
-                                       "name" => $NameNodeName,
-                                       "displayName" => "NameNode",
-                                       "hostName" => $NameNodeSuggestOut,
-                                       ),
-                                     $SecondaryNameNodeName => array (
-                                       "name" => $SecondaryNameNodeName,
-                                       "displayName" => "Secondary NameNode",
-                                       "hostName" => $SecondaryNameNodeSuggestOut,
-                                       ),
-                                  ),
-                 "properties" => array(),
-                ),
-             "$PigName" => array (
-                 "name" => $PigName,
-                 "enabled" => $requestObj["InstallPig"],
-                 "displayName" => "Pig",
-                 "masters" => array(),
-                 "properties" => array(),
-                ),
-             "$HBaseName" => array (
-                 "name" => $HBaseName,
-                 "enabled" => $requestObj["InstallHBase"],
-                 "displayName" => "HBase",
-                 "masters" => array(
-                                     $HBaseMasterName => array (
-                                       "name" => $HBaseMasterName,
-                                       "displayName" => "HBase Master",
-                                       "hostName" => $HBaseMasterSuggestOut,
-                                       ),
-                                  ),
-                 "properties" => array(),
-                ),
-              "$OozieName" => array (
-                 "name" => $OozieName,
-                 "enabled" => $requestObj["InstallOozie"],
-                 "displayName" => "Oozie",
-                 "masters" => array(
-                                     $OozieServerName => array (
-                                       "name" => $OozieServerName,
-                                       "displayName" => "Oozie Server",
-                                       "hostName" => $OozieServerSuggestOut,
-                                       ),
-                                  ),
-                 "properties" => array(),
-                ),
-              "$HCatName" => array (
-                 "name" => $HCatName,
-                 "enabled" => $requestObj["InstallHCatalog"],
-                 "displayName" => "HCatalog",
-                 "masters" => array(
-                                     $HCatServerName => array (
-                                       "name" => $HCatServerName,
-                                       "displayName" => "HCatalog Server",
-                                       "hostName" => $HCatalogServerSuggestOut,
-                                       ),
-
-                                 ),
-                 "properties" => array(),
-                ),
-              "$TempletonName" => array (
-                 "name" => $TempletonName,
-                 "enabled" => $requestObj["InstallTempleton"],
-                 "displayName" => "Templeton",
-                 "masters" => array(
-                                     $TempletonNodeName => array (
-                                       "name" => $TempletonNodeName,
-                                       "displayName" => "Templeton Node",
-                                       "hostName" => $TempletonNodeSuggestOut,
-                                       ),
-                                  ),
-                 "properties" => array(),
-                ),
-            "$SqoopName" =>  array (
-                 "name" => $SqoopName,
-                 "enabled" => $requestObj["InstallSqoop"],
-                 "displayName" => "Sqoop",
-                 "masters" => array(),
-                 "properties" => array(),
-                ),
-             "$GatewayName" => array (
-                 "name" => $GatewayName,
-                 "enabled" => true,
-                 "displayName" => "Gateway",
-                 "masters" => array(),
-                 "properties" => array(),
-                ),
-             "$ZooKeeperName" => array (
-                 "name" => $ZooKeeperName,
-                 "enabled" => $requestObj["InstallHBase"], // TODO: FIXME dependencies
-                 "displayName" => "ZooKeeper",
-                 "masters" => array(),
-                 "properties" => array(),
-                ),
-             "$GangliaCollectorName" => array (
-                 "name" => $GangliaCollectorName,
-                 "enabled" => true,
-                 "displayName" => "Ganglia Collector",
-                 "masters" => array(
-                                     $GangliaCollectorName => array (
-                                       "name" => $GangliaCollectorName,
-                                       "displayName" => "Ganglia Collector",
-                                       "hostName" => $GangliaCollectorSuggestOut,
-                                       ),
-                                  ),
-                 "properties" => array(),
-                ),
-             "$NagiosName" => array (
-                 "name" => $NagiosName,
-                 "enabled" => true,
-                 "displayName" => "Nagios",
-                 "masters" => array(
-                                     $NagiosServerName => array (
-                                       "name" => $NagiosServerName,
-                                       "displayName" => "Nagios Server",
-                                       "hostName" => $NagiosServerSuggestOut,
-                                       ),
-                                  ),
-                 "properties" => array(),
-                ),
-             "miscellaneous" => array(
-                  "properties" => array(),
-                  "masters" => array(),
-                ),
-            ),
-            "allHosts"=> $AllHosts,
-            "hosts" => array(),
-            "sysInfo" => array(
-               "mountPoints" => array(),
-              ),
-            "installInfo" => array (
-               "deployUser" => $requestObj['ClusterDeployUser']
-              ),
-           );
-
-/*
-/////////////////// Persist the services list to the DB
-$services = array();
-if($requestObj["InstallHBase"] == "true") {
-  array_push($services, $HBaseName);
-}
-if($requestObj["InstallPig"] == "true") {
-  array_push($services, $PigName);
-}
-if($requestObj["InstallHCatalog"] == "true") {
-  array_push($services, $HCatName);
-}
-if($requestObj["InstallOozie"] == "true") {
-  array_push($services, $OozieName);
-}
-if($requestObj["InstallTempleton"] == "true") {
-  array_push($services, $TempletonName);
-}
-if($requestObj["InstallSqoop"] == "true") {
-  array_push($services, $SqoopName);
-}
-storeSelectedServiceNames($services);
-/////////////////// End of persisting the services list
-*/
-
-/// Store cluster selection info
-persistClusterInfo($clusterName, $jsonOutput);
-
-global $CLUSTER_STATUS_CONFIG_IN_PROGRESS;
-setClusterStatus($clusterName, $CLUSTER_STATUS_CONFIG_IN_PROGRESS);
-
-header("Content-type: application/json");
-
-// re-work svc array for UI
-$svc_array = $jsonOutput["services"];
-$jsonOutput["services"] = array();
-
-foreach ($svc_array as $key=>$arr) {
-  $svc_arr = $arr;
-  $svc_arr["masters"] = array();
-  foreach ($arr["masters"] as $role=>$role_arr) {
-    array_push($svc_arr["masters"], $role_arr);
-  }
-  array_push($jsonOutput["services"], $svc_arr);
-}
-
-print (json_encode($jsonOutput));
-?>

+ 0 - 38
hmc/archive/php/listClusters.php

@@ -1,38 +0,0 @@
-<?php
-
-include 'dbLib.php';
-include 'gsInstallerUtils.php';
-
-$listOfClusters = array();
-if ($handle = opendir(getAllClustersDir())) {
-  while (($clusterId = readdir($handle)) !== FALSE) {
-    if ($clusterId != "." && $clusterId != "..") {
-         
-      // Return clusterId only if the deploy has started
-      // if(hasInstallStarted($clusterId)) {
-     //     array_push($listOfClusters, $clusterId);
-        $status = getClusterStatus($clusterId);
-        global $CLUSTER_STATUS_INSTALL_IN_PROGRESS;
-        global $CLUSTER_STATUS_INSTALL_DONE;
-        global $CLUSTER_STATUS_INSTALL_SUCCESSFUL;
-        global $CLUSTER_STATUS_INSTALL_UNSUCCESSFUL;
-
-        if ($status == $CLUSTER_STATUS_INSTALL_IN_PROGRESS) {
-           if (isGsInstallDone($clusterId)) {
-             setClusterStatus($clusterId, $CLUSTER_STATUS_INSTALL_DONE);
-           }
-         }
-
-        $listOfClusters[$clusterId] = getClusterStatus($clusterId);
-      //  $listOfClusters[$clusterId] = "started";//getClusterStatus($clusterId);
-      //}
-    }
-  }
-  closedir($handle);
-}
-
-header("Content-type: application/json");
-//print (json_encode($listOfClusters));
-print (json_encode($listOfClusters));
-
-?>

+ 0 - 2
hmc/archive/php/memorySuggestor-data.txt

@@ -1,2 +0,0 @@
-HDPClusterDeployUser=root
-HDPClusterDeployUserIdentityFile=/var/run/HMCDir/clusters/MyCluster-12345/user-ssh-key

+ 0 - 54
hmc/archive/php/options.php

@@ -1,54 +0,0 @@
-<?php
-include 'dbLib.php';
-include 'utils.php';
-
-// Read from the input
-$requestdata = file_get_contents('php://input');
-$obj = json_decode($requestdata, true);
-
-$clusterName = $_GET['clusterName'];
-
-// Store the final options that the user has submitted
-error_log(json_encode($obj), 0);
-storeOptions($clusterName, $obj);
-$clusterDeployUser = getClusterDeployUser($clusterName);
-$clusterDir = getClusterDir($clusterName);
-
-// write the input file to the node-suggestor
-$scriptInputDataFile = $clusterDir."memorySuggestor-data.txt";
-$fp = fopen($scriptInputDataFile, 'w');
-fwrite($fp, 'HDPClusterDeployUser='.$clusterDeployUser."\n");
-fwrite($fp, 'HDPClusterDeployUserIdentityFile='.getSshKeyFilePath($clusterName)."\n");
-fclose($fp);
-
-$installerInputDir = getInstallerInputDir($clusterName);
-$outputFile = $clusterDir."memorySuggestor-output.txt";
-$cmd = "/var/www/html/KickAssHDPUI/archive/ShellScripts/suggestMemSize.sh ".$installerInputDir." ".$scriptInputDataFile." ".$outputFile." 0";
-$handle = popen($cmd, "r");
-// Do some checks on return status: TODO
-//print $cmd;
-//echo "'$handle'; " . gettype($handle) . "\n";
-while (!feof($handle)) {
-  $read = fread($handle, 2096);
-  // echo $read;
-}
-pclose($handle);
-
-$keys = ReadNthWordsOfAllLinesFromFile($outputFile, 1);
-$values = ReadNthWordsOfAllLinesFromFile($outputFile, 2);
-
-$memOptionSuggestions = array();
-for ($i = 0; $i < sizeof($keys); $i++) {
-  if (isset($values[$i])) {
-    $memOptionSuggestions[$keys[$i]] = $values[$i];
-  }
-}
-// Persist it now itself. TODO: Move this to next megaConfigure page.
-storeMemoryOptionSuggestions($clusterName, $memOptionSuggestions);
-
-//print (json_encode($memOptionSuggestions));
-
-// Give the whole db
-header("Content-type: application/json");
-print (json_encode(getPersistedClusterInfo($clusterName)));
-?>

+ 0 - 24
hmc/archive/php/pluggableDisplayHeaderFooter.php

@@ -1,24 +0,0 @@
-<?php
-
-function get_header() {
-  $header = <<<HEADER
-    <img src="./logo.jpg"/>
-    <section id="headerText">Hortonworks Data Platform</section>
-HEADER;
-
-  return $header;
-}
-
-function get_footer() {
-  return "";
-}
-
-function render_header() {
-  print "<header>\n".get_header()."\n</header>\n";
-}
-
-function render_footer() {
-  print "<footer>\n".get_footer()."\n</footer>\n";
-}
-
-?>

+ 0 - 91
hmc/archive/php/serviceAdmin.php

@@ -1,91 +0,0 @@
-<?php
-
-include 'dbLib.php';
-include 'utils.php';
-include 'gsInstallerUtils.php';
-
-// TODO: Hardcoded for now
-$clusterName = $_GET['clusterName'];
-// $clusterName = "MyCluster-12345";
-
-$serviceName = $_GET['Service'];
-$action = $_GET['Action'];
-
-$clusterInfo = getPersistedClusterInfo($clusterName);
-$servicesInfo = $clusterInfo["services"];
-
-function sendBadRequestResponse($msg) {
- header('Content-type: application/json');
- header("HTTP/1.0 400 Bad Request");
- $result = array();
- $result["error"] = $msg;
- $result["success"] = FALSE;
- print(json_encode($result));
-}
-
-function sendErrorResponse($msg) {
- header('Content-type: application/json');
- header("HTTP/1.0 500 Internal Server Error");
- $result = array();
- $result["error"] = $msg;
- $result["success"] = FALSE;
- print(json_encode($result));
-}
-
-function returnSuccessResponse() {
-  header('Content-type: application/json');
-  header("HTTP/1.1 200 OK");
-  print(json_encode(array("success" => TRUE)));
-}
-
-function takeServiceAction($svc, $actionSvc, $action) {
-  global $servicesInfo;
-  global $clusterName;
-  if (!isset($servicesInfo[$svc]["enabled"])
-      || $servicesInfo[$svc]["enabled"] == false) {
-     return sendErrorResponse("Service $svc is not installed");
-  }
-
-  if (hasInstallStarted($clusterName) && !isGsInstallDone($clusterName)) {
-    return sendErrorResponse("Service $svc installation is still in progress");
-  }
-
-  $workDir = getClusterDir($clusterName)."gsInstaller/";
-  $cmd="/var/www/html/KickAssHDPUI/cpp/runscriptasroot \"cd $workDir; echo y | sh ./gsInstaller-cmdline.sh --action=$action --services=$actionSvc \"";
-
-  $handle = popen($cmd, "r");
-  // Do some checks on return status: TODO
-  // print $cmd;
-  // echo "'$handle'; " . gettype($handle) . "\n";
-  // while (!feof($handle)) {
-    // $read = fread($handle, 2096);
-    // fwrite($loghandle, $read);
-  // }
-  pclose($handle);
-
-  return returnSuccessResponse();
-
-}
-
-if ($action != "start" && $action != "stop") {
-  return sendBadRequestResponse("Invalid action : $action");
-}
-
-if ($serviceName == $HDFSName) {
-  takeServiceAction($serviceName, "hdfs", $action);
-} else if ($serviceName == $MapredName) {
-  takeServiceAction($serviceName, "mapreduce", $action);
-} else if ($serviceName == $HBaseName) {
-  takeServiceAction($serviceName, "hbase", $action);
-} else if ($serviceName == $HCatName) {
-  takeServiceAction($serviceName, "hcat", $action);
-} else if ($serviceName == $TempletonName) {
-  takeServiceAction($serviceName, "templeton", $action);
-} else if ($serviceName == $OozieName) {
-  takeServiceAction($serviceName, "oozie", $action);
-} else {
-  return sendBadRequestResponse("Invalid service : $serviceName");
-}
-
-
-?>

+ 0 - 181
hmc/archive/php/servicesStatus.php

@@ -1,181 +0,0 @@
-<?php
-
-include 'dbLib.php';
-include 'utils.php';
-include 'gsInstallerUtils.php';
-
-// TODO: Hardcoded for now
-$clusterName = $_GET['clusterName'];
-//$clusterName = "MyCluster-12345";
-// Validate clusterName: TODO; FIXME
-//$clusterDir = getClusterDir($clusterName);
-$clusterInfo = getPersistedClusterInfo($clusterName);
-$servicesInfo = $clusterInfo["services"];
-
-
-$SERVICE_CHECKS_INSTALLDIR="/var/lib/gsInstaller/service_checks/";
-$NN_SCRIPT="check_namenode_up.sh";
-$HBM_SCRIPT="check_hbasemaster_up.sh";
-$HCAT_SCRIPT="check_hcatserver_up.sh";
-$JT_SCRIPT="check_jobttracker_up.sh";
-$OOZIE_SCRIPT="check_oozieserver_up.sh";
-$TEMPLETON_SCRIPT="check_templeton_up.sh";
-$ZK_SCRIPT="check_zookeeper_cluster_up.sh";
-
-
-function convertStatusNumToString($num) {
-  $ret = "UNKNOWN ERROR";
-  switch ($num) {
-    case 0:
-      $ret = "RUNNING";
-      break;
-    case 1:
-      $ret = "RUNNING IN DEGRADED MODE";
-      break;
-    case 2:
-      $ret = "NOT RUNNING";
-      break;
-    case 3:
-      $ret = "UNKNOWN ERROR";
-      break;
-    case 4:
-      $ret = "NOT INSTALLED";
-      break;
-    case 5:
-      $ret = "INSTALLATION IN PROGRESS";
-      break;
-  }
-  return $ret;
-}
-
-// 0 ok - running
-// 1 warn
-// 2 crit
-// 3 unknown
-// 4 uninstalled
-// 5 install in progress
-function getSvcStatus($svc, $role, $script) {
-  global $servicesInfo;
-  global $clusterName;
-  if (!isset($servicesInfo[$svc]["enabled"]) 
-      || $servicesInfo[$svc]["enabled"] == false) {
-    return 4;
-  }
-  
-  if (hasInstallStarted($clusterName) && !isGsInstallDone($clusterName)) {
-    return 5;
-  }
-
-  $host = $servicesInfo[$svc]["masters"][$role]["hostName"];
-
-  global $SERVICE_CHECKS_INSTALLDIR;
-  $script_path=$SERVICE_CHECKS_INSTALLDIR.$script;
-  if (!file_exists($script_path)) {
-    error_log("Could not find check script $script_path for $svc : $role");
-    return 3;
-  }
-  $cmd=$script_path." --host $host";
-  $retval = 3;
-  //system($cmd, $retval);
-
-  $handle = popen($cmd, "r");
-  // TODO error check
-  $output = "";
-  while (!feof($handle)) {
-    $read = fread($handle, 2096);
-    $output .= $read;
-  }
-  pclose($handle);
- 
-  error_log("Ouput for $svc check: $output");
-
-  if ($output == "") {
-     $retval = 3;
-  } else if (strpos($output, "OK:") === 0) {
-     $retval = 0;
-  } else if (strpos($output, "WARNING:") === 0) {
-     $retval = 1;
-  } else if (strpos($output, "CRITICAL:") === 0) {
-     $retval = 2;
-  }
-
-  return $retval;
-}
-
-function getHdfsStatus() {
-  global $NN_SCRIPT;
-  return getSvcStatus("hdfs", "nameNode", $NN_SCRIPT);
-}
-
-function getMapRedStatus() {
-  global $JT_SCRIPT;
-  return getSvcStatus("mapReduce", "jobTracker", $JT_SCRIPT);
-}
-
-
-function getHBaseStatus() {
-  global $HBM_SCRIPT;
-  return getSvcStatus("hBase", "hBaseMaster", $HBM_SCRIPT);
-}
-
-function getHCatStatus() {
-  global $HCAT_SCRIPT;
-  return getSvcStatus("hCatalog", "hCatServer", $HCAT_SCRIPT);
-}
-
-
-/*
-function getZKStatus() {
-  global $ZK_SCRIPT;
-  return getSvcStatus("zooKeeper", 
-}
-*/
-
-function getOozieStatus() {
-  global $OOZIE_SCRIPT;
-  return getSvcStatus("oozie", "oozieServer", $OOZIE_SCRIPT);
-}
-
-function getTempletonStatus() {
-  global $TEMPLETON_SCRIPT;
-  return getSvcStatus("templeton", "templetonNode", $TEMPLETON_SCRIPT);
-}
-
-$serviceStatus = array(
-    $servicesInfo[$HDFSName]["displayName"] => array(
-                           "description" => "The Hadoop distributed file-system",
-                           "statusNum" => getHdfsStatus(),
-                        ),
-    $servicesInfo[$MapredName]["displayName"] => array(
-                           "description" => "The Hadoop MapReduce processing platform",
-                           "statusNum" => getMapRedStatus(),
-                        ),
-    $servicesInfo[$HBaseName]["displayName"] => array(
-                           "description" => "The Hadoop Database",
-                           "statusNum" => getHBaseStatus(),
-                        ),
-    $servicesInfo[$HCatName]["displayName"] => array(
-                           "description" => "The Hadoop Catalog",
-                           "statusNum" => getHcatStatus(),
-                        ),
-    $servicesInfo[$TempletonName]["displayName"] => array(
-                           "description" => "Hadoop web-services",
-                           "statusNum" => getTempletonStatus(),
-                        ),
-    $servicesInfo[$OozieName]["displayName"] => array(
-                           "description" => "Hadoop job-workflow system",
-                           "statusNum" => getOozieStatus(),
-                        ),
-  );
-
-foreach ($serviceStatus as $key=>$status) {
-  $serviceStatus[$key]["status"] = convertStatusNumToString($serviceStatus[$key]["statusNum"]);
-}
-
-$response = array();
-$response["serviceStatus"] = $serviceStatus;
-
-header("Content-type: application/json");
-print(json_encode($response));
-
-?>

+ 0 - 280
hmc/archive/php/tmpInitializeCluster.php

@@ -1,280 +0,0 @@
-<?php
-include './dbLib.php';
-include './utils.php';
-
-// Read from the input
-$requestdata = file_get_contents('php://input');
-//error_log($requestdata, 3, "/tmp/rez.log");
-$requestObj = json_decode($requestdata, true);
-
-$clusterName = $_GET['clusterName'];
-// Validate clusterName: TODO; FIXME
-$clusterDir = getClusterDir($clusterName);
-/*
-if(!is_dir($clusterDir)) {
-  print "Cluster ".$clusterName." doesn't exist";
-  exit 1;
-}
-*/
-
-$suggestNodesScriptInputDir = $clusterDir."/suggestNodesScriptInputDir/";
-$suggestNodesScriptOutputDir = $clusterDir."/suggestNodesScriptOutputDir/";
-mkdir($suggestNodesScriptInputDir); // TODO: Check error conditions
-mkdir($suggestNodesScriptOutputDir);// TODO: Check error conditions
-
-// Hard code host and identity files for now
-//$requestObj['ClusterDeployUserIdentityFile']="va_rsa";
-//$requestObj['ClusterHostsFile']="hostsFile.txt";
-
-// write the input file to the node-suggestor
-$fp = fopen($suggestNodesScriptInputDir."/data.txt", 'w');
-fwrite($fp, 'HDPClusterDeployUser='.$requestObj['ClusterDeployUser']."\n");
-fwrite($fp, 'HDPClusterDeployUserIdentityFile='.getSshKeyFilePath($clusterName)."\n");
-fwrite($fp, 'HDPClusterHostsFile='.getHostsFilePath($clusterName)."\n");
-fclose($fp);
-
-// invoke the node-suggstor
-$cmd = "/var/www/html/KickAssHDPUI/ShellScripts/suggestNodes.sh ".$suggestNodesScriptInputDir."/data.txt ".$suggestNodesScriptOutputDir;
-$handle = popen($cmd, "r");
-// Do some checks on return status: TODO
-while (!feof($handle)) {
-  $read = fread($handle, 2096);
-  #error_log($read, 3, "/tmp/errors.txt");
-}
-pclose($handle);
-
-function ReadHostNameFromFile ($fileName)
-{
-  $fp = fopen($fileName, "r");
-  $retval = fread($fp, filesize($fileName));
-  $retval = explode(' ', $retval);
-  fclose($fp);
-  return $retval[0];
-}
-
-// Read the output from the node-suggestor
-
-$GatewaySuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/GatewaySuggest.out");
-$NameNodeSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/NameNodeSuggest.out");
-$JobTrackerSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/JobTrackerSuggest.out");
-$SecondaryNameNodeSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/SecondaryNameNodeSuggest.out");
-$HBaseMasterSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/HBaseMasterSuggest.out");
-$HCatalogServerSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/HCatalogServerSuggest.out");
-$OozieServerSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/OozieServerSuggest.out");
-$TempletonNodeSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/TempletonNodeSuggest.out");
-$GangliaCollectorSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/GangliaCollectorSuggest.out");
-$NagiosServerSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/NagiosServerSuggest.out");
-/// TODO: FIXME: Why is monitoring dashboard different from management console
-$DashboardSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/DashboardSuggest.out");
-$AllHosts = ReadNthWordsOfAllLinesFromFile($suggestNodesScriptOutputDir."/HostDiscovery.out", 1);
-
-/// TODO: Move to next phase
-$NameNodeMountPointsSuggestOut = ReadHostNameFromFile($suggestNodesScriptOutputDir."/NameNodeMountPointsSuggest.out");
-
-$jsonOutput = array(
-            "clusterName" => $clusterName,
-            "services" => array(
-             "$MapredName" =>   array (
-                 "name" => $MapredName,
-                 "enabled" => true,
-                 "displayName" => "Mapreduce",
-                 "masters" => array(
-                                     $JobTrackerName => array (
-                                       "name" => $JobTrackerName,
-                                       "displayName" => "JobTracker",
-                                       "hostName" => $JobTrackerSuggestOut,
-                                       ),
-                                  ),
-                 "properties" => array(
-                                       "EnableLzo" => false,
-                                      ),
-                ),
-             "$HDFSName" =>  array (
-                 "name" => $HDFSName,
-                 "enabled" => true,
-                 "displayName" => "HDFS",
-                 "masters" => array(
-                                     $NameNodeName => array (
-                                       "name" => $NameNodeName,
-                                       "displayName" => "NameNode",
-                                       "hostName" => $NameNodeSuggestOut,
-                                       ),
-                                     $SecondaryNameNodeName => array (
-                                       "name" => $SecondaryNameNodeName,
-                                       "displayName" => "Secondary NameNode",
-                                       "hostName" => $SecondaryNameNodeSuggestOut,
-                                       ),
-                                  ),
-                 "properties" => array(),
-                ),
-             "$PigName" => array (
-                 "name" => $PigName,
-                 "enabled" => $requestObj["InstallPig"],
-                 "displayName" => "Pig",
-                 "masters" => array(),
-                 "properties" => array(),
-                ),
-             "$HBaseName" => array (
-                 "name" => $HBaseName,
-                 "enabled" => $requestObj["InstallHBase"],
-                 "displayName" => "HBase",
-                 "masters" => array(
-                                     $HBaseMasterName => array (
-                                       "name" => $HBaseMasterName,
-                                       "displayName" => "HBase Master",
-                                       "hostName" => $HBaseMasterSuggestOut,
-                                       ),
-                                  ),
-                 "properties" => array(),
-                ),
-              "$OozieName" => array (
-                 "name" => $OozieName,
-                 "enabled" => $requestObj["InstallOozie"],
-                 "displayName" => "Oozie",
-                 "masters" => array(
-                                     $OozieServerName => array (
-                                       "name" => $OozieServerName,
-                                       "displayName" => "Oozie Server",
-                                       "hostName" => $OozieServerSuggestOut,
-                                       ),
-                                  ),
-                 "properties" => array(),
-                ),
-              "$HCatName" => array (
-                 "name" => $HCatName,
-                 "enabled" => $requestObj["InstallHCatalog"],
-                 "displayName" => "HCatalog",
-                 "masters" => array(
-                                     $HCatServerName => array (
-                                       "name" => $HCatServerName,
-                                       "displayName" => "HCatalog Server",
-                                       "hostName" => $HCatalogServerSuggestOut,
-                                       ),
-
-                                     $MySqlServerName => array (
-                                       "name" => $MySqlServerName,
-                                       "displayName" => "MySql Server",
-                                       "hostname" => "",
-                                       "dbname" => "",
-                                       "dbuser" => "",
-                                       "dbpasswd" => "",
-                                       ),
-                                  ),
-                 "properties" => array(),
-                ),
-              "$TempletonName" => array (
-                 "name" => $TempletonName,
-                 "enabled" => $requestObj["InstallTempleton"],
-                 "displayName" => "Templeton",
-                 "masters" => array(
-                                     $TempletonNodeName => array (
-                                       "name" => $TempletonNodeName,
-                                       "displayName" => "Templeton Node",
-                                       "hostName" => $TempletonNodeSuggestOut,
-                                       ),
-                                  ),
-                 "properties" => array(),
-                ),
-            "$SqoopName" =>  array (
-                 "name" => $SqoopName,
-                 "enabled" => $requestObj["InstallSqoop"],
-                 "displayName" => "Sqoop",
-                 "masters" => array(),
-                 "properties" => array(),
-                ),
-             "$GatewayName" => array (
-                 "name" => $GatewayName,
-                 "enabled" => true,
-                 "displayName" => "Gateway",
-                 "masters" => array(),
-                 "properties" => array(),
-                ),
-             "$ZooKeeperName" => array (
-                 "name" => $ZooKeeperName,
-                 "enabled" => $requestObj["InstallHBase"], // TODO: FIXME dependencies
-                 "displayName" => "ZooKeeper",
-                 "masters" => array(),
-                 "properties" => array(),
-                ),
-             "$GangliaCollectorName" => array (
-                 "name" => $GangliaCollectorName,
-                 "enabled" => true,
-                 "displayName" => "Ganglia Collector",
-                 "masters" => array(
-                                     $GangliaCollectorName => array (
-                                       "name" => $GangliaCollectorName,
-                                       "displayName" => "Ganglia Collector",
-                                       "hostName" => $GangliaCollectorSuggestOut,
-                                       ),
-                                  ),
-                 "properties" => array(),
-                ),
-             "$NagiosName" => array (
-                 "name" => $NagiosName,
-                 "enabled" => true,
-                 "displayName" => "Nagios",
-                 "masters" => array(
-                                     $NagiosServerName => array (
-                                       "name" => $NagiosServerName,
-                                       "displayName" => "Nagios Server",
-                                       "hostName" => $NagiosServerSuggestOut,
-                                       ),
-                                  ),
-                 "properties" => array(),
-                ),
-            ),
-            "allHosts"=> $AllHosts,
-            "hosts" => array(),
-            "sysInfo" => array(
-               "mountPoints" => array(),
-              ),
-            "installInfo" => array (
-               "deployUser" => $requestObj['ClusterDeployUser']
-              ),
-           );
-
-/*
-/////////////////// Persist the services list to the DB
-$services = array();
-if($requestObj["InstallHBase"] == "true") {
-  array_push($services, $HBaseName);
-}
-if($requestObj["InstallPig"] == "true") {
-  array_push($services, $PigName);
-}
-if($requestObj["InstallHCatalog"] == "true") {
-  array_push($services, $HCatName);
-}
-if($requestObj["InstallOozie"] == "true") {
-  array_push($services, $OozieName);
-}
-if($requestObj["InstallTempleton"] == "true") {
-  array_push($services, $TempletonName);
-}
-if($requestObj["InstallSqoop"] == "true") {
-  array_push($services, $SqoopName);
-}
-storeSelectedServiceNames($services);
-/////////////////// End of persisting the services list
-*/
-
-/// Store cluster selection info
-persistClusterInfo($clusterName, $jsonOutput);
-
-header("Content-type: application/json");
-
-// re-work svc array for UI
-$svc_array = $jsonOutput["services"];
-$jsonOutput["services"] = array();
-
-foreach ($svc_array as $key=>$arr) {
-  $svc_arr = $arr;
-  $svc_arr["masters"] = array();
-  foreach ($arr["masters"] as $role=>$role_arr) {
-    array_push($svc_arr["masters"], $role_arr);
-  }
-  array_push($jsonOutput["services"], $svc_arr);
-}
-
-print (json_encode($jsonOutput));
-?>

+ 0 - 45
hmc/archive/php/uploadFiles.php

@@ -1,45 +0,0 @@
-<?php
-
-// include_once 'createCluster.php';
-include_once 'dbLib.php';
-
-//$requestData = file_get_contents('php://input');
-//error_log($requestdata, 3, "/tmp/rez.log");
-//$requestObj = json_decode($requestdata, true);
-
-$clusterName = $_GET['clusterName'];
-// Validate clusterName: TODO; FIXME
-
-// initCluster($clusterName);
-
-$identityFileDestination = getSshKeyFilePath($clusterName);
-$hostsFileDestination = getHostsFilePath($clusterName);
-
-// TODO: FIXME: Change echos to return error codes.
-//echo '<pre>';
-if (move_uploaded_file($_FILES['clusterDeployUserIdentityFile']['tmp_name'], $identityFileDestination)) {
-    //echo "File is valid, and was successfully uploaded.\n";
-
-  // Set the permissions
-  chmod($identityFileDestination, 0400);// TODO: Error conditions
-} else {
-    //echo "Possible file upload attack!\n";
-}
-
-if (move_uploaded_file($_FILES['clusterHostsFile']['tmp_name'], $hostsFileDestination)) {
-    //echo "File is valid, and was successfully uploaded.\n";
-  } else {
-    //echo "Possible file upload attack!\n";
-}
-
-// TODO: FIXME: Check file lengths.
-
-$outjson = array(
-                  "errorCode"=> 0,
- //                 "clusterName" => $clusterName,
- //                 "finalDestination" => $identityFileDestination,
- //                 "fileToBeMoved" => $_FILES['clusterDeployUserIdentityFile']['tmp_name'],
-                );
-header("Content-type: application/json");
-print (json_encode($outjson));
-?>

+ 0 - 24
hmc/archive/php/utils.php

@@ -1,24 +0,0 @@
-<?php
-function ReadNthWordsOfAllLinesFromFile($fileName, $num)
-{
-  $loc = $num - 1;
-  if ($loc < 0) {
-   $loc = $num;
-  }
-  $handle = fopen($fileName, "r");
-  $retValue = array();
-  if ($handle) {
-    while (($buffer = fgets($handle, 4096)) !== false) {
-      $fullLine = explode(' ', $buffer);
-      array_push($retValue, trim($fullLine[$loc]));
-    }
-     
-    if (!feof($handle)) {
-      echo "Error: unexpected fgets() fail\n"; // TODO: Fix
-    }
-  }
-  return $retValue;
-}
-
-
-?>

+ 0 - 86
hmc/archive/playground/assignHosts.php

@@ -1,86 +0,0 @@
-<?php
-
-include 'dbLib.php';
-
-$requestdata = file_get_contents('php://input');
-// $obj = json_decode($requestdata, true);
-$obj = array(
-         "clusterName"=> "MyCluster-12345",
-         "ClusterDeployUser"=> "hortonva",
-         "ClusterDeployUserIdentityFile"=> "va_rsa",
-         "ClusterHostsFile"=> "../hostsFile.txt",
-         "InstallHBase"=> "false",
-         "InstallPig"=> "false",
-         "InstallHCatalog"=> "false",
-         "InstallTempleton"=> "false",
-         "InstallOozie"=> "false",
-         "InstallSqoop"=> "false",
-         "InstallLzo"=> "false",
-         );
-
-
-$clusterName = $obj['clusterName'];
-$clusterDir = getClusterDir($clusterName);
-$commitNodesScriptInputDir = $clusterDir."/commitNodesScriptInputDir/";
-$commitNodesScriptOutputDir = $clusterDir."/commitNodesScriptOutputDir/";
-
-// Hard code host and identity files for now
-$obj['ClusterDeployUserIdentityFile']="va_rsa";
-$obj['ClusterHostsFile']="hostsFile.txt";
-
-// write the input file to the node-suggestor
-$fp = fopen($commitNodesScriptInputDir."data.txt", 'w');
-fwrite($fp, 'HDPClusterDeployUser='.$obj['ClusterDeployUser']."\n");
-fwrite($fp, 'HDPClusterDeployUserIdentityFile='.$commitNodesScriptInputDir.'/'.$obj['ClusterDeployUserIdentityFile']."\n");
-fwrite($fp, 'HDPClusterHostsFile='.$commitNodesScriptInputDir.'/'.$obj['ClusterHostsFile']."\n");
-fwrite($fp, 'HDPNameNodeHost='.$obj['nameNode']."\n");
-fwrite($fp, 'HDPSecondaryNameNodeHost='.$obj['secondaryNameNode']."\n");
-fwrite($fp, 'HDPJobTrackerHost='.$obj['jobTracker']."\n");
-fwrite($fp, 'HDPHBaseMasterHost='.$obj['hbaseMaster']."\n");
-fwrite($fp, 'HDPHCatalogServerHost='.$obj['hcatServer']."\n");
-fwrite($fp, 'HDPGangliaCollectorHost='.$obj['gangliaCollector']."\n");
-fwrite($fp, 'HDPNagiosServerHost='.$obj['nagiosServer']."\n");
-fwrite($fp, 'HDPOozieServerHost='.$obj['oozieServer']."\n");
-fwrite($fp, 'HDPTempletonNodeHost='.$obj['templetonNode']."\n");
-fclose($fp);
-
-$cmd = "/var/www/html/KickAssHDPUI/ShellScripts/generateNodeFiles.sh ".$commitNodesScriptInputDir."data.txt ".$commitNodesScriptOutputDir;
-$handle = popen($cmd, "r");
-// Do some checks on return status: TODO
-//print $cmd;
-//echo "'$handle'; " . gettype($handle) . "\n";
-while (!feof($handle)) {
-  $read = fread($handle, 2096);
-  error_log($read, 3, "/tmp/errors.txt");
-}
-pclose($handle);
-
-function ReadAllFirstWordOfLinesFromFile ($fileName)
-{
-  $handle = fopen($fileName, "r");
-  $retValue = array();
-  if ($handle) {
-    while (($buffer = fgets($handle, 4096)) !== false) {
-      $fullLine = explode(' ', $buffer);
-      array_push($retValue, $fullLine[0]);
-    }
-     
-    if (!feof($handle)) {
-      echo "Error: unexpected fgets() fail\n"; // TODO: Fix
-    }
-  }
-  return $retValue;
-}
-
-$AllMountPoints = ReadAllFirstWordOfLinesFromFile($commitNodesScriptOutputDir."/NameNodeMountPointsSuggest.out");
-
-$outjson = array(
-            "allMountPoints"=> $AllMountPoints,
-           );
-
-header("Content-type: application/json");
-print (json_encode($outjson));
-//var_dump($AllHosts);
-//print "hello";
-//var_dump(json_encode($outjson));
-?>

+ 0 - 71
hmc/archive/playground/configureCluster.php

@@ -1,71 +0,0 @@
-<?php
-
-$requestdata = file_get_contents('php://input');
-$obj = json_decode($requestdata, true);
-
-$clusterName = $obj['clusterName'];
-$clusterDir = "/var/run/HDPClusters/".$clusterName."/";
-$commitNodesScriptInputDir = $clusterDir."/commitNodesScriptInputDir/";
-$commitNodesScriptOutputDir = $clusterDir."/commitNodesScriptOutputDir/";
-
-// Hard code host and identity files for now
-$obj['ClusterDeployUserIdentityFile']="va_rsa";
-$obj['ClusterHostsFile']="hostsFile.txt";
-
-// write the input file to the node-suggestor
-$fp = fopen($commitNodesScriptInputDir.'data.txt', 'w');
-fwrite($fp, 'HDPClusterDeployUser='.$obj['ClusterDeployUser']."\n");
-fwrite($fp, 'HDPClusterDeployUserIdentityFile='.$commitNodesScriptInputDir.'/'.$obj['ClusterDeployUserIdentityFile']."\n");
-fwrite($fp, 'HDPClusterHostsFile='.$commitNodesScriptInputDir.'/'.$obj['ClusterHostsFile']);
-fwrite($fp, 'HDPNameNodeHost='.$obj['nameNode']);
-fwrite($fp, 'HDPSecondaryNameNodeHost='.$obj['secondaryNameNode']);
-fwrite($fp, 'HDPJobTrackerHost='.$obj['jobTracker']);
-fwrite($fp, 'HDPHBaseMasterHost='.$obj['hbaseMaster']);
-fwrite($fp, 'HDPHCatalogServerHost='.$obj['hcatServer']);
-fwrite($fp, 'HDPGangliaCollectorHost='.$obj['gangliaCollector']);
-fwrite($fp, 'HDPNagiosServerHost='.$obj['nagiosServer']);
-fwrite($fp, 'HDPOozieServerHost='.$obj['oozieServer']);
-fwrite($fp, 'HDPTempletonNodeHost='.$obj['templetonNode']);
-fwrite($fp, 'HDPdd='.$obj['templetonNode']);
-fclose($fp);
-
-$cmd = "/var/www/html/KickAssHDPUI/ShellScripts/generateNodeFiles.sh ".$commitNodesScriptInputDir."data.txt ".$commitNodesScriptOutputDir;
-$handle = popen($cmd, "r");
-// Do some checks on return status: TODO
-//print $cmd;
-//echo "'$handle'; " . gettype($handle) . "\n";
-while (!feof($handle)) {
-  $read = fread($handle, 2096);
-  error_log($read, 3, "/tmp/errors.txt");
-}
-pclose($handle);
-
-function ReadAllFirstWordOfLinesFromFile ($fileName)
-{
-  $handle = fopen($fileName, "r");
-  $retValue = array();
-  if ($handle) {
-    while (($buffer = fgets($handle, 4096)) !== false) {
-      $fullLine = explode(' ', $buffer);
-      array_push($retValue, $fullLine[0]);
-    }
-     
-    if (!feof($handle)) {
-      echo "Error: unexpected fgets() fail\n"; // TODO: Fix
-    }
-  }
-  return $retValue;
-}
-
-$AllMountPoints = ReadAllFirstWordOfLinesFromFile($commitNodesScriptOutputDir."/NameNodeMountPointsSuggest.out");
-
-$outjson = array(
-            "allMountPoints"=> $AllMountPoints
-           );
-
-header("Content-type: application/json");
-print (json_encode($outjson));
-//var_dump($AllHosts);
-//print "hello";
-//var_dump(json_encode($outjson));
-?>

+ 0 - 3
hmc/archive/playground/data.txt

@@ -1,3 +0,0 @@
-HDPClusterDeployUser=hortonva
-HDPClusterDeployUserIdentityFile=/var/www/html/KickAssHDPUI/php/playground/input/va_rsa
-HDPClusterHostsFile=/var/www/html/KickAssHDPUI/php/playground/input/hostsFile.txt

+ 0 - 5
hmc/archive/playground/input/hostsFile.txt

@@ -1,5 +0,0 @@
-hrt12n15
-hrt12n16
-hrt12n17
-hrt12n18
-hrt12n19

+ 0 - 27
hmc/archive/playground/input/va_rsa

@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEoQIBAAKCAQEAnqbduaoHsTbFq73P4k5szw9ChRTIepauMt+D+DKb4ubqgGSl
-xE+YL6Ll5/qXWbIDwxkBMfWAbVhf/hJr4dcb7LbzhUwJUrDG7IJw+mUxZC2pNCmC
-Xvp4NUf1Wbz43GBNXtgK6Lxa2vbVL+4Rv+9xQC1AuATtLw5BnBzUW0BJIw/kUVZx
-qxWObof+gGHE07v6CLBMFmWvvEi2TylSvhewJBHZBUiVdEd2EqboG4optZPzg8ML
-+YsYCLKL5CZJoIdaNxMawIxsIWiGhYRJLAdhkJ99DpsJJSy+/t7NtFfCCNHDrd6P
-TIOjVV4jcGgMHXzYFkBz/Qbv5tgkVZFnPwQ+/wIBIwKCAQA67YWOGpUkkK/SE002
-zKwSZMDvmgFSGrW7H9HueTKWG0EoX+XMkpecqjgi9q0+kpOu3WbYCrqsRWV7oHE2
-oFrUQ/QM8Fs7+IRmeZetdgsH87PgLKzEMSVVnmJxydjG4fDaFbrouv0swhSrZw3o
-NF1DuQlo6+MRelLiNpgEotlWKeOlICQES2mI3G3c4ocuQJt8nRkWgEdJctj01ojb
-NtkLcy8lZrP3bPn64Z08H6h+ra8c0nLX7BL4cJDGRHRm6Fuu5adiAnlEFLvs5bRX
-HVj9W459hb9gQCRAj6y6hZcb4ow+qVuaOwMO48N7kzDbguFkclymwL3zqW6L+meM
-DapzAoGBAMzy36BUssjPaYCycm54uDZIgfDXb69SYjFKSt7BoMc9YsH0uclbirAq
-LtQoQ8hLo8zRYF4Up3LJmysuz0KVf2r6NjTKytJEnMRnfnD2iOnIo+YJhBOYj7jN
-CFXykablmubWEAF+p4+As7N84pihSGNnRa/vFrn7GbmcmSg7oXGLAoGBAMYrvdLU
-q25puVYFF0zefTTTJPBRJnuQdjzn1+/VqCplZUldF9PhDYdYtjGMev48Q+zHP8d4
-LPwErT1kd1d/0W6NXug8pz+vWNvbTKPofjlsoqE8/aOJei5wU6a36Ek6mdlqLfmk
-xwuY4sQc+SsF1BXbn3vW1Zj5RQYFB0+eAu7dAoGATB+yJZvNYIeNljOm2JM9G3oE
-YMUMOc4keLUxwHPOANxJQLn73RNfZgEKFEl4QxTHz7t7kKiV9290JftxjcJ/yKYU
-Ijyxu9BXfCZwyt86KvLAiKRy4rUCLrKOEUt37Yh7XQ2uLHDfJqwlfS5iyvoTkqKz
-e9x2J9JLYjLZzR12eqECgYEAwIJDXxe8eeMLz+ewPAtVDr57p59J9GBy3BRrXgLA
-njac6C6MLOlAV5gBcfYuVg6oYlsoA5lQRUZfJbINiDMF9l1yI24e0CauF2dRw8vo
-VQpyGPlra6oe60iLxobEZGTP98Y7SkhMVGihxdMArXNgT79nuiEnRCVY/oiKwl77
-iPMCgYAJ3gv8vch8Tghn1xwcM2R5Ijmp1tyC4I7GcC6NyUVDhgNGtMJ8GyFA3U7u
-pi4wGEl5WjUNr1oZxcPRph54ZfIyLk1rP6HHadBph17WjBCMZcIFFF2kPh2Eb7Xf
-gw3YEt9up3lmKKXwU3+OnMkGU8yMhHjAUwXtTfrCZjx2BXjIsg==
------END RSA PRIVATE KEY-----

+ 0 - 7
hmc/archive/playground/mergeTest.php

@@ -1,7 +0,0 @@
-<?php
-$array1 = array("color" => "red", 2, 4);
-$array2 = array("a" => true, "b" => true, "color" => "green", "shape" => "trapezoid", 4);
-$result = array_merge($array1, $array2);
-print_r($result);
-?>
-

+ 0 - 60
hmc/archive/playground/nodessugg.php

@@ -1,60 +0,0 @@
-<?php
-
-// write the input file to the node-suggestor
-$fp = fopen('data.txt', 'w');
-fwrite($fp, 'HDPClusterDeployUser=root');
-fwrite($fp, 'HDPClusterDeployUserIdentityFile=/var/sshkey');
-fwrite($fp, 'HDPClusterHostsFile=/var/hosts');
-
-$cmd = "../ShellScripts/suggestNodes.sh data.txt ./";
-// invoke the node-suggstor
-$handle = popen($cmd, "r");
-
-fclose($fp);
-
-function ReadFile ($fileName)
-{
-  $fp = fopen($filename, "r");
-  $retval = fread($fp, filesize($filename));
-  fclose($fp);
-  return $retval;
-}
-
-// Read the output from the node-suggestor
-
-$filename = "NameNodeSuggest.out";
-$NameNodeSuggestOut = ReadFile($filename);
-
-$filename = "NameNodeMountPointsSuggest.out";
-$NameNodeMountPointsSuggestOut = ReadFile($filename);
-
-$filename = "SecondaryNameNodeSuggest.out";
-$SecondaryNameNodeSuggestOut = ReadFile($filename);
-
-$filename = "HBaseMasterSuggest.out";
-$HBaseMasterSuggestOut = ReadFile($filename);
-
-$filename = "JobTrackerSuggest.out";
-$JobTrackerSuggestOut = ReadFile($filename);
-
-$filename = "GatewaySuggest.out";
-$GatewaySuggestOut = ReadFile($filename);
-
-$filename = "HCatalogServerSuggest.out";
-$HCatalogServerSuggestOut = ReadFile($filename);
-
-$filename = "GangliaCollectorSuggest.out";
-$GangliaCollectorSuggestOut = ReadFile($filename);
-
-$filename = "NagiosServerSuggest.out";
-$NagiosServerSuggestOut = ReadFile($filename);
-
-$filename = "DashboardSuggest.out";
-$DashboardSuggestOut = ReadFile($filename);
-
-$filename = "OozieServerSuggest.out";
-$OozieServerSuggestOut = ReadFile($filename);
-
-$filename = "TempletonNodeSuggest.out";
-$TempletonNodeSuggestOut = ReadFile($filename);
-?>

+ 0 - 1
hmc/archive/playground/output/DashboardSuggest.out

@@ -1 +0,0 @@
-hrt12n18 29135 8 x86_64

+ 0 - 1
hmc/archive/playground/output/GangliaCollectorSuggest.out

@@ -1 +0,0 @@
-hrt12n17 29751 8 x86_64

+ 0 - 1
hmc/archive/playground/output/GatewaySuggest.out

@@ -1 +0,0 @@
-hrt12n15 28874 8 x86_64

+ 0 - 1
hmc/archive/playground/output/HBaseMasterSuggest.out

@@ -1 +0,0 @@
-hrt12n19 29705 8 x86_64

+ 0 - 1
hmc/archive/playground/output/HCatalogServerSuggest.out

@@ -1 +0,0 @@
-hrt12n16 29850 8 x86_64

+ 0 - 5
hmc/archive/playground/output/HostDiscovery.out

@@ -1,5 +0,0 @@
-hrt12n15 28874 8 x86_64
-hrt12n16 29850 8 x86_64
-hrt12n17 29751 8 x86_64
-hrt12n18 29135 8 x86_64
-hrt12n19 29705 8 x86_64

+ 0 - 1
hmc/archive/playground/output/JobTrackerSuggest.out

@@ -1 +0,0 @@
-hrt12n18 29135 8 x86_64

+ 0 - 1
hmc/archive/playground/output/NagiosServerSuggest.out

@@ -1 +0,0 @@
-hrt12n19 29705 8 x86_64

+ 0 - 4
hmc/archive/playground/output/NameNodeMountPointsSuggest.out

@@ -1,4 +0,0 @@
-/grid/0
-/grid/1
-/grid/2
-/grid/3

+ 0 - 1
hmc/archive/playground/output/NameNodeSuggest.out

@@ -1 +0,0 @@
-hrt12n16 29850 8 x86_64

+ 0 - 1
hmc/archive/playground/output/OozieServerSuggest.out

@@ -1 +0,0 @@
-hrt12n15 28874 8 x86_64

+ 0 - 1
hmc/archive/playground/output/SecondaryNameNodeSuggest.out

@@ -1 +0,0 @@
-hrt12n17 29751 8 x86_64

+ 0 - 1
hmc/archive/playground/output/TempletonNodeSuggest.out

@@ -1 +0,0 @@
-hrt12n16 29850 8 x86_64

+ 0 - 120
hmc/archive/playground/readFromProps.php

@@ -1,120 +0,0 @@
-<?php
-
-$inputBaseDir = "/var/www/html/KickAssHDPUI/php/playground/input";
-$outputBaseDir = "/var/www/html/KickAssHDPUI/php/playground/output";
-
-// Read from the input
-/*
-$uploadDir = '/var/www/uploads/';
-$identifyFile = $uploadDir . basename($_FILES['ClusterDeployUserIdentityFile']['name']);
-$hostsFile = $uploadDir . basename($_FILES['ClusterHostsFile']['name']);
-echo '<pre>';
-if (move_uploaded_file($_FILES['ClusterDeployUserIdentityFile']['tmp_name'], $identifyFile)) {
-    echo "File is valid, and was successfully uploaded.\n";
-} else {
-    echo "Possible file upload attack!\n";
-}
-
-echo 'Here is some more debugging info:';
-print_r($_FILES);
-
-print "</pre>";
-*/
-
-$json = '{
-         "ClusterDeployUser": "hortonva",
-         "ClusterDeployUserIdentityFile": "va_rsa",
-         "ClusterHostsFile": "hostsFile.txt",
-         "InstallHBase": "false",
-         "InstallPig": "false",
-         "InstallHCatalog": "false",
-         "InstallTempleton": "false",
-         "InstallOozie": "false",
-         "InstallSqoop": "false",
-         "InstallLzo": "false"
-         }';
-/*
-$json = '{"foo-bar": 12345,
-        "one-more":"4567"
-        }';
-*/
-$obj = json_decode($json, true);
-//var_dump($obj);
-//print $obj['ClusterDeployUser']; // 12345
-//print $obj->{'one-more'}
-
-// write the input file to the node-suggestor
-$fp = fopen('data.txt', 'w');
-fwrite($fp, 'HDPClusterDeployUser='.$obj['ClusterDeployUser']."\n");
-fwrite($fp, 'HDPClusterDeployUserIdentityFile='.$inputBaseDir.'/'.$obj['ClusterDeployUserIdentityFile']."\n");
-fwrite($fp, 'HDPClusterHostsFile='.$inputBaseDir.'/'.$obj['ClusterHostsFile']);
-fclose($fp);
-
-$cmd = "/var/www/html/KickAssHDPUI/ShellScripts/suggestNodes.sh data.txt ".$outputBaseDir;
-//$cmd = "/bin/ls -lR /etc";
-// invoke the node-suggstor
-$handle = popen($cmd, "r");
-// Do some checks on return status: TODO
-print $cmd;
-echo "'$handle'; " . gettype($handle) . "\n";
-while (!feof($handle)) {
-  $read = fread($handle, 2096);
-  //echo $read;
-}
-pclose($handle);
-
-function ReadHostNameFromFile ($fileName)
-{
-  $fp = fopen($fileName, "r");
-  $retval = fread($fp, filesize($fileName));
-  $retval = explode(' ', $retval);
-  fclose($fp);
-  return $retval[0];
-}
-
-function ReadAllHostNamesFromFile ($fileName)
-{
-  $handle = fopen($fileName, "r");
-  $retValue = array();
-  if ($handle) {
-    while (($buffer = fgets($handle, 4096)) !== false) {
-      $fullLine = explode(' ', $buffer);
-      array_push($retValue, $fullLine[0]);
-    }
-     
-    if (!feof($handle)) {
-      echo "Error: unexpected fgets() fail\n";
-    }
-  }
-  return $retValue;
-}
-
-// Read the output from the node-suggestor
-
-$NameNodeSuggestOut = ReadHostNameFromFile($outputBaseDir."/NameNodeSuggest.out");
-$NameNodeMountPointsSuggestOut = ReadHostNameFromFile($outputBaseDir."/NameNodeMountPointsSuggest.out");
-$SecondaryNameNodeSuggestOut = ReadHostNameFromFile($outputBaseDir."/SecondaryNameNodeSuggest.out");
-$HBaseMasterSuggestOut = ReadHostNameFromFile($outputBaseDir."/HBaseMasterSuggest.out");
-$JobTrackerSuggestOut = ReadHostNameFromFile($outputBaseDir."/JobTrackerSuggest.out");
-$GatewaySuggestOut = ReadHostNameFromFile($outputBaseDir."/GatewaySuggest.out");
-$HCatalogServerSuggestOut = ReadHostNameFromFile($outputBaseDir."/HCatalogServerSuggest.out");
-$GangliaCollectorSuggestOut = ReadHostNameFromFile($outputBaseDir."/GangliaCollectorSuggest.out");
-$NagiosServerSuggestOut = ReadHostNameFromFile($outputBaseDir."/NagiosServerSuggest.out");
-$DashboardSuggestOut = ReadHostNameFromFile($outputBaseDir."/DashboardSuggest.out");
-$OozieServerSuggestOut = ReadHostNameFromFile($outputBaseDir."/OozieServerSuggest.out");
-$TempletonNodeSuggestOut = ReadHostNameFromFile($outputBaseDir."/TempletonNodeSuggest.out");
-$AllHosts = ReadAllHostNamesFromFile($outputBaseDir."/HostDiscovery.out");
-
-$outjson = '{
-            "namenode": '.$NameNodeSuggestOut.',
-            "secondarynamenode": '.$SecondaryNameNodeSuggestOut.',
-            "jobtracker": '.$JobTrackerSuggestOut.',
-            "gangliacollector": '.$GangliaCollectorSuggestOut.',
-            "nagiosserver": '.$NagiosServerSuggestOut.',
-            "all": '.$AllHosts.'
-           }';
-
-//var_dump($AllHosts);
-//print "hello";
-var_dump(json_encode($outjson));
-?>

+ 0 - 15
hmc/archive/playground/rez.php

@@ -1,15 +0,0 @@
-<?php
-
-$requestdata = file_get_contents('php://input');
-
-error_log($requestdata, 3, "/tmp/rez.log");
-
-$requestjson = json_decode($requestdata, true);
-
-header("Content-type: application/json");
-
-$x = array( 'a' => 'b', 'c' => 'd', 'e' => array(1,2,3) );
-
-print(json_encode($x));
-
-?>

+ 0 - 11
hmc/archive/playground/testing.php

@@ -1,11 +0,0 @@
-<?php
-$outjson = '{
-            "namenode": '.$namenodesuggestout.',
-            "secondarynamenode": $secondarynamenodesuggestout,
-            "jobtracker": $jobtrackersuggestout,
-            "gangliacollector": $gangliacollectorsuggestout,
-            "nagiosserver": $nagiosserversuggestout
-           }';
-
-print json_encode($outjson);
-?>

+ 2 - 2
hmc/html/header.htmli

@@ -1,10 +1,10 @@
 <!-- START HEADER -->
     <div class="container">
       <header>
-        <a href="http://www.hortonworks.com" target="_blank">
+        <a href="http://incubator.apache.org/projects/ambari.html" target="_blank">
           <img src="./logo.jpg"/>
         </a>
-        <section id="headerText">Hortonworks Data Platform</section>
+        <section id="headerText">Ambari</section>
       </header>
     </div>
 <!-- END HEADER -->

二进制
hmc/images/logo-micro.gif


二进制
hmc/images/logo-small.gif


二进制
hmc/images/logo.jpg


+ 0 - 99
hmc/package/rpm/SOURCES/hmc.init.in

@@ -45,82 +45,6 @@ fi
 cp /etc/puppet/auth.conf /etc/puppet/master/
 cp /etc/puppet/puppet.conf /etc/puppet/master/
 
-checkLicense() {
-  if [ ! -f /var/run/hmc/license ]
-  then
-    echo "Do you agree to Oracle's Java License at"
-    while true; do
-      read -p "/usr/share/hmc/licenses/ORACLE_JDK_LICENSE.txt?(y/n)" yn
-      case $yn in
-        [Yy]* ) touch /var/run/hmc/license; break;;
-        [Nn]* ) echo "Exiting"; exit 0;;
-        * ) echo "Please answer yes or no.";;
-      esac
-    done
-  fi
-}
-
-downloadJDK() {
-  jdk64="jdk-6u26-linux-x64.bin"
-  jdk32="jdk-6u26-linux-i586.bin"
-
-  echo "Downloading JDK binaries. This may take a few minutes"
-
-  echo "Downloading 64-bit JDK binaries"
-  curl --connect-timeout 10 -f -L --output /var/run/hmc/downloads/${jdk64}.tmp "https://s3.amazonaws.com/dev.hortonworks.com/ARTIFACTS/jdk-6u26-linux-x64.bin"
-  ret=$?
-  if [[ "$ret" != "0" ]]; then
-    echo "Failed to download 64-bit JDK"
-    return 1
-  fi
-
-  curl --connect-timeout 10 -f -L --output /var/run/hmc/downloads/${jdk64}.md5.tmp "https://s3.amazonaws.com/dev.hortonworks.com/ARTIFACTS/jdk-6u26-linux-x64.bin.md5"
-  ret=$?
-  if [[ "$ret" != "0" ]]; then
-    echo "Failed to download 64-bit JDK md5"
-    return 1
-  fi
-
-  echo "Downloading 32-bit JDK binaries"
-  curl --connect-timeout 10 -f -L --output /var/run/hmc/downloads/${jdk32}.tmp "https://s3.amazonaws.com/dev.hortonworks.com/ARTIFACTS/jdk-6u26-linux-i586.bin"
-  ret=$?
-  if [[ "$ret" != "0" ]]; then
-    echo "Failed to download 32-bit JDK"
-    return 1
-  fi
-
-  curl --connect-timeout 10 -f -L --output /var/run/hmc/downloads/${jdk32}.md5.tmp "https://s3.amazonaws.com/dev.hortonworks.com/ARTIFACTS/jdk-6u26-linux-i586.bin.md5"
-  ret=$?
-  if [[ "$ret" != "0" ]]; then
-    echo "Failed to download 32-bit JDK md5"
-    return 1
-  fi
-
-  md5Str=`cat /var/run/hmc/downloads/${jdk64}.md5.tmp`
-  echo "${md5Str}  /var/run/hmc/downloads/${jdk64}.tmp" > /var/run/hmc/downloads/${jdk64}.md5
-
-  md5sum --status --check /var/run/hmc/downloads/${jdk64}.md5
-  ret=$?
-  if [[ "$ret" != "0" ]]; then
-    echo "Failed to match md5 checksum for 64-bit JDK"
-    return 1
-  fi
-
-  md5Str=`cat /var/run/hmc/downloads/${jdk32}.md5.tmp`
-  echo "${md5Str}  /var/run/hmc/downloads/${jdk32}.tmp" > /var/run/hmc/downloads/${jdk32}.md5
-
-  md5sum --status --check /var/run/hmc/downloads/${jdk32}.md5
-  ret=$?
-  if [[ "$ret" != "0" ]]; then
-    echo "Failed to match md5 checksum for 32-bit JDK"
-    return 1
-  fi
-
-  cp -f /var/run/hmc/downloads/${jdk64}.tmp /var/run/hmc/downloads/${jdk64}
-  cp -f /var/run/hmc/downloads/${jdk32}.tmp /var/run/hmc/downloads/${jdk32}
-  return 0
-}
-
 checkHDPRepo() {
   if [[ ! -f /etc/yum.repos.d/hdp.repo ]]; then
     echo "Please install hdp repo before starting hmc"
@@ -141,29 +65,6 @@ checkJDK() {
   jdk64="jdk-6u26-linux-x64.bin"
   jdk32="jdk-6u26-linux-i586.bin"
 
-  checkLicense
-
-  if [[ ! -f /var/run/hmc/downloads/$jdk64 || ! -f /var/run/hmc/downloads/$jdk32 ]]; then
-    while true; do
-      read -p "Would you like us to download the JDK binaries for you?(y/n)" dyn
-      case $dyn in
-        [Yy]* )
-               downloadJDK
-               ret=$?
-               if [[ "$ret" != "0" ]]; then
-                 echo -n "Failed to download JDK correctly"
-               fi
-               cleanupFiles="/var/run/hmc/downloads/${jdk64}.tmp /var/run/hmc/downloads/${jdk64}.md5 /var/run/hmc/downloads/${jdk64}.md5.tmp /var/run/hmc/downloads/${jdk32}.tmp /var/run/hmc/downloads/${jdk32}.md5 /var/run/hmc/downloads/${jdk32}.md5.tmp"
-               rm -f ${cleanupFiles}
-               break
-               ;;
-        [Nn]* ) break;;
-        * ) echo "Please answer yes or no.";;
-      esac
-    done
-  fi
-
-
   if [[ ! -f /var/run/hmc/downloads/$jdk64 || ! -f /var/run/hmc/downloads/$jdk32 ]]; then
     echo "Please download $jdk64 and $jdk32 from Oracle to /var/run/hmc/downloads/"
     exit 1

+ 0 - 21
hmc/package/rpm/SOURCES/hmc_hdp.repo

@@ -1,21 +0,0 @@
-[epel]
-name=Extra Packages for Enterprise Linux 5 - $basearch
-#baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch
-mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
-failovermethod=priority
-enabled=1
-gpgcheck=0
-gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
-
-[HDP-1.0.11]
-name=Hortonworks Data Platform Version - HDP-1.0.11
-baseurl=http://s3.amazonaws.com/temp.repo/HDP-1.0.11/repos/centos5
-gpgcheck=0
-enabled=1
-priority=1
-
-[Puppet]
-name=Puppet
-baseurl = http://yum.puppetlabs.com/el/5/products/x86_64/
-enabled=1
-gpgcheck=0

+ 3 - 3
hmc/package/rpm/SPECS/hmc.spec

@@ -25,10 +25,10 @@
 Summary: HMC
 Name: hmc
 Version: 1.0.0
-URL: http://hortonworks.com
+URL: http://incubator.apache.org/projects/ambari.html
 Release: 1%{?dist}
 License: Apache License, Version 2.0
-Vendor: Hortonworks <hmc-dev-group@hortonworks.com>
+Vendor: Apache Software Foundation (ambari-dev@incubator.apache.org)
 Group: System Environment/Base
 Source: %{name}-%{version}.tar.gz
 Source1: hmc.init.in
@@ -166,5 +166,5 @@ rm -rf /var/run/hmc/puppetmaster.boot
 #%clean
 #%__rm -rf $RPM_BUILD_ROOT
 %changelog
-* Wed Apr 04 2012 Hortonworks <ambari-group@hortonworks.com>
+* Thu Jun 07 2012 Ambari <ambari-dev@incubator.apache.org>
 - Initial version

+ 3 - 3
hmc/package/rpm/hmc-php53.spec

@@ -25,10 +25,10 @@
 Summary: HMC for PHP 5.3
 Name: hmc-php53
 Version: 0.0.1
-URL: http://hortonworks.com
+URL: http://incubator.apache.org/projects/ambari.html
 Release: 2%{?dist}
 License: Apache License, Version 2.0
-Vendor: Hortonworks <hmc-dev-group@hortonworks.com>
+Vendor: Apache Software Foundation <ambari-dev@incubator.apache.org>
 Group: System Environment/Base
 Source: hmc-%{version}.tar.gz
 Source1: hmc.init.in
@@ -152,5 +152,5 @@ rm -rf /var/run/hmc/puppetmaster.boot
 #%clean
 #%__rm -rf $RPM_BUILD_ROOT
 %changelog
-* Wed Apr 04 2012 Hortonworks <ambari-group@hortonworks.com>
+* Thu Jun 07 2012 Ambari <ambari-dev@incubator.apache.org>
 - Initial version

+ 8 - 8
hmc/php/conf/MessageResources-en.inc

@@ -1,10 +1,10 @@
 <?php
-$RES['app.name']="Hortonworks Management Center";
-$RES['page.title']="Hortonworks Management Center";
-$RES['page.footer.body']="Hortonworks &copy; 2012";
-$RES['topnav.help.link']="http://docs.hortonworks.com/CURRENT/index.htm#Troubleshooting_HDP_Deployment/Troubleshooting_HDP_Deployment.htm";
-$RES['welcome.header']="Welcome to Hortonworks Management Center!";
-$RES['welcome.body']="<p>Hortonworks Management Center makes it easy for you to install, configure, and manage your Hadoop cluster.</p><p>First, we will walk you through setting up your cluster with a step-by-step wizard.</p>";
+$RES['app.name']="Ambari";
+$RES['page.title']="Ambari";
+$RES['page.footer.body']="";
+$RES['topnav.help.link']="";
+$RES['welcome.header']="Welcome to Ambari!";
+$RES['welcome.body']="";
 $RES['welcome.note']="Before you proceed, make sure you have performed all the pre-installation steps.";
 $RES['welcome.submit.label']="Get started";
 $RES['installFailed.header']="Cluster installation failed";
@@ -14,7 +14,7 @@ $RES['reinstall.header']="You have not set up a cluster yet.";
 $RES['reinstall.body']="We'll walk you through setting up your cluster with a 7-step wizard.";
 $RES['reinstall.submit.label']="Let's get started!";
 $RES['uninstallFailed.header']="Cluster uninstallation failed";
-$RES['uninstallFailed.body']="Failed to uninstall the cluster.  <a href='http://docs.hortonworks.com/CURRENT/index.htm#Troubleshooting_HDP_Deployment/Troubleshooting_HDP_Deployment.htm' target='_blank'>View the troubleshooting guide.</a>";
+$RES['uninstallFailed.body']="Failed to uninstall the cluster";
 $RES['common.sshUsername.label']="SSH Username";
 $RES['common.sshPrivateKeyFile.label']="SSH Private Key File for <i>root</i>";
 $RES['common.hostsFile.label']="Hosts File (newline-delimited list of hostnames)";
@@ -57,4 +57,4 @@ $RES['uninstallWizard.pageSummary.body']="<span class='label label-important'>Wa
 $RES['uninstallWizard.wipeout.label']="Perform wipe out (delete all data)";
 $RES['uninstallWizard.submit.label']="Uninstall Cluster";
 $RES['initWizard.configureClusterAdvanced.validation.error']="We've encountered invalid settings.";
-?>
+?>

+ 0 - 1
hmc/php/frontend/configUtils.php

@@ -389,7 +389,6 @@ function validateConfigs($svcConfigs) {
       scheduler_name|org.apache.hadoop.mapred.CapacityTaskScheduler
       nagios_web_login|nagiosadmin
       nagios_web_password|admin
-      nagios_contact|nagiosadmin@hortonworks.com
       hadoop_heapsize|1024
       namenode_heapsize|1024
       namenode_opt_newsize|200

+ 0 - 1
hmc/puppet/modules/hdp-nagios/files/check_oozie_status.sh

@@ -1,6 +1,5 @@
 #!/usr/bin/env bash
 # OOZIE_URL is of the form http://<hostname>:<port>/oozie
-# OOZIE_URL: http://hortonworks-sandbox.localdomain:11000/oozie
 HOST=$1
 PORT=$2
 JAVA_HOME=$3

+ 0 - 6
hmc/puppet/modules/hdp/templates/hdp103.repo.erb

@@ -1,6 +0,0 @@
-[HDP-1.0.7]
-name=Hortonworks Data Platform Version 1.0.7
-baseurl = <%=scope.function_hdp_template_var("hdp_yum_repo_base_url")%>
-enabled=1
-gpgcheck=0
-priority=1

+ 2 - 2
hmc/tests/php/orchestrator/test.php

@@ -31,7 +31,7 @@ class TestDB extends OrchestratorDB {
   private $hbase_regionserver;
 
   function __construct($puppet) {
-    parent::__construct("/homes/hortonmu/HMC/src/php/db/test.db", "DataCluster", $puppet);
+    parent::__construct("./test.db", "DataCluster", $puppet);
 
     $this->namenode = new ServiceComponent($clusterName, "namenode", "hdfs", State::UNINSTALLED, $this, $puppet, FALSE);
     $this->secondary_namenode = new ServiceComponent($clusterName, "secondary_namenode", "hdfs", State::UNINSTALLED, $this, $puppet, FALSE);
@@ -196,7 +196,7 @@ print_r($zookeeper->stop());
 */
 
 $puppet = new MockPuppetInvoker();
-$db = new OrchestratorDB("/homes/hortonmu/HMC/src/php/db/test.db", "DataCluster", $puppet);
+$db = new OrchestratorDB("./test.db", "DataCluster", $puppet);
 $cluster = new Cluster($clusterName, $db, $puppet);
 $t0 = new Transaction(0, 0, 0);
 print_r($cluster->deployHDP($t0));

二进制
hmc/tests/php/puppet/test.db


+ 3 - 3
mon_dashboard/package/rpm/hdp_mon_dashboard.spec

@@ -25,10 +25,10 @@
 Summary: HDP Monitoring Dashboard Frontend
 Name: hdp_mon_dashboard
 Version: 0.0.1
-URL: http://hortonworks.com
+URL: http://incubator.apache.org/projects/ambari.html
 Release: 2 
 License: Apache License, Version 2.0
-Vendor: Hortonworks <ambari-group@hortonworks.com>
+Vendor: Apache Software Foundation (ambari-dev@incubator.apache.org)
 Group: System Environment/Base
 Source: %{name}-%{version}.tar.gz
 Buildroot: %{_tmppath}/%{name}-%{version}-buildroot
@@ -66,5 +66,5 @@ echo "Alias /hdp %{_prefix}/share/hdp" > $RPM_BUILD_ROOT/%{httpd_confdir}/hdp_mo
 %__rm -rf $RPM_BUILD_ROOT
 
 %changelog
-* Fri Feb 17 2011 Hortonworks <ambari-group@hortonworks.com>
+* Thu Jun 07 2012 Ambari <ambari-dev@incubator.apache.org>
 - Initial version

+ 3 - 3
mon_dashboard/package/rpm/hdp_mon_ganglia_addons.spec

@@ -25,10 +25,10 @@
 Summary: Ganglia Add-ons for HDP Monitoring Dashboard
 Name: hdp_mon_ganglia_addons
 Version: 0.0.1
-URL: http://hortonworks.com
+URL: http://incubator.apache.org/projects/ambari.html
 Release: 2
 License: Apache License, Version 2.0
-Vendor: Hortonworks <ambari-group@hortonworks.com>
+Vendor: Apache Software Foundation (ambari-dev@incubator.apache.org)
 Group: System Environment/Base
 Source: %{name}-%{version}.tar.gz
 Buildroot: %{_tmppath}/%{name}-%{version}-buildroot
@@ -65,5 +65,5 @@ for a better monitoring integration with a Hadoop Cluster
 %__rm -rf $RPM_BUILD_ROOT
 
 %changelog
-* Fri Feb 17 2011 Hortonworks <ambari-group@hortonworks.com>
+* Thu Jun 07 2011 Ambari <ambari-dev@incubator.apache.org>
 - Initial version

+ 3 - 3
mon_dashboard/package/rpm/hdp_mon_nagios_addons.spec

@@ -25,10 +25,10 @@
 Summary: Nagios Add-ons for HDP Monitoring Dashboard
 Name: hdp_mon_nagios_addons
 Version: 0.0.1
-URL: http://hortonworks.com
+URL: http://incubator.apache.org/projects/ambari.html
 Release: 2
 License: Apache License, Version 2.0
-Vendor: Hortonworks <ambari-group@hortonworks.com>
+Vendor: Apache Software Foundation (ambari-dev@incubator.apache.org)
 Group: System Environment/Base
 Source: %{name}-%{version}.tar.gz
 Buildroot: %{_tmppath}/%{name}-%{version}-buildroot
@@ -68,5 +68,5 @@ echo "Alias /hdp %{_prefix}/share/hdp" > $RPM_BUILD_ROOT/%{httpd_confdir}/hdp_mo
 %__rm -rf $RPM_BUILD_ROOT
 
 %changelog
-* Fri Feb 17 2011 Hortonworks <ambari-group@hortonworks.com>
+* Thu Jun 07 2012 Ambari <ambari-dev@incubator.apache.org>
 - Initial version

+ 0 - 1
mon_dashboard/src/addOns/nagios/plugins/check_oozie_status.sh

@@ -1,6 +1,5 @@
 #!/usr/bin/env bash
 # OOZIE_URL is of the form http://<hostname>:<port>/oozie
-# OOZIE_URL: http://hortonworks-sandbox.localdomain:11000/oozie
 HOST=$1
 PORT=$2
 JAVA_HOME=$3

+ 2 - 2
mon_dashboard/src/ui/hbase.html

@@ -54,8 +54,8 @@
 		</nav>
 		
 		<section id="links">
-			<a class="roundedBox" href="http://hortonworks.com/community/forums/" target="_blank">Post Feedback</a>
-			<a class="roundedBox" href="http://docs.hortonworks.com" target="_blank">Documentation</a>
+			<a class="roundedBox" href="" target="_blank">Post Feedback</a>
+			<a class="roundedBox" href="" target="_blank">Documentation</a>
 			<a id="nagios" class="roundedBox" href="" target="_blank">Nagios</a>
 			<a id="ganglia" class="roundedBox" href="" target="_blank">Ganglia</a>
                         <a id="oozie" class="hiddenLink" href="" target="_blank">Oozie</a>

+ 2 - 2
mon_dashboard/src/ui/hdfs.html

@@ -54,8 +54,8 @@
 		</nav>
 		
 		<section id="links">
-			<a class="roundedBox" href="http://hortonworks.com/community/forums/" target="_blank">Post Feedback</a>
-			<a class="roundedBox" href="http://docs.hortonworks.com" target="_blank">Documentation</a>
+			<a class="roundedBox" href="" target="_blank">Post Feedback</a>
+			<a class="roundedBox" href="" target="_blank">Documentation</a>
 			<a id="nagios" class="roundedBox" href="" target="_blank">Nagios</a>
 			<a id="ganglia" class="roundedBox" href="" target="_blank">Ganglia</a>
                         <a id="oozie" class="hiddenLink" href="" target="_blank">Oozie</a>

+ 2 - 2
mon_dashboard/src/ui/home.html

@@ -53,8 +53,8 @@
     </nav>
     
     <section id="links">
-      <a class="roundedBox" href="http://hortonworks.com/community/forums/" target="_blank">Post Feedback</a>
-      <a class="roundedBox" href="http://docs.hortonworks.com" target="_blank">Documentation</a>
+      <a class="roundedBox" href="" target="_blank">Post Feedback</a>
+      <a class="roundedBox" href="" target="_blank">Documentation</a>
       <a id="nagios" class="roundedBox" href="" target="_blank">Nagios</a>
       <a id="ganglia" class="roundedBox" href="" target="_blank">Ganglia</a>
       <a id="oozie" class="hiddenLink" href="" target="_blank">Oozie</a>

+ 5 - 5
mon_dashboard/src/ui/js/common.js

@@ -32,9 +32,9 @@
   
   // on document ready
   $(document).ready(function(){
-    document.title = 'Hortonworks Management Center';
-    $('#brand').html('Hortonworks Management Center');
-    $('#footer').html('Hortonworks &copy 2012');
+    document.title = 'Ambari';
+    $('#brand').html('Ambari');
+    $('#footer').html('');
     self.clearTimeout(to);
     a.refreshPage();
     a.setEventDelegation();
@@ -820,9 +820,9 @@
 
           // Refresh the caption to indicate service name.
           if(page == "HDFS" || page == "MAPREDUCE" || page == "HBASE"){
-            $("#alertsGrid").jqGrid('setCaption',"Configured Alerts (<a href=\"http://hortonworks.com\" target=\"_blank\">troubleshoot?</a>)");
+            $("#alertsGrid").jqGrid('setCaption',"Configured Alerts (<a href=\"\" target=\"\"></a>)");
           } else {
-            $("#alertsGrid").jqGrid('setCaption',targetId+" Alerts (<a href=\"http://hortonworks.com\" target=\"_blank\">troubleshoot?</a>)");
+            $("#alertsGrid").jqGrid('setCaption',targetId+" Alerts (<a href=\"\" target=\"\"></a>)");
           }
           
           // Populate Alerts Grid

+ 2 - 2
mon_dashboard/src/ui/mapreduce.html

@@ -54,8 +54,8 @@
 		</nav>
 		
 		<section id="links">
-			<a class="roundedBox" href="http://hortonworks.com/community/forums/" target="_blank">Post Feedback</a>
-			<a class="roundedBox" href="http://docs.hortonworks.com" target="_blank">Documentation</a>
+			<a class="roundedBox" href="" target="_blank">Post Feedback</a>
+			<a class="roundedBox" href="" target="_blank">Documentation</a>
 			<a id="nagios" class="roundedBox" href="" target="_blank">Nagios</a>
 			<a id="ganglia" class="roundedBox" href="" target="_blank">Ganglia</a>
                         <a id="oozie" class="hiddenLink" href="" target="_blank">Oozie</a>

+ 1 - 1
mon_dashboard/test/dataServices/jmx/data/sample_hbasemaster_jmx.json

@@ -826,7 +826,7 @@
     "name" : "hadoop:service=HBase,name=Info",
     "modelerType" : "org.apache.hadoop.hbase.metrics.HBaseInfo$HBaseInfoMBean",
     "revision" : "a23f8636efd6dd9d37f3a15d83f2396819509502",
-    "hdfsUser" : "hortonfo",
+    "hdfsUser" : "foo",
     "hdfsDate" : "Fri Dec 16 20:01:27 UTC 2011",
     "hdfsUrl" : "https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.0",
     "date" : "Tue Feb 14 10:12:33 PST 2012",