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

Expose replica/slave DB connection info #1156

Open
iamEAP opened this issue Aug 25, 2016 · 1 comment
Open

Expose replica/slave DB connection info #1156

iamEAP opened this issue Aug 25, 2016 · 1 comment

Comments

@iamEAP
Copy link
Contributor

iamEAP commented Aug 25, 2016

I've got a use-case where I'd like to have programmatic access to replica database connection details: tableau-mkt/pantheon-mysql-proxy#4.

In an ideal world, if a replica is enabled for a site/environment, it would just show up as another field (or fields) in the terminus site connection-info command, for example:

# Would print details to the slave DB
terminus site connection-info --site=$PSITE --env=live --field="mysql_slave_command"
# Would include info/keys for the replica
terminus site connection-info --site=$PSITE --env=live
+----------------------+-------------------------------------------------------------------------------------------+
| Key                  | Value                                                                                     |
+----------------------+-------------------------------------------------------------------------------------------+
| Mysql Host           | dbserver.live.UUID.drush.in                                                               |
| Mysql Username       | pantheon                                                                                  |
| Mysql Password       | b4tt3ryh0rs3st@pl3                                                                        |
| Mysql Port           | 13370                                                                                     |
| Mysql Database       | pantheon                                                                                  |
| Mysql Url            | mysql://pantheon:{uuid}@dbserver.live.{uuid}.drush.in:13370/pantheon                      |
| Mysql Command        | mysql -u pantheon -pb4tt3ryh0rs3st@pl3 -h dbserver.live.{uuid}.drush.in -P 13370 pantheon |
| Mysql Slave Host     | 111.111.111.111                                                                           |
| Mysql Slave Username | pantheon                                                                                  |
| Mysql Slave Password | b4tt3ryh0rs3st@pl3                                                                        |
| Mysql Slave Port     | 13371                                                                                     |
| Mysql Slave Database | pantheon                                                                                  |
| Mysql Slave Url      | mysql://pantheon:111.111.111.111:13371/pantheon                                           |
| Mysql Slave Command  | mysql -u pantheon -pb4tt3ryh0rs3st@pl3 -h 111.111.111.111 -P 13371 pantheon               |
+----------------+-------------------------------------------------------------------------------------------------+

Is there appetite to have this included in terminus core, or would you recommend getting at this via a plugin?

@iamEAP
Copy link
Contributor Author

iamEAP commented Nov 19, 2016

I built this out as a plugin here: https://github.com/tableau-mkt/terminus-replica

@TeslaDethray TeslaDethray modified the milestones: 1.0.0, 1.0.1 Jan 18, 2017
@TeslaDethray TeslaDethray modified the milestone: 1.1.0 Mar 15, 2017
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

2 participants