We should eventually support provisionning drupals on other websites.

This is milestone 0.3.

CommentFileSizeAuthor
#20 366418.patch24.46 KBdrumm

Comments

anarcat’s picture

We should eventually support provisionning drupals on other websites servers.

Where's that preview button when you need it...

anarcat’s picture

Tagging for 0.3.

anarcat’s picture

Version: 5.x-0.1-rc1 » 6.x-0.3-rc1
Issue tags: +aegir-0.4
adrian’s picture

Title: 0.3: multiple server support » 0.4: multiple server support
JerryH’s picture

I'm having to figure out how to do this at the moment, and am using a web services approach as I don't like the intergration between the application and the provisioning, it's very tightly coupled & interwoven from what I can see.

Splitting it all out to a web service removes the dependency on application and location, it also infers that the local tying together of Hostmaster and Drupal can be separated; as well as the actual need for Hostmaster for some commands at all.

Having a local agent with a WS and a call to consume it, as long as the call is valid and authenticated it dosen't matter what application (and it shouldn't in an architecture) called it as long as it has permissions too.

Also am moving the reporting, status updates, remote admin commands and some content generation to WS so they can be managed in a much larger scale system.

JerryH’s picture

Is there any plan/thinking about how to go about this ?

Maybe I can do some prelim work; as multiple server support is something we have to figure out here in the next few months, as well as the system wide (mass site) reporting tools. Which I've mocked up with JpGraph as I couldn't find a graphing/reporting part of Drupal.

I see that a lot of what Hostmaster does is drush, so are you thinking some kind of ssh connection between the sites (as per http://groups.drupal.org/aegir/roadmap), or a remote agent that handles the incoming requests and drush's locally to that site ? (then you could even use it on the local site).

I've already integrated LDAP for the cross site membership (though would love to help integrate LDAP for the server/site management in Aegir), and have done a lot of work with Astereisk in the past and see them on your todo/extension modle list.

Things I'll have to do anyway (so preferably can help todo for Aegir ):

  • Remote provisioning & management for upgrades
  • System (all site) reporting

Done so far :

  • LDAP - Central resignation of users & organic groups
  • SSO between all sites - Using LDAP shared secret
  • CMS feeds using secure site from source and FeedAPI for readers

Just need to check out profiles now to make sure I can wrap it all up into one install ..........

anarcat’s picture

So there's already some work done for this. Mainly, at this point, the system is ready for pipe-based communications. The idea is to run provision over SSH commands (so instead of running drush provision install foo.example.com you would run ssh aegir@bar.example.com drush provision install foo.example.com), and there's already a tiny bit of code (one line, really) that does just that.

This works pretty well for installing, disabling, deleting, backing up and restoring sites. It becomes tricky when you want to migrate sites, because then you need first to transfer the backup between the servers. I'm not sure how we should proceed here: should we transfer the backup to the master server then to the target server? Or should the remote servers be allowed to talk to each other directly? I would prefer the former, security-wise, but it may be too much storage/bandwidth overhead.

So that's the plan, anyways. #338621: Create a hosting daemon for quicker response times goes into a slightly different direction, which you seem to be hinting at, anyways. Having a daemon for dispatching tasks would allow for easier remote communications, but then you need to strap on authentication, which may not be the best way. Still, it would allow the UI to talk directly to the backend instead of going through the cronjob/database hoops we have to go through now. It doesn't resolve the file transfer issue mentionned above though, so I'm not sure what else we would gain by that (major) overhaul.

For site-wide statistics tool, there was a statistics module that was supposed to collect stats from installed sites, but it didn't work too well if I remember correctly and was pulled from the 0.2 release. You can find that code in those two commits:

http://drupal.org/cvs?commit=215890
http://drupal.org/cvs?commit=215888

I don't think it did graphing, so that would already be a nice addition.

Regarding LDAP (we're getting a bit all over the place here, and I consider this off topic): in #462790: enable SSO in deployed sites, I presented the idea of using OpenID for distributed authentication. I think it would flow better with the general spirit of Aegir (in that you get your own drupal and are not tied into a central database, which LDAP would impose). I'd be very curious to hear (not in this issue) how you setup LDAP because I had numerous problems with it, but I consider this a bit outside the scope of aegir, as this can be accomplished using regular drupal configuration tools.

So long story short:

* multi-server: help welcome, keep to the SSH spec for now
* stats: help welcome, start with the code already done above
* LDAP: offtopic :)

JerryH’s picture

@anarcat

Backup between sites

See as the vast majority of sites have remote mysql access disabled and rightly so, that wouldn't be an option though it might be worth checking if the remote user has GRANT permissions. As then the target server could GRANT for the host/IP of the source and MySQL it straight over.

Though if you want to keep everything over SSH then there will be the 2.4 G file size limit, unless ssh/scp is compiled with 64 bit file support.

I like the idea of MySQL -> MySQL, though GRANT is a rare one for most hosts to give out due to security. Though as I understand it Aegir is more for people who have that kind of access to their servers anyway, could make having GRANT a requirement for this kind of action.

I can foresee the situation with myself and the system we're building, that we'll start sites on a shared server and the ones that make it will be migrated off to their own server(s).

With your suggestion of hub-spoke (move via the master) or mesh (slave-slave), I agree on the security vs overhead. With our set-up I think the ones that get moved are likely to be quite large so the overhead argument will win. Even if it's the master ssh'ing to the reviving server, then pulling the backup and restoring it. So the local server doesn't have permissions or access, it's a session from the master tunneling though to the source server via the target.

Seems a bit convoluted, though tunneling and onion security ideas are fairly well laid out and understood.

#338621: Create a hosting daemon for quicker response times

This I like as I already have a LDAP set up that all the server will have secure access to, so they can all use a shared secret approach. Even without LDAP you can have a cron job cycling shared keys between accepted and set up servers that will allow the security to be in place. I've set it up so far to use a system akin to : http://en.wikipedia.org/wiki/Secure_remote_password_protocol to allow a SSO approach at the moment (mainly so users can browser between organic groups they are members of across multiple servers, taking they auth token with them etc).

Statistics tool

I think I'll have to write this as a module for a local site and leave some kind of API open, so something like the hosting daemon (or agent) could query it, get the XML/stats/data, then have the master collate and render the graphs.

Not sure about licensing, though I'm guessing JpGraph can't be used because of licensing : http://www.aditus.nu/jpgraph/jpdownload.php

Though I've seen this : http://drupal.org/project/swfcharts and having something like this :

http://www.maani.us/xml_charts/index.php?menu=Gallery&submenu=Parallel_3...

For all servers would nice I think, graphical & browsable etc.

Though this is down the list on priorities for us at the moment.

LDAP

Personally I'm no fan of OpenID at all after watching a recent presentation on it. It's also not suitable for the project we're building as the membership is closed and SSO is needed just within the system domain. I'm using ApacheDS at the moment, and have use the usual Drupal LDAP modules to integrate the sign-on, and am putting in the og membership listings so they can be pulled from any where, then using a shared secret and token to move between sites.

Outcome

Will look at the ssh work done so far and moving sites about, as that's what we need :)

(Once I get this sorted : http://drupal.org/node/442238#comment-1841666)

JerryH’s picture

Well I have the og & views thing sorted now I think, so I'll be looking at this next week I hope.

anarcat’s picture

I assume the servers will have remote SQL access. Aegir also assumes GRANT privileges on the database system (at least on selected databases) and I'm fine with that too.

I never thought about the 2.4G file size limit: if sites hit that limit, there will be other problems (namely the time to transfer all that data). Not sure how to handle that issue.

Regarding spoke vs mesh setup, I feel more strongly towards the spoke system, but I guess it could be made flexible enough so that both schemes are supported, and the choice is made depending on the keys available.

Thanks for the feedback, looking forward to more input here, and please do let us know if you actually start working on any of this so we don't duplicate work.

redpuma’s picture

Subscribe

JerryH’s picture

75% of the way though the site build now so this is getting rather close [ i.e. I've not forgotten ;) ] !!

anarcat’s picture

anarcat’s picture

anarcat’s picture

Title: 0.4: multiple server support » 0.4: multiple web server support

Let's make this the multiple *web* server support, since it's really what we're talking about.

In a recent chat with Adrian, we came to the agreement that we could support both "spoke/hub" and "mesh" configurations by adding a new service type: the file server. In the spoke configuration, only the hostmaster server would have a file server, and all web servers would have credentials to access the fileserver. In a mesh configuration, all servers would run file servers and files could be freely exchanged around.

The core idea here is that the migration system would "route" the files depending on the fileserver topology, which would therefore need to be shared amongst all servers.

anarcat’s picture

Priority: Minor » Normal
Annakan’s picture

Hello all.

I was trying to set up the multiple server thing following http://groups.drupal.org/node/21966 that seems a bit old.

I found out it was a good base but Lacked all the database part that is needed to set up the other server but since I am not sure about the architecture that is aimed at.

For me the goal is to set up a staging environment (nearly there and I'll report the result as promised as soon as I am a bit satisfied with it) where I can move sites from dev, then test, on the same server for me now, and prod that is on a completely separated (jailed in freebsd term) environment with the same platforms (drupal, pressflow, aquia, OpenAtrium ...) as the one used in dev and test but dedicated to public exposure.

I had to create the SAME master database with the same credentials I used on the first server to get the platform to validate on the "production/public exposed" other server.

It validated fine but now I can't migrate the sites between the local and "remote" platform, but maybe it is not quite there already ?

I want to say that I am "strongly" (as in as strong as a loosy contributor I am ) opposed to opening the mysql database to remote access.
I really don't trust my databases to be remote secure, and they are too big targets to ever feel safe with them, and too crucial to risk seeing them tampered with. I strongly think it should be accessed through local sockeds only and secured being a good firewall (pf in my case).
I understand that remote access if useful and feasible in a controlled environment, cluster configuration and the like but I think it should not be a REQUIREMENT for migration.
Besides for me to migrate a server is really an potentially heavy load operation that either happens when you publish a site or when you really want to offload a site to another server, in that case you really want to move the database along.
And like you I like the "Push" architecture, where one server can upload a backup and send command to another one without giving any rights to the target on the "master" one.

As for http://groups.drupal.org/node/21966, I would really love to edit it and at least expands it on the ssh setup since the link it refers too is a complicated mess and borderline "wrong" but I did not want to "steal" Briwood work with maybe inferior work as long as I am sure about the best way to do it.

Maybe I should do another page with my edits and wait for a review ?

I will also do a report on the freeBSD fresh install I did recently with the new procedure to help fellow freebsd guys and help further evolve the install process.

Thanks a lot for your time all.

anarcat’s picture

Version: 6.x-0.3-rc1 » 6.x-0.4-alpha3

@Annakan mysql migration is a separate issue, please followup on #605414: multiple database server support.

As for the docs, feel free to edit, it's a wiki. But please be polite and do not destroy what's already there, since it works, mostly.

anarcat’s picture

Also note that I started looking at queuing systems which may resolve some of the issues here:

http://groups.drupal.org/node/36428

drumm’s picture

Status: Active » Needs review
StatusFileSize
new24.46 KB

Here is a patch for this.

anarcat’s picture

Status: Needs review » Needs work

So from what I can tell (and after chatting with drumm), this allows for assignment of multiple servers to a single platform. I was originally unconfortable with that idea: i think that we should have the notion of "cluster" that behave basically as a single server.

However now, looking at the code, it makes a lot of sense: the dispatcher calls provision once per server:

+  foreach ($hosts as $host) {
+    $output += drush_backend_invoke("provision-" . $task->task_type, $data, $mode, TRUE, $drush_path, $host['hostname'], $host['username']);

The problem with that of course is that provision-install, when called multiple times, will create multiple sites: it will not "see" the already existing site and use that. But I think that's actually a backend problem rather than a frontend issue. Basically, what we want is a way to disable the provision_db_server and provision_platform "modules" in the drush backend. That's because we don't want to touch the filesystem more than once if we have a shared file server (which is what Platform does, really). Same for the DB server. This can probably be done by hooking those modules into commandline flags through #691174: Allow drush command files to define functions that control whether or not they will be loaded.

Another thing that is problematic with the patch is how error-prone it is: if I have server A, B and C associated with platform X... when I create platform Y, I probably want to associate it with the same cluster... If I miss one of those, things start getting a bit bizarre. So having a level of abstraction in the frontend for that "ABC" cluster would be useful to avoid those errors. But I guess that can be handled later on.

drumm’s picture

Confirmed that we did end up with two databases. Otherwise, the sites look okay. Vertice said he is concentrating on drush this week, so maybe something to handle that will happen.

In general, commands need to know if they should run on one or all servers. For install, you do want all the web stuff to run in parallel. I ran reset password, the UI caught the first link, but the second link was what I wanted with how DNS was working (using hosts to target a site at a time for debugging).

In the future, some admin screen summarizing what servers are running what may be useful for humans seeing platforms have the right servers and how much each server is doing. And/or organize your hostnames.

drumm’s picture

We should be able to break out the Provision end of this into a separate issue. anarcat or vertice- can you write up a plan for that so we can help out in that issue?

joshk’s picture

Grouping things around the platform makes a lot of sense to me as Aegir currently has no way (or even a formally roadmapped way) to handle the deployment of code to a server (or servers) for the purpose of constituting a platform. Indeed, the notion of what goes into a platform is pretty out of scope of the current iteration (or two).

However, the simple "multi-server" platform needs to be a bit smarter, in that it should at least not call all the provision tasks every time. Notably, right now two databases are created.

Added a feature request for Provision: #730892: Adding a --no-database or --web-only option

yajnin’s picture

subscribe

adrian’s picture

Status: Needs work » Fixed

This has been completed in HEAD thanks to drumm and myself.

you can even migrate sites between web servers and manage clusters of web servers.

Status: Fixed » Closed (fixed)
Issue tags: -aegir-0.4, -multiserver

Automatically closed -- issue fixed for 2 weeks with no activity.