Created
September 27, 2013 09:40
-
-
Save vallettea/6726257 to your computer and use it in GitHub Desktop.
for ec2 on aws
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# initialize and install postgresql | |
sudo apt-get update | |
sudo apt-get -y install postgresql postgresql-client postgresql-contrib | |
sudo apt-get -y install postgresql-9.1-postgis | |
# basics | |
sudo apt-get -y install git | |
sudo apt-get -y install git-flow | |
sudo apt-get -y install curl | |
sudo apt-get -y install unzip | |
sudo apt-get -y install make | |
sudo apt-get -y install gcc | |
sudo apt-get -y install g++ | |
sudo apt-get -y install cmake | |
sudo apt-get -y install build-essential | |
# zsh | |
sudo apt-get -y install zsh | |
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh | |
cp ~/.zshrc ~/.zshrc.orig | |
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc | |
chsh -s /bin/zsh | |
sudo apt-get -y install autojump | |
# vim | |
sudo apt-get -y install vim | |
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle | |
# java 7 | |
sudo apt-get -y install python-software-properties | |
sudo add-apt-repository -y ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install -y oracle-java7-installer | |
# filesystem | |
cd | |
mkdir alexandre | |
#osmosis | |
cd ~/alexandre | |
wget http://bretth.dev.openstreetmap.org/osmosis-build/osmosis-latest.tgz | |
mkdir osmosis | |
tar xvzf osmosis-latest.tgz -C osmosis | |
chmod a+x osmosis/bin/osmosis | |
rm osmosis-latest.tgz | |
cd | |
# move postgre data to mnt | |
sudo mkdir /mnt/postgre_data | |
sudo chown postgres /mnt/postgre_data/ | |
sudo chmod -R 700 /mnt/postgre_data/ | |
sudo pg_dropcluster 9.2 main --stop | |
sudo pg_createcluster 9.2 main -d /mnt/postgre_data/ | |
sudo su postgres | |
pg_ctlcluster 9.2 main start | |
exit | |
sudo sed -i 's/peer/trust/g' /etc/postgresql/9.2/main/pg_hba.conf | |
sudo sed -i 's/md5/trust/g' /etc/postgresql/9.2/main/pg_hba.conf | |
/usr/lib/postgresql/9.2/bin/pg_ctl -D /etc/postgresql/9.2/main start | |
# create db for osmosis | |
createdb osm | |
createlang plpgsql osm | |
psql -d osm -c 'create extension hstore;' | |
psql -d osm -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql | |
psql -d osm -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql | |
psql -d osm -f /home/ubuntu/alexandre/osmosis/script/pgsnapshot_schema_0.6.sql | |
psql -d osm -f /home/ubuntu/alexandre/osmosis/script/pgsnapshot_schema_0.6_action.sql | |
exit | |
# populate db using osmosis | |
cd ~/alexandre | |
mkdir pbf | |
cd pbf | |
wget http://download.geofabrik.de/europe/great-britain/england/greater-london-latest.osm.pbf | |
cd .. | |
sudo sed -i 's/peer/trust/g' /etc/postgresql/9.2/main/pg_hba.conf | |
sudo sed -i 's/md5/trust/g' /etc/postgresql/9.2/main/pg_hba.conf | |
/usr/lib/postgresql/9.1/bin/pg_ctl -D /var/lib/postgresql/9.1/main restart | |
osmosis/bin/osmosis --rbf file="pbf/greater-london-latest.osm.pbf" --wp user="postgres" database="osm" | |
# scala | |
wget http://www.scala-lang.org/files/archive/scala-2.10.2.tgz | |
tar zxf scala-2.10.2.tgz | |
rm scala-2.10.2.tgz | |
sudo mv scala-2.10.2 /usr/share/scala | |
sudo ln -s /usr/share/scala/bin/scala /usr/bin/scala | |
sudo ln -s /usr/share/scala/bin/scalac /usr/bin/scalac | |
sudo ln -s /usr/share/scala/bin/fsc /usr/bin/fsc | |
sudo ln -s /usr/share/scala/bin/sbaz /usr/bin/sbaz | |
sudo ln -s /usr/share/scala/bin/sbaz-setup /usr/bin/sbaz-setup | |
sudo ln -s /usr/share/scala/bin/scaladoc /usr/bin/scaladoc | |
sudo ln -s /usr/share/scala/bin/scalap /usr/bin/scalap | |
# sbt | |
cd | |
wget http://scalasbt.artifactoryonline.com/scalasbt/sbt-native-packages/org/scala-sbt/sbt//0.12.4/sbt.deb | |
sudo dpkg -i sbt.deb | |
rm sbt.deb | |
mkdir ~/.sbt | |
echo 'scalaVersion := "2.10.2"' >> ~/.sbt/global.sbt | |
# elastic search | |
cd | |
cd alexandre | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.2.zip | |
unzip elasticsearch-0.90.2.zip | |
rm elasticsearch-0.90.2.zip | |
mv elasticsearch-0.90.2 elasticsearch | |
cd elasticsearch | |
git clone https://github.com/elasticsearch/elasticsearch-servicewrapper.git | |
mv elasticsearch-servicewrapper/service/ bin/service/ | |
rm -rf elasticsearch-servicewrapper/ | |
bin/service/elasticsearch start | |
# titan | |
cd | |
mkdir -p alexandre/DATA/ | |
mkdir -p /mnt/gdb | |
ln -s /mnt/gdb /home/ubuntu/alexandre/DATA/gdb | |
wget http://s3.thinkaurelius.com/downloads/titan/titan-all-0.3.1.zip | |
unzip titan-all-0.3.1.zip | |
rm titan-all-0.3.1.zip | |
mv titan-all-0.3.1 titan | |
cd titan/config | |
rm cassandra.yaml | |
curl -O https://gist.github.com/vallettea/084dcbb35448492a8e3e/raw/fae18a2e59a1c46ac56eed29a45bdd4794308675/cassandra.yaml | |
curl -O https://gist.github.com/vallettea/dd7138fbff50316f7cc7/raw/ec98a7ac6100c9dcf647daee6c21a15fae059e71/t-c-es-remote.properties | |
curl -O https://gist.github.com/vallettea/03a4dfb3e91ef56cf188/raw/94be17c1495d1a033ad9ad67811db86e8c492cf9/t-c-es-remotethrift.properties | |
cd .. | |
cd bin | |
# add -javaagent:$(dirname $0)/jamm-0.2.5.jar to javaoptions in titan.sh | |
wget http://repo1.maven.org/maven2/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar | |
cd .. | |
./bin/titan.sh config/titan-server-rexster.xml config/t-c-es-remote.properties |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment