Bug 971296

Summary: Connection url for mysql cartridges in app is not correct
Product: OpenShift Online Reporter: chunchen <chunchen>
Component: ContainersAssignee: Dan Mace <dmace>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: dmace, wsun
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-11 04:18:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description chunchen 2013-06-06 08:39:26 UTC
Description of problem:
When adding mysql cartridge to an app, the gear's ip address is displayed instead of the dns. For a scaled app, we can only connect to db cartridge with ip and port from the standalone db gear, on the haproxy gear, we have to connect via the gear dns and port.
So this problem can cause confusion and misunderstanding to end users.

Version-Release number of selected component (if applicable):
denvenv_3324

How reproducible:
always

Steps to Reproduce:
1. Create an app
rhc app create cphp0s0 php-5.3 --no-git --scaling
2. Add mysql to this app
rhc cartridge add mysql-5.1 -a cphp0s0
Actual results:
Adding mysql-5.1 to application 'cphp0s0' ... Success
<-------------snip--------------->
RESULT:
Added mysql-5.1 to application cphp0s0
Embedded app details: Connection URL: mysql://127.1.24.130:3306
<-------------sinp--------------->

Expected results:
the connection url should use environment variable instead of ip address,like "mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/"

Additional info:

Comment 2 openshift-github-bot 2013-06-07 21:13:46 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/49b6176e830a8de6d1d72b7fc8d1e90aa3f69b88
Bug 971296: Display mysql environment variables rather than IPs during install

Comment 3 chunchen 2013-06-08 02:13:06 UTC
It's fixed, verified on devenv_3334, please refer to the following results:

[root test]# rhc cartridge add mysql-5.1 -a cphp0s0
Adding mysql-5.1 to application 'cphp0s0' ... Success

mysql-5.1 (MySQL Database 5.1)
------------------------------
  Gears:          1 small
  Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/
  Database Name:  cphp0s0
  Password:       3yIWdCjBEqGj
  Username:       adminct48ntZ

RESULT:
Added mysql-5.1 to application cphp0s0
Embedded app details: Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT

MySQL 5.1 database added.  Please make note of these credentials:
       Root User: adminct48ntZ
   Root Password: 3yIWdCjBEqGj
   Database Name: cphp0s0
Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/
You can manage your new MySQL database by also embedding phpmyadmin-3.4.
The phpmyadmin username and password will be the same as the MySQL credentials above.