Skip to content

Instantly share code, notes, and snippets.

@srs81
Forked from bbeck/setup.sh
Created July 24, 2012 17:39
Show Gist options
  • Select an option

  • Save srs81/3171401 to your computer and use it in GitHub Desktop.

Select an option

Save srs81/3171401 to your computer and use it in GitHub Desktop.

Revisions

  1. srs81 revised this gist Aug 1, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions asgard_setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    #################
    # Update packages
    #################
    DEBIAN_FRONTEND="noninteractive" sudo apt-get --assume-yes update
    DEBIAN_FRONTEND="noninteractive" sudo apt-get --assume-yes upgrade
    sudo yum -y update
    sudo yum -y upgrade


    ########################
  2. srs81 renamed this gist Jul 24, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup.sh → asgard_setup.sh
    Original file line number Diff line number Diff line change
    @@ -49,7 +49,7 @@ mv "asgard.war" "tomcat/webapps/ROOT.war"

    # Need to up the heap that tomcat uses
    cat <<-EOF > "tomcat/bin/setenv.sh"
    if [ "\$1" == "start" ]; then
    if [ "\$1" = "start" ]; then
    export JAVA_OPTS=" \\
    -verbose:sizes \\
    -Xmx4g -Xms4g \\
  3. @bbeck bbeck created this gist Jun 27, 2012.
    75 changes: 75 additions & 0 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,75 @@
    #################
    # Update packages
    #################
    DEBIAN_FRONTEND="noninteractive" sudo apt-get --assume-yes update
    DEBIAN_FRONTEND="noninteractive" sudo apt-get --assume-yes upgrade


    ########################
    # Install the Oracle JDK
    ########################
    JDK_URL="http://download.oracle.com/otn-pub/java/jdk/6u32-b05/jdk-6u32-linux-x64.bin"
    wget --quiet --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" "${JDK_URL}"

    chmod +x "jdk-6u32-linux-x64.bin"
    yes | ./jdk-6u32-linux-x64.bin

    sudo mkdir -p /usr/lib/jvm/
    sudo mv jdk1.6.0_32 /usr/lib/jvm/

    for binary in $(ls /usr/lib/jvm/jdk1.6.0_32/bin/j*); do
    name=$(basename $binary)
    sudo update-alternatives --install /usr/bin/${name} ${name} ${binary} 1
    sudo update-alternatives --set ${name} ${binary}
    done

    rm "jdk-6u32-linux-x64.bin"


    ################
    # Install Tomcat
    ################
    TOMCAT_URL="http://mirror.symnds.com/software/Apache/tomcat/tomcat-7/v7.0.28/bin/apache-tomcat-7.0.28.tar.gz"
    wget --quiet --no-cookies "${TOMCAT_URL}"

    tar xvfz "apache-tomcat-7.0.28.tar.gz"
    mv "apache-tomcat-7.0.28" "tomcat"
    rm "apache-tomcat-7.0.28.tar.gz"

    # "undeploy" the ROOT war...
    rm -rf tomcat/webapps/ROOT


    ################
    # Install Asgard
    ################
    ASGARD_URL="https://github.com/downloads/Netflix/asgard/asgard.war"
    wget --quiet --no-cookies "${ASGARD_URL}"
    mv "asgard.war" "tomcat/webapps/ROOT.war"

    # Need to up the heap that tomcat uses
    cat <<-EOF > "tomcat/bin/setenv.sh"
    if [ "\$1" == "start" ]; then
    export JAVA_OPTS=" \\
    -verbose:sizes \\
    -Xmx4g -Xms4g \\
    -Xmn2g \\
    -XX:MaxPermSize=128m \\
    -XX:+HeapDumpOnOutOfMemoryError \\
    -XX:-UseGCOverheadLimit \\
    -XX:+ExplicitGCInvokesConcurrent \\
    -XX:+PrintGCDateStamps -XX:+PrintGCDetails \\
    -XX:+PrintTenuringDistribution \\
    -XX:+CMSClassUnloadingEnabled \\
    -XX:+UseConcMarkSweepGC \\
    "
    else
    export JAVA_OPTS=""
    fi
    EOF


    ################
    # Startup Tomcat
    ################
    tomcat/bin/startup.sh