Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate playbooks for better multi-server support #536

Open
1 task done
swalkinshaw opened this issue Mar 29, 2016 · 12 comments
Open
1 task done

Separate playbooks for better multi-server support #536

swalkinshaw opened this issue Mar 29, 2016 · 12 comments

Comments

@swalkinshaw
Copy link
Member

swalkinshaw commented Mar 29, 2016

Right now Trellis is designed to work on single servers. This means MariaDB (database), Nginx (web server), etc all on the same server. It's obviously a good practice to break these apart for scaling.

This requires a lot of manual work as it is. Our hosts files can easily support different groups and servers within them, but server.yml isn't set up to easily take advantage of multiple groups.

The solution is probably to create more playbooks. At least the following:

  • database
  • web server

A unified server.yml can still exist which ties them all together by default.

@rhetthenckel
Copy link

I was curious if there has been any movement on this? I would LOVE to use trellis to test, provision, and deploy a multi server setup. The setup that I thought would be ideal would include:

  • load balancer (with nginx or HAPROXY?)
  • 2+ web servers (scalable)
  • database (maybe with NFS volume mounted to all web servers webroot?)

I found this tutorial on DreamCompute which uses this LAMP setup. I am no ansible expert, but maybe this is a good starting place to see how some of these things are achieved and could be incorporated into Trellis. For reference, here's another tutorial to achieve this setup manually without using ansible.

@swalkinshaw
Copy link
Member Author

No there hasn't been any progress on this.

We're still looking for people to help out with it.

@partounian
Copy link
Contributor

Hey @swalkinshaw , I would love to help take on this project. To be completely honest, I have never used config management until this project, but I'd love to learn and this would be a great task.
How can we start?

@nathanielks
Copy link
Contributor

@partounian I've done this on a couple projects, actually, but I can't reveal source. First task would be to update the Vagrant file to spin up multiple servers resembling database, cache, and web servers. This would help to enforce the boundary rather than try to guess how interacting with separate servers would behave. After that, set up a playbook that installs common configuration on all the servers (common, ntp, ssh, etc) and then focus on installing the specific roles on each server. From there, you run the playbook, break something, fix it, and repeat!

This would be a great project to get familiar with how everything is set up. Definitely diving into the deep end, but worth it 👍

@partounian
Copy link
Contributor

Thanks for the pointers! I'm excited, but that's also partially the redbull, I'll take a stab at this when I can and report back progress. Also, have you guys considered a Slack?

@strarsis
Copy link
Contributor

This would also make containers possible, e.g. with docker-compose because each container/instance can use its own separate playbook (or have it provisioned, e.g. using packer.io with docker - or have the config mounted that is copied otherwise).

@partounian
Copy link
Contributor

partounian commented Jun 24, 2017

I thought for docker it would be best to use docker machine and whatnot. Anyhow, I'm currently in the middle of a big project, but when I finish (July 1st-ish) I will start work on this.

Update: Sorry for not working on this, I just haven't seen a usage yet after using Trellis for over a year.

@pepijn-vanvlaanderen
Copy link

pepijn-vanvlaanderen commented Feb 25, 2019

There is a forked trellis setup for Laravel (https://github.com/ptibbetts/anstead) which I have used once where the playbooks are separated and also a redis role is added. It is a bit outdated now compared to the current version of trellis, but worked properly.

@partounian
Copy link
Contributor

partounian commented Feb 25, 2019 via email

@pepijn-vanvlaanderen
Copy link

Should be great to have a tutorial on this in the docs.

@techieshark
Copy link

@partounian did you end up writing a tutorial on this? My use case is one server for PHP+Nginx plus another for database, and I'm curious how to set that up with Trellis. Thanks!

@partounian
Copy link
Contributor

partounian commented Jul 20, 2021

@partounian did you end up writing a tutorial on this? My use case is one server for PHP+Nginx plus another for database, and I'm curious how to set that up with Trellis. Thanks!

I used a managed DB offering. Managing your own DB is not worth it.

I just commented out or deleted the roles iirc on my private fork when I used trellis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants