#!/bin/bash # System setup (root access is required) # Working directories set -e script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" mkdir -p ${script_dir}/tmp # Install OS packages cd ${script_dir}/tmp if which apt-get > /dev/null 2>&1; then wget -O - http://debian.neo4j.org/neotechnology.gpg.key >> key.pgp || exit 1 sudo apt-key add key.pgp || exit 1 sudo echo 'deb http://debian.neo4j.org/repo stable/' | tee -a /etc/apt/sources.list.d/neo4j.list > /dev/null || exit 1 sudo apt-get update || exit 1 sudo apt-get install -y maven default-jdk neo4j || exit 1 else echo "Assuming that 'maven', 'jdk' and 'neo4j' are installed" fi # Install Hadoop cd ${script_dir}/tmp hadoop_version="hadoop-2.7.3" hadoop_tar="${hadoop_version}.tar.gz" hadoop_url="http://apache.mirrors.tds.net/hadoop/common/${hadoop_version}/${hadoop_tar}" wget ${hadoop_url} tar -xzf ${hadoop_tar} # TODO: root access is required here -> run hadoop under a current user echo "Moving hadoop to /usr/local/hadoop" sudo mv ${hadoop_version} /usr/local/hadoop # Performance Setup # echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor >/dev/null # Cleanup rm -rf ${script_dir}/tmp