基于本指南:
https://docs.opsmanager.mongodb.com/current/tutorial/install-simple-test-deployment/
我正在尝试在OpenShift中运行MongoDB和MongoDB Ops Manager。我已经对MongoDB和MongoDB Ops Manager进行了 dockerize 的操作,并且MongoDB在端口27017和所有接口上成功侦听了>
# network interfaces
net:
port: 27017
bindIp: 0.0.0.0
我还设法使MongoDB Ops Manager 已初始化,这意味着以下步骤已成功完成(包括连接到我的mongodb实例):
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 ]
但随后突然失败:
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 ed64653d5f@on-prem-4.0 in: 51476 (ms)
command terminated with non-zero exit code: Error executing in Docker Container: 137
并启用DEBUG级别的其他日志记录:
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
但是对于导致Docker容器终止的原因没有太多帮助。
任何想法可能是什么原因造成的?
请注意,在我的本地ubuntu盒(具有8 GB RAM的计算机)上使用普通docker时,它可以正常工作。
编辑:
基于以下建议,我还尝试在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
但结果仍然相同。
还有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"]
和run.sh
是:
#!/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
/ opt / configmap中的文件是从configmap挂载的。
答案 0 :(得分:2)
我认为您最好将文档遵循Install MongoDB Enterprise Kubernetes Operator,然后再跟踪Install MongoDB via Kubernetes。
这是在OpenShift内安装的更现代且首选的方法。这应该解决您问题中概述的大多数复杂性。
答案 1 :(得分:1)
由于尚未编写有关如何在OpenShift中成功进行dockerize和部署Mongo Ops Manager的建议/答案,因此到目前为止,唯一的解决方案似乎是唯一的解决方案,例如: >
https://docs.opsmanager.mongodb.com/current/tutorial/install-simple-test-deployment/