Reputation: 16329
Based on this guide:
https://docs.opsmanager.mongodb.com/current/tutorial/install-simple-test-deployment/
I am trying to run MongoDB and MongoDB Ops Manager in OpenShift. I have manged to dockerize both MongoDB and MongoDB Ops Manager and MongoDB is running successfully listening on port 27017 and on all interfaces:
# network interfaces
net:
port: 27017
bindIp: 0.0.0.0
I also manage to get MongoDB Ops Manager initialized meaning the below steps complete successfully (including connecting to my mongodb instance):
Generating new Ops Manager private key...
Starting pre-flight checks
Successfully finished pre-flight checks
Migrate Ops Manager data
Running migrations...[ OK ]
Start Ops Manager server
Instance 0 starting..................[ OK ]
tput: No value for $TERM and no -T specified
Starting pre-flight checks
Successfully finished pre-flight checks
Start Backup Daemon...[ OK ]
but then it suddenly fails with:
tail -f /opt/mongodb/mms/logs/mms0.log
...
2019-04-25T14:30:42.616+0000 [main] INFO com.xgen.svc.mms.svc.ping.PingRequest$Observable [Observable.java.addObserver:19] - Registering observer: class com.xgen.svc.mms.svc.ping.TotalStorageCacheSvc
2019-04-25T14:30:42.618+0000 [main] INFO com.xgen.svc.mms.svc.ping.PingRequest$Observable [Observable.java.addObserver:19] - Registering observer: class com.xgen.svc.mms.svc.ping.NDSAutoScalingIngestionSvc
2019-04-25T14:31:00.536+0000 [main] INFO com.xgen.svc.core.ServerMain [ServerMain.java.setUpProxyServer:620] - Started queryable backup proxy server on port 25999
2019-04-25T14:31:00.537+0000 [ProxyServer-25999] INFO backup.jobs.queryable.ProxyServer.25999 [ProxyServer.java.run:96] - Waiting for Proxy Server PEM File to be specified in the configuration
2019-04-25T14:31:00.559+0000 [main] INFO com.xgen.svc.core.ServerMain [ServerMain.java.start:537] - Started mms at build [email protected] in: 51476 (ms)
command terminated with non-zero exit code: Error executing in Docker Container: 137
And with additional logging with DEBUG level enabled:
2019-04-27T13:46:35.035+0000 [job-consumer-214366356] DEBUG org.mongodb.driver.protocol.command [SLF4JLogger.java.debug:56] - Sending command {findandmodify : BsonString{value='data.jobsProcessor'}} to database mmsdbjobs on connection [connectionId{localValue:13, serverValue:31}] to server mongo-db:27017
2019-04-27T13:46:35.036+0000 [job-consumer-214366356] DEBUG org.mongodb.driver.protocol.command [SLF4JLogger.java.debug:56] - Command execution completed
2019-04-27T13:46:35.476+0000 [mms_QuartzSchedulerThread] DEBUG org.quartz.simpl.PropertySettingJobFactory [SimpleJobFactory.java.newJob:51] - Producing instance of Job 'DEFAULT.dbRollupSchedulerJob', class=com.xgen.svc.core.svc.cron.SimpleJob
2019-04-27T13:46:35.477+0000 [mms_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread [QuartzSchedulerThread.java.run:291] - batch acquisition of 1 triggers
2019-04-27T13:46:35.477+0000 [mms_Worker-31] DEBUG org.quartz.core.JobRunShell [JobRunShell.java.run:201] - Calling execute on job DEFAULT.dbRollupSchedulerJob
2019-04-27T13:46:35.478+0000 [mms_Worker-31] DEBUG org.mongodb.driver.protocol.command [SLF4JLogger.java.debug:56] - Sending command {count : BsonString{value='config.customers'}} todatabase mmsdbconfig on connection [connectionId{localValue:13, serverValue:31}] to server mongo-db:27017
2019-04-27T13:46:35.480+0000 [mms_Worker-31] DEBUG org.mongodb.driver.protocol.command [SLF4JLogger.java.debug:56] - Command execution completed
2019-04-27T13:46:35.481+0000 [mms_Worker-31] DEBUG com.xgen.svc.core.svc.cron.CronJob [CronJob.java.canProceed:47] - Not proceeding with CronJob dbRollupScheduler. No Projects.
command terminated with non-zero exit code: Error executing in Docker Container: 137
But not much of help to what is causing this termination of the docker container.
Any ideas what might be causing this?
Notice it works fine when using plain docker on my local ubuntu box (machine having 8 GB RAM).
EDIT:
Based on below suggestion I have also tried to set the following resources in the deployment config for the Mongo Manager:
kind: DeploymentConfig
metadata:
name: ${NAME}
spec:
replicas: 1
selector:
app: ${NAME}
strategy:
type: Recreate
...
containers:
- name: ${NAME}
image: ${IMAGE}
ports:
- containerPort: 8080
resources:
limits:
cpu: 8
memory: 15Gi
requests:
cpu: 8
memory: 15Gi
But still same result.
And the Dockerfile
FROM centos:latest
RUN yum update -y && \
yum install -y openssl iproute nano net-tools
COPY run.sh /
RUN chmod 750 /run.sh
ENTRYPOINT ["/run.sh"]
and run.sh
is:
#!/bin/bash
export TERM="xterm"
curl -k https://downloads.mongodb.com/on-prem-mms/rpm/mongodb-mms-4.0.10.50461.20190403T1841Z-1.x86_64.rpm -o tmp/mongodb-mms-4.0.10.50461.20190403T1841Z-1.x86_64.rpm
cd /tmp \
&& rpm -ivh mongodb-mms-4.0.10.50461.20190403T1841Z-1.x86_64.rpm \
&& rm mongodb-mms-4.0.10.50461.20190403T1841Z-1.x86_64.rpm
cp /opt/configmap/conf-mms/conf-mms.properties /opt/mongodb/mms/conf/
cp /opt/configmap/mms/mms.conf /opt/mongodb/mms/conf/
cp /opt/configmap/logback/logback.xml /opt/mongodb/mms/conf/
chown -R mongodb-mms:mongodb-mms /opt/mongodb/mms/
/bin/bash /opt/mongodb/mms/bin/mongodb-mms start
Where files in /opt/configmap are mounted from configmaps.
Upvotes: 5
Views: 3832
Reputation: 16329
Since no suggestions/answers have been written on how to successfully dockerize and deploy Mongo Ops Manager in OpenShift doing a plain non container installation seems to be the only solution as of now, e.g.:
https://docs.opsmanager.mongodb.com/current/tutorial/install-simple-test-deployment/
Upvotes: 1
Reputation: 9695
I think you'd be better off following the docs to Install MongoDB Enterprise Kubernetes Operator and then Install MongoDB via Kubernetes.
It's the more modern and preferred method to install inside OpenShift. This should take care of most of the complexity outlined in your question.
Upvotes: 2