Hello,

I am a novice that is working with an AWS EC2 instance and RDS that I have dumped my DB onto.

I am trying to install a Drupal site with three directories pointing to one RDS DB that I have already dumped my sql files onto.

Is there a specific way I have to point my settings.php files for each of my sites to each of the schemas within that DB in order to get them to read them properly? I receive this error when changing my settings.php to my RDS host name:
PDOException: SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'name.rds.amazonaws.com' (4) in lock_may_be_available() (line 167 of /var/www/html/includes/lock.inc).

Please let me know if you need anymore information.

Thanks,

Comments

John_B’s picture

You do not mention which documentation you followed in creating your database. I am assuming you know how to do Drupal multi-site (so we are not using sites/default/settings.php to define the db connection) and that you know to create a database on RDS (which is said to be easy: I have not done it), and have done it correctly.

Now you need to check that your web server can connect to the database, and that you are using the correct port (which for multi-site you can specify in sites/domain.com/settings.php) and that connection to the db is not blocked by a firewall or something of that kind. I would log into the web server where your Drupal site is and try to connect to the server from command line first. So try something like
mysql --host=name.rds.amazonaws.com --port=3306 and see what happens. If it does not work, maybe talk to Amazon support.

I cannot imagine why any novice would take on the complexities of Amazon, unless you mean you are a Drupal novice and a seasoned sysadmin.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

lgalan90’s picture

First, I want to mention that I am working on building one site, at the moment, that points to an RDS holding multiple Schemas. I am doing this so that I may run it successfully and then add the rest of my sites thereafter. I tried doing them all at once but it was frustrating and so I've decided to start simple and work my way up.

Here is the documentation I used to create the drupal site:
http://www.thingaweek.com/how-install-drupal-amazon-ec2

To answer your assumptions, no, I have never created a multi-site Drupal setup and yes, I do know how to create an RDS on AWS but I would say that I am not greatly familiar with this service either. I am fairly new to both Drupal and AWS, with about a month of experience on both but I do document thoroughly and most of the issues I usually come across have been archived within Google.

My setting.php is set up like the example below for all of the sites:
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'RDS DB Name',
'username' => 'RDS DB UserName',
'password' => 'RDS DB PW',
'host' => 'name.rds.amazonaws.com',
'port' => '3306',
'driver' => 'mysql',
'prefix' => '',
),
),
);

My idea was that they should all point to the DB that is holding the Schemas they should be receiving the data from, the problem is I haven't found a way to point each settings.php to each one of the Schemas the DB is holding but rather the DB that is holding the Schemas.

Please let me know if you need anymore information.

Thanks!

John_B’s picture

Well it still comes down to one simple point as set out in your first post: your web server cannot connect to your RDS. So I would go back to my suggestion of checking whether you can connect from command line, and if not, raising the issue withe Aamazon support. Amazon is an expensive service and high quality support is partly what you are paying for.

That aside, multi-site is very controversial in the Drupal world. Those heavily invested in the Aegir server setup (google it!) are big fans of it. I belong to the camp which thinks that in 90% of cases it is a massive PITA.

Still one has to try things out. One has to try Amazon (which is undoubtedly a sensible option for site where the site owner has the funds to hire a full-time sysadmin), and one has to try Drupal mutli-site (which has its supporters) in order to know whether they are indeed efficient ways of getting where you want to be.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors