Преглед на файлове

AMBARI-503. Make sure epel rep is installed when installing the agent. (Contributed by Mahadev)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1347350 13f79535-47bb-0310-9956-ffa450edef68
Vikram Dixit K преди 13 години
родител
ревизия
76aaefb833
променени са 6 файла, в които са добавени 30 реда и са изтрити 7 реда
  1. 2 0
      CHANGES.txt
  2. 17 0
      hmc/ShellScripts/puppet_agent_install.sh
  3. 3 3
      hmc/db/schema.dump
  4. 8 0
      hmc/package/rpm/SOURCES/hmc.init.in
  5. 0 3
      hmc/package/rpm/SPECS/hmc.spec
  6. 0 1
      hmc/package/rpm/create_hmc_rpm.sh

+ 2 - 0
CHANGES.txt

@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-503. Make sure epel rep is installed when installing the agent. (Mahadev via Vikram)
+
   AMBARI-527. Increase number of puppet retries to recover from intermittent network issues. (Jitendra via Vikram)
 
   AMBARI-502. X button missing from popup (Yusaku via Vikram)

+ 17 - 0
hmc/ShellScripts/puppet_agent_install.sh

@@ -138,6 +138,23 @@ host=`hostname -f | tr '[:upper:]' '[:lower:]'`
 
 out=`/etc/init.d/iptables stop 1>/dev/null`
 
+#check if epel repo is installed if not try installing
+epel_installed=`yum repolist enabled | grep epel`
+if [[ "x$epel_installed" != "x" ]]; then 
+  echo "Already Installed epel repo"
+else
+  cmd="cat $repoFile | grep \"baseurl\" | awk -F= '{print \$2}'| awk 'NR==1' | sed 's/ //g'"
+  epelUrl=`eval $cmd`
+  epelRPM=$epelUrl/epel-release-5-4.noarch.rpm
+  rpm -Uvh $epelRPM
+  #make sure epel is installed else fail 
+  epel_installed=`yum repolist enabled | grep epel`
+  if [[ "x$epel_installed" == "x" ]]; then
+    echo "$host:_ERROR_:retcode:[1], CMD:[rpm -Uvh $epelRPM]: OUT:[Not Installed]" >&2
+    exit 1
+  fi
+fi
+
 echo "Installing puppet using yum"
 out=`yum install -y hmc-agent`
 ret=$?

+ 3 - 3
hmc/db/schema.dump

@@ -253,9 +253,9 @@ INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, de
 INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "nagios_contact", "", "Hadoop Admin email (required)", "Hadoop Administrator email for alert notification", "NAGIOS", "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text" }' );
 
 -- Configuration for local yum mirror support
-INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "yum_repo_file", "/usr/share/hmc/yum_repo/hmc_hdp.repo", "Path to YUM Repo file", "Path to YUM Repo file", "MISCELLANEOUS", "NODISPLAY", '{ "isPassword": false, "noDisplay": true, "reconfigurable": false, "displayType": "text" }' );
-INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "apache_artifacts_download_url", "", "Apache Artifacts Download URL", "URL form where to download HDP artifacts", "MISCELLANEOUS", "NODISPLAY", '{ "isPassword": false, "noDisplay": true, "reconfigurable": false, "displayType": "text" }' );
-INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "gpl_artifacts_download_url", "", "GPL Artifacts Download URL", "URL form where to download GPL artifacts", "MISCELLANEOUS", "NODISPLAY", '{ "isPassword": false, "noDisplay": true, "reconfigurable": false, "displayType": "text" }' );
+INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "yum_repo_file", "/etc/yum.repos.d/hdp.repo", "Path to YUM Repo file", "Path to YUM Repo file", "MISCELLANEOUS", "NODISPLAY", '{ "isPassword": false, "noDisplay": true, "reconfigurable": false, "displayType": "text" }' );
+INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "apache_artifacts_download_url", "http://s3.amazonaws.com/dev.hortonworks.com/HDP-1.0.11/repos/centos5/tars/", "Apache Artifacts Download URL", "URL form where to download HDP artifacts", "MISCELLANEOUS", "NODISPLAY", '{ "isPassword": false, "noDisplay": true, "reconfigurable": false, "displayType": "text" }' );
+INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "gpl_artifacts_download_url", "https://s3.amazonaws.com/dev.hortonworks.com/ARTIFACTS/", "GPL Artifacts Download URL", "URL form where to download GPL artifacts", "MISCELLANEOUS", "NODISPLAY", '{ "isPassword": false, "noDisplay": true, "reconfigurable": false, "displayType": "text" }' );
 
 --                                         gsCluster.properties keys
 

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

@@ -121,6 +121,13 @@ downloadJDK() {
   return 0
 }
 
+checkHDPRepo() {
+  if [[ ! -f /etc/yum.repos.d/hdp.repo ]]; then
+    echo "Please install hdp repo before starting hmc"
+    exit 1
+  fi
+}
+
 bootPuppet() {
  if [[ ! -f /var/run/hmc/puppetmaster.boot ]]; then
    daemon  $daemonopts $puppetd  ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS}
@@ -170,6 +177,7 @@ PUPPET_OPTS="master --confdir=/etc/puppet/master --verbose --config_version=/usr
 
 case "$1" in
     start)
+      checkHDPRepo
       checkJDK
       bootPuppet
       echo "Starting HMC Installer "

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

@@ -32,7 +32,6 @@ Vendor: Hortonworks <hmc-dev-group@hortonworks.com>
 Group: System Environment/Base
 Source: %{name}-%{version}.tar.gz
 Source1: hmc.init.in
-Source2: hmc_hdp.repo
 Source3: hmc-agent.init.in
 BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
 Requires: php >= 5, sqlite >= 3, php-pdo, php-pecl-json, httpd, puppet = 2.7.9, pdsh, httpd-devel, ruby-devel, rubygems, mod_passenger, mod_ssl
@@ -79,7 +78,6 @@ fi
 %__mkdir -p $RPM_BUILD_ROOT/usr/lib/ruby/site_ruby/1.8/puppet/reports/
 %__mkdir -p $RPM_BUILD_ROOT/%{web_prefixdir}/
 %__mkdir -p $RPM_BUILD_ROOT/%{web_prefixdir}/bin/
-%__mkdir -p $RPM_BUILD_ROOT/%{web_prefixdir}/yum_repo/
 %__mkdir -p $RPM_BUILD_ROOT/%{puppet_master_dir}/
 %__mkdir -p $RPM_BUILD_ROOT/%{puppet_master_dir}/manifests
 %__mkdir -p $RPM_BUILD_ROOT/%{web_prefixdir}/
@@ -106,7 +104,6 @@ fi
 %__cp -rf puppet/manifestloader $RPM_BUILD_ROOT/%{puppet_master_dir}
 %__cp -rf puppet/modules $RPM_BUILD_ROOT/%{puppet_master_dir}
 %__mkdir -p $RPM_BUILD_ROOT/%{puppet_master_dir}/modules/catalog/files
-%__cp -f "%{SOURCE2}" $RPM_BUILD_ROOT/%{web_prefixdir}/yum_repo/
 %__install -D -m0755 puppet/reports/get_revision $RPM_BUILD_ROOT/%{web_prefixdir}/bin
 %__cp -rf puppet/reports/hmcreport.rb $RPM_BUILD_ROOT/usr/lib/ruby/site_ruby/1.8/puppet/reports/
  

+ 0 - 1
hmc/package/rpm/create_hmc_rpm.sh

@@ -72,7 +72,6 @@ mkdir -p ${RPM_BUILDDIR}/SRPMS/
 
 cp -f ${BASEDIR}/SPECS/${PKG_NAME}.spec ${RPM_BUILDDIR}/SPECS/
 cp -f ${TAR_DEST} ${RPM_BUILDDIR}/SOURCES/
-cp -f ${BASEDIR}/SOURCES/${PKG_NAME}_hdp.repo ${RPM_BUILDDIR}/SOURCES/
 cp -f ${BASEDIR}/SOURCES/${PKG_NAME}.init.in ${RPM_BUILDDIR}/SOURCES/
 cp -f ${BASEDIR}/SOURCES/${PKG_NAME}-agent.init.in ${RPM_BUILDDIR}/SOURCES/