• Stars
    star
    435
  • Rank 100,085 (Top 2 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 11 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Spin up your Mesos Cluster with Vagrant! (VirtualBox and AWS)

vagrant-mesos ![Gitter](https://badges.gitter.im/Join Chat.svg)

Spin up your Mesos cluster with Vagrant! (Both Virtualbox and AWS are supported.)

This spins up Mesos 0.22.1 cluster and also spins up a framework server node in which Marathon (0.8.2) and Chronos (2.1.0) are running. This means you can build your own Mesos+Marathon+Chronos+Docker PaaS with vagrant up!! Marathon works as distributed init.d and Chronos works as distributed cron!! If you wanted to deploy docker containers, please refer to the chapter "Deploy Docker Container with Marathon" in this blog entry.

The mesos installation is powered by Mesos chef cookbook. Please see everpeace/cookbook-mesos.

Base boxes used in Vagrantfiles are Mesos pre-installed boxes, everpeace/mesos shared on Vagrant Cloud.

Prerequisites

Mesos Standalone on VirtualBox

It's so simple!

$ git clone https://github.com/everpeace/vagrant-mesos.git
$ cd vagrant-mesos/standalone
$ vagrant up

After box is up, you can see services running at:

Mesos Standalone on EC2

  1. Set ec2 credentials and some configurations defined in standalone/aws_config.yml. You have to fill up EDIT_HERE parts. Security group you'll set must accept at least tcp port 22(SSH) and 5050(mesos-master web ui) from outside of ec2.

     # Please set AWS credentials
     access_key_id:  EDIT_HERE
     secret_access_key: EDIT_HERE
    
     # Please choose one from
     # ["ap-northeast-1", "ap-southeast-1", "eu-west-1", "sa-east-1", "us-east-1",
     #  "us-west-1", "ap-southeast-2", "us-west-2"]
     region: us-east-1
    
     # array of security groups. e.g. ['sg*** ']
     security_groups: EDIT_HERE
    
     # See http://aws.amazon.com/ec2/instance-types/#selecting-instance-types
     # for other instance types and its specs.
     instance_type: m1.small
    
     keypair_name: EDIT_HERE
    
     ssh_private_key_path: EDIT_HERE
    
  2. You can spin up mesos box on ec2 by the same way with the case of virtual box

     cd standalone
     vagrant up --provider=aws
    

    After box is up, you can see services running at:

    • Mesos web UI on: http://#_public_dns_of_the_VM_#:5050
    • Marathon web UI on: http://#_public_dns_of_the_VM_#:8080
    • Chronos web UI on: http://#_public_dns_of_the_VM_#:8081

    Tips: you can get public dns of the vm by:

    $ vagrant ssh -- 'echo http://`curl --silent http://169.254.169.254/latest/meta-data/public-hostname`:5050'
    http://ec2-54-193-24-154.us-west-1.compute.amazonaws.com:5050
    

Mesos Cluster on VirtualBox

Cluster Configuration

Cluster configuration is defined at multinodes/cluster.yml. You can edit the file to configure cluster settings.

# Mesos cluster configurations
mesos_version: 0.22.1

# The numbers of servers
##############################
zk_n: 1          # hostname will be zk1, zk2, …
master_n: 1      # hostname will be master1,master2,…
slave_n : 1      # hostname will be slave1,slave2,…

# Memory and Cpus setting(only for virtualbox)
##########################################
zk_mem     : 256
zk_cpus    : 1
master_mem : 256
master_cpus: 1
slave_mem  : 512
slave_cpus : 2

# private ip bases
# When ec2, this should be matched with
# private addresses defined by subnet_id below.
################################################
zk_ipbase    : "172.31.0."
master_ipbase: "172.31.1."
slave_ipbase : "172.31.2."

Launch Cluster

This takes several minutes(10 to 20 min.). It's time to go grabbing some coffee.

$ cd multinodes
$ vagrant up

At default setting, after all the boxes are up, you can see services running at:

Destroy Cluster

this operations all VM instances forming the cluster.

$ cd multinodes
$ vagrant destroy

Mesos Cluster on EC2 (VPC)

Because we assign private IP addreses to VM instances, this Vagrantfile requires Amazon VPC (you'll have to set subnet_id and security grooups both of which associates to the same VPC instance).

Note: Using default VPC is highly recommended. If you used non-default VPC, you should make sure to activate "DNS resolution" and "DNS hostname" feature in the VPC.

Cluster Configuration

You have to configure some additional stuffs in multinodes/cluster.yml which are related to EC2. Please note that

  • subnet_id should be a VPC subnet
  • security_groups should be ones associated to the VPC instance.
    • security_groups should allow accesses to ports 22(SSH), 2181(zookeeper) and 5050--(mesos).
(cont.)
# EC2 Configurations
# please choose one region from
# ["ap-northeast-1", "ap-southeast-1", "eu-west-1", "sa-east-1",
#  "us-east-1", "us-west-1", "ap-southeast-2", "us-west-2"]
# NOTE: if you used non-default vpc, you should make sure that
#       limit of the elastic ips is no less than (zk_n + master_n + slave_n).
#       In EC2, the limit default is 5.
########################
access_key_id:  EDIT_HERE
secret_access_key: EDIT_HERE
default_vpc: true                  # default vpc or not.
subnet_id: EDIT_HERE               # VPC subnet id
security_groups: ["EDIT_HERE"]     # array of VPN security groups. e.g. ['sg*** ']
keypair_name: EDIT_HERE
ssh_private_key_path: EDIT_HERE
region: EDIT_HERE

# see http://aws.amazon.com/ec2/instance-types/#selecting-instance-types
zk_instance_type: m1.small
master_instance_type: m1.small
slave_instance_type: m1.small

Launch Cluster

After editing configuration is done, you can just hit regular command.

$ cd multinode
$ vagrant up --provider=aws --no-parallel

NOTE: --no-parallel is highly recommended because vagrant-berkshelf plugin is prone to failure in parallel provisioning.

After instances are all up, you can see

  • mesos web UI on: http://#_public_dns_of_the_master_N_#:5050
  • marathon web UI on: http://#_public_dns_of_marathon_#:8080
  • Chronos web UI on: http://#_public_dns_of_chronos#:8081

if everything went well.

Tips: you can get public dns of the vms by:

$ vagrant ssh master1 -- 'echo http://`curl --silent http://169.254.169.254/latest/meta-data/public-hostname`:5050'
http://ec2-54-193-24-154.us-west-1.compute.amazonaws.com:5050

If you wanted to make sure that the specific mastar(e.g. master1) could be an initial leader, you can cotrol the order of spinning up VMs like below.

$ cd multinode
# spin up an zookeeper ensemble
$ vagrant up --provider=aws /zk/

# spin up master1. master1 will be an initial leader
$ vagrant up --provider=aws master1

# spin up remained masters
$ vagrant up --provider=aws /master[2-9]/

# spin up slaves
$ vagrant up --provider=aws /slave/

# spin up marathon
$ vagrant up --provider=aws marathon

Stop your Cluster

$ cd multinodes
$ vagrant halt

Resume your Cluster

$ cd multinodes
$ vagrant reload --provision

Destroy your Cluster

This operations terminates all VMs instances forming the cluster.

$ cd multinodes
$ vagrant destroy

More Repositories

1

ml-class-assignments

Programming Exercises on http://ml-class.org
MATLAB
427
star
2

k8s-scheduler-extender-example

An example of kubernetes scheduler extender
Go
177
star
3

kube-openmpi

Open MPI jobs on Kubernetes
Makefile
109
star
4

cookbook-mesos

Cookbook for Mesos (http://mesos.apache.org/).
Ruby
74
star
5

concourse-gitlab-flow

concourse pipeline sample of environment branches with GitLab flow branching model
Shell
62
star
6

k8s-host-device-plugin

very thin kubernetes device plugin which just exposes device files in host to containers.
Go
47
star
7

kafka-reassign-optimizer

Kafka Partitions Re-Assignment Optimizer in scala
Scala
45
star
8

ml-examples-by-scalala

Machine Learning Algorithms Samples By Scalala
Scala
35
star
9

kube-throttler

throttling your pods in kubernetes cluster.
Go
32
star
10

programming-erlang-code

erlang codes in "Programming Erlang" http://pragprog.com/book/jaerlang/programming-erlang
Erlang
21
star
11

healthchecks

tiny healthcheck library for akka-http with Kubernetes liveness/readiness probe support
Scala
20
star
12

packer-mesos

Bake your own Mesos(http://mesos.apache.org) pre-installed virtual machine images.
Ruby
19
star
13

rxscalaz

some useful type class instances for Observable
Scala
13
star
14

dbt-models-metadata

Extension package for dbt to build a metadata table for your dbt models along side your models.
Makefile
12
star
15

banditsbook-scala

Scala implementations of standard algorithms for Multi-Armed Bandits Problem.
Scala
12
star
16

ring-benchmark-in-akka

This is another implementation in Akka of http://github.com/everpeace/ring-benchmark .
Scala
10
star
17

composing-monads

monads can compose when distributive law exists.
Scala
10
star
18

helm-charts

my public helm chart repository
Smarty
9
star
19

scalamata

Automata in Scala
Scala
9
star
20

string-score

string-score is a port of Joshaven Potter's string_score to Java.
Java
8
star
21

concourse-github-flow

sample pipeline of concourse ci for projects applying github-flow
Shell
7
star
22

constructr-redis

This library enables to use Redis as cluster coordinator in a ConstructR based cluster
Scala
6
star
23

dotfiles

dotfiles
Shell
6
star
24

aws-kms-resource

Concourse CI resource for decrypting your secrets by AWS Key Management Service
Shell
6
star
25

asdf-docker-slim

docker-slim plugin for asdf version manager
Shell
6
star
26

docker-chainer

all-in-one chainer docker image for instant distributed machine learning (chainer/chainermn/CUPY/CUDA/CuDNN/NCCL2/OpenMPI)
Shell
5
star
27

scala-galois

Galois Field Arithmetic Library in Scala.
Scala
5
star
28

kube-zookeeper

Makefile
5
star
29

bk-tree

implementation of bk-tree, which provides effective search in a given metric space.
Java
5
star
30

go-actor

far far incomplete actor implementation in golang. This is only for my golang learning.
Go
5
star
31

ring-benchmark

This is my solution for the "Ring Benchmark" exercise in "Programming in Erlang".
Erlang
5
star
32

observable-canbe-monad

try to verify Observable, in RxJava, can be a Monad.
Scala
4
star
33

minwise-lsh

an implementation of locality sensitive hash using min-wise permutation family.
Java
4
star
34

scala-bikleisli

BiKleisli Arrow in Scala using Scalaz
Scala
4
star
35

ts-analysis-by-R

private reading and exercise notes of "Rγ«γ‚ˆγ‚‹ζ™‚η³»εˆ—εˆ†ζžε…₯ι–€"
R
4
star
36

bloom-filter

This is an implementation of Bloom Filter, especially CountingBloomFilter.
Scala
4
star
37

word2vec-jawiki

Tool to build word embeddings with word2vec from japanese wikipedia dump data
Shell
4
star
38

ring_benchmark_in_elixir

This is another implementation in Elixir of http://github.com/everpeace/ring-benchmark
Elixir
3
star
39

k8s-leader-elector

Go
3
star
40

docker-curl-jq

ubuntu-slim based curl + jq box
Dockerfile
3
star
41

kubectl-pecologs

'kubectl logs' for multiple pods/containers + peco
Shell
2
star
42

CommonRegexScala

CommonRegex port for Scala
Scala
2
star
43

scaldingla

linear algebra algorithms in scalding
Scala
2
star
44

faceted-values

faceted values: a strong primitive for privacy sensitive values
Haskell
2
star
45

maven-repository

everpeace personal maven repository
1
star
46

vagrant-cassandra

vagrant configuration for cassandra cluster
Ruby
1
star
47

gitsshm

gitsshm: GIT_SSH Manager.
1
star
48

akka-exp

custom load balancer by akka
Scala
1
star
49

easymock-junit4-rule

JUnit4's rule injecting EasyMock objects using annotations.
1
star
50

k8s-dumb-device-plugin

learning k8s device plugin
Go
1
star
51

mesos-driver-enters-zombie

This can reproduce the issue that MesosSchedulerDriver enters zombie state even after it stopped normally.
Scala
1
star
52

field-type-resolver

a utility which resolve an actual type of a given field in a given class hierarchy.
1
star
53

throttolable-perf-consumer

Scala
1
star
54

dining-philosophers

dining philosophers on alloy
1
star
55

chainer-operator-proto

prototype of chainer-operator for kubernetes
Shell
1
star
56

merkle-tree

[UNDER CONSTRUCTION] This is an implementation of Merkle-Tree.
1
star
57

monad-from-applicative

Verifying that Traversable and Monoid Functor can be a Mond.
Haskell
1
star
58

homebrew-ssh-agent-filter

ssh-agent-filter homebrew tap repository for macOS.
Ruby
1
star