#2984 Add CNames for each application's db and update configs
Closed: Fixed None Opened 12 years ago by toshio.

This should be an EasyFix for someone with a little dns experience. We have many web applications accessing db01 and db02 for their data. This change is to accomplish two things:

  1. Make the naming of database servers be by function, rather than a generic "db". This will make it easier to see what needs to move later.
  2. Lay the groundwork for splitting the databases to different hardware depending on their function.

What we need is for someone to edit the DNS entries for db01(postgres) and db05(mysql) (In production. In stg, they're both on db02) to add CNAMES for the apps that are on there. At the same time, they need to update the application's config files to point at the new DNS name for the db server. As an example,

PackageDB accesses the postgres db on db01 for it's data. So we need to add a CNAME for db-pkgdb that points to the db01 box. The pkgdb config files in puppet/modules/fedora-packagedb/templates/pkgdb-prod.cfg.erb would get updated at the same time so that the dburi line would point to:
{{{
-sqlalchemy.dburi="postgres://pkgdbadmin:<%= pkgdbPassword %>@db01/pkgdb"
+sqlalchemy.dburi="postgres://pkgdbadmin:<%= pkgdbPassword %>@db-pkgdb/pkgdb"
}}}

Notes:
* When you switch FAS, be sure to grep through puppet for other places that directly connect to the database. I think that the only other place is with http basic auth (for instance, trac on fedorahosted) which uses mod_auth_postgres.
* Naming convention for these will be db-APPNAME (no need for numbers as we're unlikely to ever have multiple db masters for an app).
* If we implement slave db servers, they'll get the name db-APPNAME-slave.
* If we have to replace a db box, we name it something temporary like db-APPNAME-new. When we're ready to switch, we take an outage (necessary to sync final copies of data anyhow) and change the names in DNS.


The bodhi and elections applications have been updated to use db-bodhi and db-elections.

Hi wsterling, I dug a little about the ticket and I'm willing to help if you have some use for an apprentice. Just point me in the right direction and I go fetch;) Anyway, I greped thru puppet/modules and found smolt still using db05; fas2, ykksm, ykval, fedoracommunity_(feed|stats)_cache, raffle, pkgdb, mirrormanager using db01. I also found relevant DNS config at puppet/modules/bind/files/master.

Hi wsterling, i'm also eager and willing to help out with this if the systems mentioned by jacibato haven't already been fixed. Outside of that, are there any configs not in puppet that need updating?

FAS and yubikeys were updated on 12/15/2011 to use the CNAMEs.

fedoracommunity has been updated to use db-community

Migrated Mirrormanager on 1/5/2012

Reviewboard configuration points to localhost. I'm going to leave it as is for now.

yubikey has been migrated to use db-ykksm and db-ykval

How many of these are left... ?

Is there still work to be done?

From what I can tell, there's only 2 things left:

ask

and

datanommer

If we get those last 2 we are done. ;)

I think that ask and datanommer are done.

In dns/master/phx2.fedoraproject.org there is the line:

db-ask IN CNAME db01

And in /modules/askbot/templates/settings.erb there is line:

DATABASE_HOST = 'db-ask'

There is no line in dns like:

db-datanommer IN CNAME db01

But there is this line in /modules/datanommer/templates/datanommer-alembic.ini.erb and in datanommer-consumer-conf.py.erb:

sqlalchemy.url = postgresql://<%= datanommerDBUser %>:<%= datanommerDBPassword %>@db-datanommer/datanommer

Which suggests that datanommer is also done.

I'm not 100% sure but I think that this ticket can be closed.

cool. Thanks for looking into it.

Login to comment on this ticket.

Metadata