Bug 772152 - mysql DB IP is changed after move this app from one node to another node.
Summary: mysql DB IP is changed after move this app from one node to another node.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OKD
Classification: Red Hat
Component: Pod
Version: 1.x
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Krishna Raman
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-06 07:33 UTC by Johnny Liu
Modified: 2014-06-18 07:24 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-06 14:48:41 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Johnny Liu 2012-01-06 07:33:51 UTC
Description of problem:
mysql DB IP is changed after move this app from one node to another node.
mysql DB IP is often used in user's app, if this IP is changed after rhc-admin-move, that means user's app with mysql embedded will can not be connected.

Version-Release number of selected component (if applicable):
rhc-broker-0.84.28-1.el6_2.noarch

How reproducible:
Always

Steps to Reproduce:
1. Setup a mutli node env
2. Create an app with mysql embeded.
3. In this app, use mysql DB IP got from embed mysql operation output as hard code for db connection.
e.g: here is an example of php app
----<snip>----
  if ($action_name == "create"){
    $con=mysql_connect("127.0.250.1","admin","gb1epCRi3ewm") or die(mysql_error());
    mysql_select_db("myapp",$con);
    mysql_query("DROP TABLE IF EXISTS ucctalk",$con);
    mysql_query("CREATE TABLE ucctalk (speaker CHAR(30), title CHAR(60))",$con);
    mysql_query("INSERT INTO ucctalk (speaker,title) VALUES ('speaker1', 'title1')",$con);
    $result=mysql_query("SELECT * FROM ucctalk",$con);
    while($row=mysql_fetch_array($result)) {
      echo $row['speaker'],", ",$row['title'],"\n";
    }
    mysql_close($con);
----<snip>----
3. Log into libra server, run "rhc-admin-move" command to move this app from
one node to another node.
4. Access this app again to access DB, found DB connection failed.
5. Run rhc-user-info command, found mysql DB IP address is changed.

  
Actual results:
After run "rhc-admin-move" command to move this app from
one node to another node, user's app failed to access.

Expected results:
move operation on server side should be transparent, no any affect for user's app.

Additional info:

Comment 1 Johnny Liu 2012-01-06 07:48:03 UTC
Of course, if app is using OPENSHIFT_DB_XX env variable, this issue not critical. But if user is using DB IP as hard code, it will be risky, because user is unable to notice DB IP's change. So it is better to keep the same DB IP address. I guess before move app on server side, to check if this DB IP is occupied in destination node is necessary.

Comment 2 Dan McPherson 2012-01-06 14:48:41 UTC
This is as designed and necessary.  Once we move to using districts this will no longer happen regularly but will have to happen at least once to get to districts.


Note You need to log in before you can comment on or make changes to this bug.