Bug 1032459

Summary: oo-install append superfluous mongo port when setting MONGO_HOST_PORT.
Product: OpenShift Container Platform Reporter: Johnny Liu <jialiu>
Component: NodeAssignee: Luke Meyer <lmeyer>
Status: CLOSED ERRATA QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.0.0CC: libra-onpremise-devel
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-15 14:40:55 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 Johnny Liu 2013-11-20 09:14:46 UTC
Description of problem:
Using oo-install to setup env with build roles on different vms, after installation is finished, found MONGO_HOST_PORT is set to wrong value.
MONGO_HOST_PORT="db.my-ose.com.cn:27017:27017"

Seen from /tmp/openshift-deploy-prepare.log, get the following message.
+ datastore_replicants=db.my-ose.com.cn:27017
++ echo db.my-ose.com.cn:27017
++ sed -e 's/\([^:,]\+\)\(,\|$\)/\1:27017\2/g'
+ datastore_replicants=db.my-ose.com.cn:27017:27017

Seem oo-install append superfluous mongo port for datastore_replicants


Version-Release number of selected component (if applicable):
oo-install-20131119-1827

How reproducible:
Always

Steps to Reproduce:
1. Run oo-install
Host Information
+----------------+-------------+
| Host           | bb          |
| Roles          | Broker      |
| SSH Host       | 10.4.59.184 |
| User           | root        |
| IP Addr        | 10.4.59.184 |
| Install Status | new         |
+----------------+-------------+
+----------------+----------------+
| Host           | msg            |
| Roles          | MsgServer      |
| SSH Host       | 10.4.59.138    |
| User           | root           |
| IP Addr        | 192.168.59.140 |
| Install Status | new            |
+----------------+----------------+
+----------------+----------------+
| Host           | db             |
| Roles          | DBServer       |
| SSH Host       | 10.4.59.142    |
| User           | root           |
| IP Addr        | 192.168.59.135 |
| Install Status | new            |
+----------------+----------------+
+----------------+-------------+
| Host           | node        |
| Roles          | Node        |
| SSH Host       | 10.4.59.188 |
| User           | root        |
| IP Addr        | 10.4.59.188 |
| Install Status | new         |
+----------------+-------------+

2. After installation finished, check broker.conf
3.

Actual results:
MONGO_HOST_PORT="db.my-ose.com.cn:27017:27017"

Expected results:
MONGO_HOST_PORT="db.my-ose.com.cn:27017"

Additional info:

Comment 2 Luke Meyer 2013-12-23 20:37:35 UTC
This was a bug in openshift.sh which should now be fixed. Please give it another try.

Comment 3 Johnny Liu 2013-12-27 10:56:46 UTC
Verified this bug with oo-install-ose-20131220-1511, and PASS.


In /tmp/openshift-deploy.log, could see the following logic:
+ datastore_replicants=db.my-ose.com.cn:27017
++ for repl in '${datastore_replicants//,/ }'
++ [[ db.my-ose.com.cn:27017 =~ : ]]
++ printf ,%s db.my-ose.com.cn:27017
+ datastore_replicants=,db.my-ose.com.cn:27017
+ datastore_replicants=db.my-ose.com.cn:27017


# grep MONGO_HOST_PORT /etc/openshift/broker.conf
# Eg: MONGO_HOST_PORT="<host1:port1>,<host2:port2>..."
MONGO_HOST_PORT="db.my-ose.com.cn:27017"