For one of my clients we were looking for an affordable alternative to Amazon AWS and Heroku. The ‘self-hosted’ Cloud without loosing to many features and still maintainable.
We followed the following steps for the implementation:
- Which components to use? (Docker, CloudFoundry, DC/OS ?)
- Setup of first prototype
- First Production Pilot (here we are now)
- Transfer of Applications in the new cloud
First: Which components to use?
Our current stack is single Docker Instances on several servers. Our goal is to abstract from single servers and deploy services on a transparent stack. So our wishlist is:
- Run Docker containers
- Manage Docker dependencies
- Balance resources and load
- is reliable
After comparing the possible solution dcos.io (datacenter/OS) is really promising: ‘The Definitive Platform for Modern Apps – Production Experience Built-in.’. It was created by mesosphere and should cover exactly the need described above.
Second: Prototype Setup on Hetzner
To get a first hands-on experience with DC/OS I used the DC/OS-Vagrant deployment, which runs a couple of vagrant virtual machines to emulate a cluster.
> https://github.com/dcos/dcos-vagrant
The installation on RAW Ubuntu was quite easy:
1 2 3 4 5 6 7 |
git clone https://github.com/dcos/dcos-vagrant vagrant plugin install vagrant-hostmanager wget https://downloads.dcos.io/dcos/stable/dcos_generate_config.sh?_ga=1.92771035.733629872.1475675620 # change the Configuration vagrant up m1 a1 p1 boot |
To make the UI accessable from outside I used nginx. Use apt-get install nginx and modifiy /etc/nginx/sites-enabled/default as following
1 2 3 4 5 6 7 8 9 10 |
server { listen 80 default_server; listen [::]:80 default_server; location / { proxy_pass http://m1.docs/; // alt: http://192.168.65.90/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } } |
In case it does not work, you may try to find out the ip address of your m1.dcos virtual machine and replace the DNS-Name by the IP address:
1 2 3 4 5 6 7 8 9 |
# vagrant global-status id name provider state directory ----------------------------------------------------------------------- ba5042a m1 virtualbox running /root/dcos-vagrant # host m1.dcos m1.dcos has address 192.168.65.90 |
Open your browser and enjoy your new DC/OS setup!
To get started try out mesosphere marathon, which is the service running other services.
The setup of the production cluster will be described in the next article. For this setup I prepared automated installation scripts for Hetzner server to reduce your installation time.
Hello Mr. Fakir,
did you by any chance got the setup running on hetzner after all? I’m currently trying a similar setup with CoreOS on a Hetzner server and would like to try dc/os there too but I’m not sure if it’s actually possible with the tools hetzner offers even though they are normally quite good.
Kind regards,
Jan Matthiesen