provision.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/sh
  2. #export HOSTNAME="mesos"
  3. #echo $HOSTNAME | sudo tee /etc/hostname
  4. #sudo hostname -F /etc/hostname
  5. # Java repos
  6. echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
  7. echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
  8. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EEA14886
  9. # Marathon repos
  10. DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
  11. CODENAME=$(lsb_release -cs)
  12. echo "deb http://repos.mesosphere.com/${DISTRO} ${CODENAME} main" | \
  13. sudo tee /etc/apt/sources.list.d/mesosphere.list
  14. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E56151BF
  15. sudo apt-get -y update
  16. sudo apt-get -y install oracle-java8-installer mesos marathon
  17. # scala
  18. wget http://downloads.typesafe.com/scala/2.10.6/scala-2.10.6.deb \
  19. && sudo dpkg -i scala-2.10.6.deb \
  20. && rm scala-2.10.6.deb
  21. # kafka mesos
  22. sudo apt-get -y install git
  23. git clone git clone https://github.com/mesos/kafka kafka-mesos \
  24. && cd kafka-mesos \
  25. && git checkout v0.9.2.0 \
  26. && ./gradlew jar -xtest \
  27. && wget https://archive.apache.org/dist/kafka/0.8.2.1/kafka_2.10-0.8.2.1.tgz \
  28. && cd ..
  29. export MESOS_NATIVE_JAVA_LIBRARY=/usr/local/lib/libmesos.so
  30. export LIBPROCESS_IP=127.0.0.1
  31. ./kafka-mesos.sh broker add 0 --heap 256 --mem 384 --cpus 0.1
  32. # mesos-dns
  33. curl -L -o /develop/mesos-dns https://github.com/mesosphere/mesos-dns/releases/download/v0.5.1/mesos-dns-v0.5.1-linux-amd64
  34. chmod a+x /develop/mesos-dns
  35. sudo sed -i '1s/^/nameserver clojure-stack\n /' /etc/resolv.conf
  36. sudo service zookeeper restart
  37. sudo service mesos start
  38. sudo service marathon start