Updated Branches: refs/heads/trunk adf88711a -> 4b88bcdce
WHIRR-673. Upgrade CDH Repos for RHEL/CentOS 6. Contributed by Graham Gear. Project: http://git-wip-us.apache.org/repos/asf/whirr/repo Commit: http://git-wip-us.apache.org/repos/asf/whirr/commit/4b88bcdc Tree: http://git-wip-us.apache.org/repos/asf/whirr/tree/4b88bcdc Diff: http://git-wip-us.apache.org/repos/asf/whirr/diff/4b88bcdc Branch: refs/heads/trunk Commit: 4b88bcdced274ef38b6f77822ad6c249a6901800 Parents: 846a291 Author: Tom White <tomwh...@apache.org> Authored: Wed Jan 23 13:53:32 2013 +0000 Committer: Tom White <tomwh...@apache.org> Committed: Wed Jan 23 13:53:32 2013 +0000 ---------------------------------------------------------------------- CHANGES.txt | 2 + .../main/resources/functions/install_cdh_hadoop.sh | 47 ++++++++------ .../main/resources/functions/install_cdh_hbase.sh | 44 ++++++++------ .../resources/functions/install_cdh_zookeeper.sh | 44 ++++++++------ 4 files changed, 81 insertions(+), 56 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/whirr/blob/4b88bcdc/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 1920695..84b3c28 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -18,6 +18,8 @@ Release 0.8.2 (unreleased changes) (Steve Loughran via tomwhite) WHIRR-691. Java install to support Debian. (Graham Gear via tomwhite) + + WHIRR-673. Upgrade CDH Repos for RHEL/CentOS 6. (Graham Gear via tomwhite) Release 0.8.1 - 2012-10-19 http://git-wip-us.apache.org/repos/asf/whirr/blob/4b88bcdc/services/cdh/src/main/resources/functions/install_cdh_hadoop.sh ---------------------------------------------------------------------- diff --git a/services/cdh/src/main/resources/functions/install_cdh_hadoop.sh b/services/cdh/src/main/resources/functions/install_cdh_hadoop.sh index ef666b4..db43f56 100644 --- a/services/cdh/src/main/resources/functions/install_cdh_hadoop.sh +++ b/services/cdh/src/main/resources/functions/install_cdh_hadoop.sh @@ -19,38 +19,45 @@ function register_cloudera_repo() { CDH_MAJOR_VERSION=$(echo $REPO | sed -e 's/cdh\([0-9]\).*/\1/') CDH_VERSION=$(echo $REPO | sed -e 's/cdh\([0-9][0-9]*\)/\1/') if which dpkg &> /dev/null; then - if [ $CDH_MAJOR_VERSION = "4" ]; then - cat > /etc/apt/sources.list.d/cloudera-cdh4.list <<EOF -deb http://$REPO_HOST/cdh4/ubuntu/lucid/amd64/cdh lucid-cdh4 contrib -deb-src http://$REPO_HOST/cdh4/ubuntu/lucid/amd64/cdh lucid-cdh4 contrib + retry_apt-get -y install lsb-release + OS_CODENAME=$(lsb_release -sc) + OS_DISTID=$(lsb_release -si | tr '[A-Z]' '[a-z]') + if [ $CDH_MAJOR_VERSION -gt 3 ]; then + cat > /etc/apt/sources.list.d/cloudera-$REPO.list <<EOF +deb http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/$OS_DISTID/$OS_CODENAME/amd64/cdh $OS_CODENAME-$REPO contrib +deb-src http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/$OS_DISTID/$OS_CODENAME/amd64/cdh $OS_CODENAME-$REPO contrib EOF - curl -s http://$REPO_HOST/cdh4/ubuntu/lucid/amd64/cdh/archive.key | apt-key add - + curl -s http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/$OS_DISTID/$OS_CODENAME/amd64/cdh/archive.key | apt-key add - else cat > /etc/apt/sources.list.d/cloudera-$REPO.list <<EOF -deb http://$REPO_HOST/debian lucid-$REPO contrib -deb-src http://$REPO_HOST/debian lucid-$REPO contrib +deb http://$REPO_HOST/debian $OS_CODENAME-$REPO contrib +deb-src http://$REPO_HOST/debian $OS_CODENAME-$REPO contrib EOF curl -s http://$REPO_HOST/debian/archive.key | apt-key add - fi retry_apt_get -y update elif which rpm &> /dev/null; then - if [ $CDH_MAJOR_VERSION = "4" ]; then - cat > /etc/yum.repos.d/cloudera-cdh4.repo <<EOF -[cloudera-cdh4] -name=Cloudera's Distribution for Hadoop, Version 4 -baseurl=http://$REPO_HOST/cdh4/redhat/5/x86_64/cdh/4/ -http://repos.jenkins.sf.cloudera.com/cdh4-nightly/redhat/5/x86_64/cdh/4/ -gpgkey = http://$REPO_HOST/cdh4/redhat/5/x86_64/cdh/RPM-GPG-KEY-cloudera -gpgcheck = 1 + if [ $CDH_MAJOR_VERSION -gt 3 ]; then + cat > /etc/yum.repos.d/cloudera-$REPO.repo <<EOF +[cloudera-$REPO] +name=Cloudera's Distribution for Hadoop, Version $CDH_VERSION +baseurl=http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/redhat/\$releasever/\$basearch/cdh/$CDH_VERSION/ +gpgkey=http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/redhat/\$releasever/\$basearch/cdh/RPM-GPG-KEY-cloudera +gpgcheck=1 EOF + rpm --import http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/redhat/$(rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release))/$(rpm -q --qf "%{ARCH}" $(rpm -q --whatprovides redhat-release))/cdh/RPM-GPG-KEY-cloudera else + if [ $(rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)) -gt 5 ]; then + OS_VERSION_ARCH="\$releasever/\$basearch/"; + fi cat > /etc/yum.repos.d/cloudera-$REPO.repo <<EOF [cloudera-$REPO] name=Cloudera's Distribution for Hadoop, Version $CDH_VERSION -mirrorlist=http://$REPO_HOST/redhat/cdh/$CDH_VERSION/mirrors -gpgkey = http://$REPO_HOST/redhat/cdh/RPM-GPG-KEY-cloudera -gpgcheck = 0 +mirrorlist=http://$REPO_HOST/redhat/$OS_VERSION_ARCH/cdh/$CDH_VERSION/mirrors +gpgkey=http://$REPO_HOST/redhat/$OS_VERSION_ARCH/cdh/RPM-GPG-KEY-cloudera +gpgcheck=1 EOF + rpm --import http://$REPO_HOST/redhat/$OS_VERSION_ARCH/cdh/RPM-GPG-KEY-cloudera fi retry_yum update -y retry_yum fi @@ -89,11 +96,11 @@ function install_cdh_hadoop() { retry_apt_get update retry_apt_get -y install $HADOOP_PACKAGE cp -r /etc/$HADOOP/conf.empty $HADOOP_CONF_DIR - update-alternatives --install /etc/$HADOOP/conf $HADOOP-conf $HADOOP_CONF_DIR 90 + update-alternatives --install /etc/$HADOOP/conf $HADOOP-conf $HADOOP_CONF_DIR 80 elif which rpm &> /dev/null; then retry_yum install -y $HADOOP_PACKAGE cp -r /etc/$HADOOP/conf.empty $HADOOP_CONF_DIR - alternatives --install /etc/$HADOOP/conf $HADOOP-conf $HADOOP_CONF_DIR 90 + alternatives --install /etc/$HADOOP/conf $HADOOP-conf $HADOOP_CONF_DIR 80 fi INSTALL_HADOOP_DONE=1 http://git-wip-us.apache.org/repos/asf/whirr/blob/4b88bcdc/services/cdh/src/main/resources/functions/install_cdh_hbase.sh ---------------------------------------------------------------------- diff --git a/services/cdh/src/main/resources/functions/install_cdh_hbase.sh b/services/cdh/src/main/resources/functions/install_cdh_hbase.sh index 5751e5b..26914d9 100644 --- a/services/cdh/src/main/resources/functions/install_cdh_hbase.sh +++ b/services/cdh/src/main/resources/functions/install_cdh_hbase.sh @@ -14,42 +14,50 @@ # See the License for the specific language governing permissions and # limitations under the License. # +set -x function register_cloudera_repo() { CDH_MAJOR_VERSION=$(echo $REPO | sed -e 's/cdh\([0-9]\).*/\1/') CDH_VERSION=$(echo $REPO | sed -e 's/cdh\([0-9][0-9]*\)/\1/') if which dpkg &> /dev/null; then - if [ $CDH_MAJOR_VERSION = "4" ]; then - cat > /etc/apt/sources.list.d/cloudera-cdh4.list <<EOF -deb http://$REPO_HOST/cdh4/ubuntu/lucid/amd64/cdh lucid-cdh4 contrib -deb-src http://$REPO_HOST/cdh4/ubuntu/lucid/amd64/cdh lucid-cdh4 contrib + retry_apt-get -y install lsb-release + OS_CODENAME=$(lsb_release -sc) + OS_DISTID=$(lsb_release -si | tr '[A-Z]' '[a-z]') + if [ $CDH_MAJOR_VERSION -gt 3 ]; then + cat > /etc/apt/sources.list.d/cloudera-$REPO.list <<EOF +deb http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/$OS_DISTID/$OS_CODENAME/amd64/cdh $OS_CODENAME-$REPO contrib +deb-src http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/$OS_DISTID/$OS_CODENAME/amd64/cdh $OS_CODENAME-$REPO contrib EOF - curl -s http://$REPO_HOST/cdh4/ubuntu/lucid/amd64/cdh/archive.key | apt-key add - + curl -s http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/$OS_DISTID/$OS_CODENAME/amd64/cdh/archive.key | apt-key add - else cat > /etc/apt/sources.list.d/cloudera-$REPO.list <<EOF -deb http://$REPO_HOST/debian lucid-$REPO contrib -deb-src http://$REPO_HOST/debian lucid-$REPO contrib +deb http://$REPO_HOST/debian $OS_CODENAME-$REPO contrib +deb-src http://$REPO_HOST/debian $OS_CODENAME-$REPO contrib EOF curl -s http://$REPO_HOST/debian/archive.key | apt-key add - fi retry_apt_get -y update elif which rpm &> /dev/null; then - if [ $CDH_MAJOR_VERSION = "4" ]; then - cat > /etc/yum.repos.d/cloudera-cdh4.repo <<EOF -[cloudera-cdh4] -name=Cloudera's Distribution for Hadoop, Version 4 -baseurl=http://$REPO_HOST/cdh4/redhat/5/x86_64/cdh/4/ -http://repos.jenkins.sf.cloudera.com/cdh4-nightly/redhat/5/x86_64/cdh/4/ -gpgkey = http://$REPO_HOST/cdh4/redhat/5/x86_64/cdh/RPM-GPG-KEY-cloudera -gpgcheck = 1 + if [ $CDH_MAJOR_VERSION -gt 3 ]; then + cat > /etc/yum.repos.d/cloudera-$REPO.repo <<EOF +[cloudera-$REPO] +name=Cloudera's Distribution for Hadoop, Version $CDH_VERSION +baseurl=http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/redhat/\$releasever/\$basearch/cdh/$CDH_VERSION/ +gpgkey=http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/redhat/\$releasever/\$basearch/cdh/RPM-GPG-KEY-cloudera +gpgcheck=1 EOF + rpm --import http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/redhat/$(rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release))/$(rpm -q --qf "%{ARCH}" $(rpm -q --whatprovides redhat-release))/cdh/RPM-GPG-KEY-cloudera else + if [ $(rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)) -gt 5 ]; then + OS_VERSION_ARCH="\$releasever/\$basearch/"; + fi cat > /etc/yum.repos.d/cloudera-$REPO.repo <<EOF [cloudera-$REPO] name=Cloudera's Distribution for Hadoop, Version $CDH_VERSION -mirrorlist=http://$REPO_HOST/redhat/cdh/$CDH_VERSION/mirrors -gpgkey = http://$REPO_HOST/redhat/cdh/RPM-GPG-KEY-cloudera -gpgcheck = 0 +mirrorlist=http://$REPO_HOST/redhat/$OS_VERSION_ARCH/cdh/$CDH_VERSION/mirrors +gpgkey=http://$REPO_HOST/redhat/$OS_VERSION_ARCH/cdh/RPM-GPG-KEY-cloudera +gpgcheck=1 EOF + rpm --import http://$REPO_HOST/redhat/$OS_VERSION_ARCH/cdh/RPM-GPG-KEY-cloudera fi retry_yum update -y retry_yum fi http://git-wip-us.apache.org/repos/asf/whirr/blob/4b88bcdc/services/cdh/src/main/resources/functions/install_cdh_zookeeper.sh ---------------------------------------------------------------------- diff --git a/services/cdh/src/main/resources/functions/install_cdh_zookeeper.sh b/services/cdh/src/main/resources/functions/install_cdh_zookeeper.sh index 673b860..4558e6e 100644 --- a/services/cdh/src/main/resources/functions/install_cdh_zookeeper.sh +++ b/services/cdh/src/main/resources/functions/install_cdh_zookeeper.sh @@ -14,42 +14,50 @@ # See the License for the specific language governing permissions and # limitations under the License. # +set -x function register_cloudera_repo() { CDH_MAJOR_VERSION=$(echo $REPO | sed -e 's/cdh\([0-9]\).*/\1/') CDH_VERSION=$(echo $REPO | sed -e 's/cdh\([0-9][0-9]*\)/\1/') if which dpkg &> /dev/null; then - if [ $CDH_MAJOR_VERSION = "4" ]; then - cat > /etc/apt/sources.list.d/cloudera-cdh4.list <<EOF -deb http://$REPO_HOST/cdh4/ubuntu/lucid/amd64/cdh lucid-cdh4 contrib -deb-src http://$REPO_HOST/cdh4/ubuntu/lucid/amd64/cdh lucid-cdh4 contrib + retry_apt-get -y install lsb-release + OS_CODENAME=$(lsb_release -sc) + OS_DISTID=$(lsb_release -si | tr '[A-Z]' '[a-z]') + if [ $CDH_MAJOR_VERSION -gt 3 ]; then + cat > /etc/apt/sources.list.d/cloudera-$REPO.list <<EOF +deb http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/$OS_DISTID/$OS_CODENAME/amd64/cdh $OS_CODENAME-$REPO contrib +deb-src http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/$OS_DISTID/$OS_CODENAME/amd64/cdh $OS_CODENAME-$REPO contrib EOF - curl -s http://$REPO_HOST/cdh4/ubuntu/lucid/amd64/cdh/archive.key | apt-key add - + curl -s http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/$OS_DISTID/$OS_CODENAME/amd64/cdh/archive.key | apt-key add - else cat > /etc/apt/sources.list.d/cloudera-$REPO.list <<EOF -deb http://$REPO_HOST/debian lucid-$REPO contrib -deb-src http://$REPO_HOST/debian lucid-$REPO contrib +deb http://$REPO_HOST/debian $OS_CODENAME-$REPO contrib +deb-src http://$REPO_HOST/debian $OS_CODENAME-$REPO contrib EOF curl -s http://$REPO_HOST/debian/archive.key | apt-key add - fi retry_apt_get -y update elif which rpm &> /dev/null; then - if [ $CDH_MAJOR_VERSION = "4" ]; then - cat > /etc/yum.repos.d/cloudera-cdh4.repo <<EOF -[cloudera-cdh4] -name=Cloudera's Distribution for Hadoop, Version 4 -baseurl=http://$REPO_HOST/cdh4/redhat/5/x86_64/cdh/4/ -http://repos.jenkins.sf.cloudera.com/cdh4-nightly/redhat/5/x86_64/cdh/4/ -gpgkey = http://$REPO_HOST/cdh4/redhat/5/x86_64/cdh/RPM-GPG-KEY-cloudera -gpgcheck = 1 + if [ $CDH_MAJOR_VERSION -gt 3 ]; then + cat > /etc/yum.repos.d/cloudera-$REPO.repo <<EOF +[cloudera-$REPO] +name=Cloudera's Distribution for Hadoop, Version $CDH_VERSION +baseurl=http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/redhat/\$releasever/\$basearch/cdh/$CDH_VERSION/ +gpgkey=http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/redhat/\$releasever/\$basearch/cdh/RPM-GPG-KEY-cloudera +gpgcheck=1 EOF + rpm --import http://$REPO_HOST/cdh$CDH_MAJOR_VERSION/redhat/$(rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release))/$(rpm -q --qf "%{ARCH}" $(rpm -q --whatprovides redhat-release))/cdh/RPM-GPG-KEY-cloudera else + if [ $(rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)) -gt 5 ]; then + OS_VERSION_ARCH="\$releasever/\$basearch/"; + fi cat > /etc/yum.repos.d/cloudera-$REPO.repo <<EOF [cloudera-$REPO] name=Cloudera's Distribution for Hadoop, Version $CDH_VERSION -mirrorlist=http://$REPO_HOST/redhat/cdh/$CDH_VERSION/mirrors -gpgkey = http://$REPO_HOST/redhat/cdh/RPM-GPG-KEY-cloudera -gpgcheck = 0 +mirrorlist=http://$REPO_HOST/redhat/$OS_VERSION_ARCH/cdh/$CDH_VERSION/mirrors +gpgkey=http://$REPO_HOST/redhat/$OS_VERSION_ARCH/cdh/RPM-GPG-KEY-cloudera +gpgcheck=1 EOF + rpm --import http://$REPO_HOST/redhat/$OS_VERSION_ARCH/cdh/RPM-GPG-KEY-cloudera fi retry_yum update -y retry_yum fi