I am using the multidomain and singlesignon modules, currently with separate databases and no shared tables, but I wish to have common user accounts across domains not only on the same server but also on different servers. I have three sites. the master and one of the slave sites on the same server (but different domains and different drupal installs), but the second slave site is on an entirely different server.
I want each site to still have its own database, but i want to share some tables, like users and sessions. Basically I want to make both slave sites use the master site's users and sessions tables. I've got this working with the slave site that's on the same server as the master site by modifying the slave site's settings.php file as follows:
$db_prefix = array(
'default' => 'drupal_',
'users' => 'master.drupal_',
'sessions' => 'master.drupal_'
);
$db_url = 'mysql://user:pass@hostname/slave';
But how would I do this on the other slave site if it's not using the same database server? I suppose I could use the same database server for all sites, but I'd rather not have to do that. Is this even possible? Maybe something like this would be a start:
$db_url['default'] = 'mysql://user:pass@hostname/slave';
$db_url['master'] = 'mysql://user:pass@hostname2/master';
I guess the problem is that a query can be run across multiple databases on the same DBMS server but not across servers? For example, you could run the following query and combine results from multiple databases on the same DBMS server, but is there a way to run a query and combine results from two database on two different servers? Or is there another way around it?
select master.drupal_users.uid from master.drupal_users
union
select slave.drupal_users.uid from slave.drupal_users;