From 1bcf28eca402af08b4ca158c8c2087b3a308fab5 Mon Sep 17 00:00:00 2001 From: Eike Cochu <eike@cochu.com> Date: Mon, 30 Nov 2015 22:40:03 +0100 Subject: [PATCH] added gitignore for vagrant vm added vagrantfile and bootstrapping script --- .gitignore | 1 + ma-impl.sublime-workspace | 6 +++++- vm/Vagrantfile | 17 ++++++++++++++++ vm/bootstrap.sh | 24 ++++++++++++++++++++++ vm/config/master-mongod.conf | 39 ++++++++++++++++++++++++++++++++++++ vm/env.sh | 3 +++ 6 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 vm/Vagrantfile create mode 100644 vm/bootstrap.sh create mode 100644 vm/config/master-mongod.conf create mode 100644 vm/env.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..a977916f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vagrant/ diff --git a/ma-impl.sublime-workspace b/ma-impl.sublime-workspace index 953e9880..5c125269 100644 --- a/ma-impl.sublime-workspace +++ b/ma-impl.sublime-workspace @@ -449,11 +449,15 @@ }, "expanded_folders": [ - "/home/eike/Repositories/fu/ss15/ma/impl" + "/home/eike/Repositories/fu/ss15/ma/impl", + "/home/eike/Repositories/fu/ss15/ma/impl/vm", + "/home/eike/Repositories/fu/ss15/ma/impl/vm/config" ], "file_history": [ "/home/eike/Repositories/fu/ss15/ma/impl/vm/Vagrantfile", + "/home/eike/Repositories/fu/ss15/ma/impl/vm/bootstrap.sh", + "/home/eike/Repositories/fu/ss15/ma/impl/vm/env.sh", "/home/eike/Repositories/fu/ws1415/ntdb/Vagrantfile", "/home/eike/Repositories/fu/ws1415/ntdb/puppet/manifests/default.pp", "/home/eike/Repositories/fu/ss15/ma/impl/vm/manifests/default.pp", diff --git a/vm/Vagrantfile b/vm/Vagrantfile new file mode 100644 index 00000000..1255b03f --- /dev/null +++ b/vm/Vagrantfile @@ -0,0 +1,17 @@ +Vagrant.configure(2) do |config| + config.vm.box = 'ubuntu/trusty64' + config.vm.box_check_update = true + + config.vm.provider "virtualbox" do |v| + v.memory = 8192 + v.cpus = 2 + end + + config.vm.define "master" do |master| + master.vm.hostname = 'cma-master' + master.vm.network :private_network, ip: '192.168.10.10' + master.vm.network :forwarded_port, guest: 27017, host: 27017 + master.vm.provision :shell, path: 'bootstrap.sh' + end + +end diff --git a/vm/bootstrap.sh b/vm/bootstrap.sh new file mode 100644 index 00000000..107dfb12 --- /dev/null +++ b/vm/bootstrap.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +# upgrade system +apt-get update +apt-get upgrade -y +apt-get install git scala -y + +# install & start mongodb +apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 +echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.0.list +apt-get update +apt-get install -y mongodb-org +cp /vagrant/config/master-mongod.conf /etc/mongod.conf +service mongod restart + +# install spark +wget ftp://mirror.netcologne.de/apache.org/spark/spark-1.5.2/spark-1.5.2-bin-hadoop2.6.tgz +tar zxf spark-1.5.2-bin-hadoop2.6.tgz +rm spark-1.5.2-bin-hadoop2.6.tgz +mv spark-1.5.2-bin-hadoop2.6 spark +echo "source /vagrant/env.sh" >> /home/vagrant/.bashrc + +# disable firewall +ufw disable \ No newline at end of file diff --git a/vm/config/master-mongod.conf b/vm/config/master-mongod.conf new file mode 100644 index 00000000..decdb1d9 --- /dev/null +++ b/vm/config/master-mongod.conf @@ -0,0 +1,39 @@ +# mongod.conf + +# for documentation of all options, see: +# http://docs.mongodb.org/manual/reference/configuration-options/ + +# Where and how to store data. +storage: + dbPath: /var/lib/mongodb + journal: + enabled: true +# engine: +# mmapv1: +# wiredTiger: + +# where to write logging data. +systemLog: + destination: file + logAppend: true + path: /var/log/mongodb/mongod.log + +# network interfaces +net: + port: 27017 + +#processManagement: + +#security: + +#operationProfiling: + +#replication: + +#sharding: + +## Enterprise-Only Options: + +#auditLog: + +#snmp: diff --git a/vm/env.sh b/vm/env.sh new file mode 100644 index 00000000..d7285273 --- /dev/null +++ b/vm/env.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +export PATH=$PATH:$HOME/spark/bin \ No newline at end of file -- GitLab