Bug 1025469 - datastore directive does not install mongodb
datastore directive does not install mongodb
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Pod (Show other bugs)
2.0.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Luke Meyer
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-31 14:54 EDT by Eric Rich
Modified: 2017-03-08 12 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Previously the mongodb-server required mongodb. Now it does not. Consequence: We use the mongo client from mongodb to configure the server, so we do need it even if the host is just hosting mongodb. MongoDB configuration fails by hanging forever if the mongo client is not installed. Fix: The install script for OSE 2.0 explicitly installs mongodb at the same time as mongodb server. The same fix was put in the OSE 1.2 script and should go in the 1.2 docs as well; for now, it's not needed, but if we were to ship a mongodb-related errata against OSE 1.2 it would likely be this newer package and the same problem would arise. Result: The script installs the mongodb RPM as part of the datastore component and all proceeds successfully.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-16 04:11:19 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Eric Rich 2013-10-31 14:54:45 EDT
Description of problem:

When installing a services or broker services node, IE:

    CONF_INSTALL_COMPONENTS="activemq,datastore"

mongodb does not get installed and thus causes line 1230 to hang. Because it can not find mongo as a component. 

wait_for_mongod()
{
  echo "Waiting for MongoDB to start ($(date +%H:%M:%S))..."
  while :
  do
    echo exit | mongo && break       #### This line
    sleep 5
  done
  echo "MongoDB is ready! ($(date +%H:%M:%S))"
}
Comment 2 Luke Meyer 2013-10-31 18:11:50 EDT
Can you give some more details about what was done and what output you saw? The log from the installer would be helpful. (You did capture the output right?)

The openshift.sh install script won't even run that bit of code until after mongodb is successfully installed (well... unless there's a new bug of course). It's normal for it to have to wait a bit to actually connect. If it doesn't ever connect, then maybe mongodb didn't get started. That would be a problem.
Comment 3 Luke Meyer 2013-11-04 17:33:01 EST
I see now; mongodb-server no longer requires mongodb, so we need to explicitly install it. Probably a good idea to do for 1.2 as well. I'll update the script and mention it to docs.
Comment 4 Brenton Leanhardt 2013-11-06 15:39:48 EST
commit 665da22dd5789b0977afab0c9f3634bdc4f0b27c
Author: Luke Meyer <lmeyer@redhat.com>
Date:   Tue Nov 5 07:28:25 2013 -0500

    <install> explicitly require mongodb RPM for datastore
    
    Previously mongodb-server required mongodb. Now it does not. However we
    use the mongo client from mongodb to configure the server, so we do need
    it even if the host is just hosting mongodb.
Comment 5 Luke Meyer 2013-11-06 15:49:41 EST
Same fix put in 1.2 install script to future-proof it.
Comment 6 Ma xiaoqiang 2013-11-06 23:37:55 EST
wget https://raw.github.com/openshift/openshift-extras/enterprise-2.0/enterprise/install-scripts/generic/openshift.sh
#vim openshift.sh
CONF_INSTALL_COMPONENTS="datastore"
#sh +x openshift.sh

Output:
+ sleep 5
+ :
+ mongo
+ echo exit
MongoDB shell version: 2.4.6
connecting to: test
bye
+ break
++ date +%H:%M:%S
+ echo 'MongoDB is ready! (20:07:22)'
MongoDB is ready! (20:07:22)


wget https://raw.github.com/openshift/openshift-extras/enterprise-1.2/enterprise/install-scripts/generic/openshift.sh
#vim openshift.sh
CONF_INSTALL_COMPONENTS="activemq,datastore"
#sh +x openshift.sh

Output:
exception: connect failed
+ sleep 5
+ :
+ mongo
+ echo exit
MongoDB shell version: 2.2.3
connecting to: test
bye
+ break
++ date +%H:%M:%S
+ echo 'MongoDB is ready! (20:45:25)'
MongoDB is ready! (20:45:25)

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