Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure容器实例中的MongoDb在一段时间后失败_Mongodb_Docker_Azure Container Instances - Fatal编程技术网

Azure容器实例中的MongoDb在一段时间后失败

Azure容器实例中的MongoDb在一段时间后失败,mongodb,docker,azure-container-instances,Mongodb,Docker,Azure Container Instances,我在Azure容器实例中运行mongoDB。DB持续运行,并且还可以,但发生了两次容器处于失败状态。故障状态发生在一个月的时间范围内。这是我的文件: FROM ubuntu:xenial # Update the repository sources list RUN apt-get update && apt-get install -y wget gnupg apt-transport-https ca-certificates vim #Import GPG Key

我在Azure容器实例中运行mongoDB。DB持续运行,并且还可以,但发生了两次容器处于失败状态。故障状态发生在一个月的时间范围内。这是我的文件:

FROM ubuntu:xenial

# Update the repository sources list
RUN apt-get update && apt-get install -y wget gnupg apt-transport-https ca-certificates vim 

#Import GPG Key from https://www.mongodb.org/static/pgp/server-4.2.asc:
RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add -

#Create a list file /etc/apt/sources.list.d/mongodb-org-4.2.list for MongoDB
RUN echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse" |  tee /etc/apt/sources.list.d/mongodb-org-4.2.list

#Install the latest stable version of MongoDB
RUN apt-get update && apt-get install -y mongodb-org 
RUN mkdir -p /data/db

# Expose the default port
EXPOSE 27017

CMD ["--port 27017", "--smallfiles"]

# Set default container command and overwrite default address 127.0.0.1 with 0.0.0.0
ENTRYPOINT usr/bin/mongod --bind_ip 0.0.0.0
这是来自mongoDb的日志跟踪:

ing data from the last clean checkpoint.
2020-07-29T12:27:25.654+0000 I  STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=256M,cache_overflow=(file_max=0M),session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress],
2020-07-29T12:27:28.207+0000 I  STORAGE  [initandlisten] WiredTiger message [1596025648:207010][7:0x7fdd6c925b40], txn-recover: Recovering log 81 through 82
2020-07-29T12:27:29.486+0000 I  STORAGE  [initandlisten] WiredTiger message [1596025649:486068][7:0x7fdd6c925b40], txn-recover: Recovering log 82 through 82
2020-07-29T12:27:30.769+0000 I  STORAGE  [initandlisten] WiredTiger message [1596025650:769360][7:0x7fdd6c925b40], txn-recover: Main recovery loop: starting at 81/19968 to 82/256
2020-07-29T12:27:32.214+0000 I  STORAGE  [initandlisten] WiredTiger message [1596025652:214855][7:0x7fdd6c925b40], txn-recover: Recovering log 81 through 82
2020-07-29T12:27:33.546+0000 I  STORAGE  [initandlisten] WiredTiger message [1596025653:546929][7:0x7fdd6c925b40], txn-recover: Recovering log 82 through 82
2020-07-29T12:27:33.599+0000 I  STORAGE  [initandlisten] WiredTiger message [1596025653:599411][7:0x7fdd6c925b40], txn-recover: Set global recovery timestamp: (0, 0)
2020-07-29T12:27:33.833+0000 I  RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2020-07-29T12:27:34.222+0000 I  STORAGE  [initandlisten] Timestamp monitor starting
2020-07-29T12:27:34.376+0000 I  CONTROL  [initandlisten]
2020-07-29T12:27:34.376+0000 I  CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2020-07-29T12:27:34.376+0000 I  CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2020-07-29T12:27:34.376+0000 I  CONTROL  [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2020-07-29T12:27:34.376+0000 I  CONTROL  [initandlisten]
2020-07-29T12:27:34.376+0000 I  CONTROL  [initandlisten]
2020-07-29T12:27:34.376+0000 I  CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2020-07-29T12:27:34.376+0000 I  CONTROL  [initandlisten] **        We suggest setting it to 'never'
2020-07-29T12:27:34.376+0000 I  CONTROL  [initandlisten]
2020-07-29T12:27:34.567+0000 I  SHARDING [initandlisten] Marking collection local.system.replset as collection version: <unsharded>
2020-07-29T12:27:35.064+0000 I  STORAGE  [initandlisten] Flow Control is enabled on this deployment.
2020-07-29T12:27:35.064+0000 I  SHARDING [initandlisten] Marking collection admin.system.roles as collection version: <unsharded>
2020-07-29T12:27:35.064+0000 I  SHARDING [initandlisten] Marking collection admin.system.version as collection version: <unsharded>
2020-07-29T12:27:35.350+0000 I  SHARDING [initandlisten] Marking collection local.startup_log as collection version: <unsharded>
2020-07-29T12:27:35.351+0000 I  FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2020-07-29T12:27:35.353+0000 I  SHARDING [LogicalSessionCacheRefresh] Marking collection config.system.sessions as collection version: <unsharded>
2020-07-29T12:27:35.353+0000 I  SHARDING [LogicalSessionCacheReap] Marking collection config.transactions as collection version: <unsharded>
2020-07-29T12:27:35.353+0000 I  NETWORK  [listener] Listening on /tmp/mongodb-27017.sock
2020-07-29T12:27:35.353+0000 I  NETWORK  [listener] Listening on 0.0.0.0
2020-07-29T12:27:35.353+0000 I  NETWORK  [listener] waiting for connections on port 27017
2020-07-29T12:27:36.167+0000 I  FTDC     [ftdc] Unclean full-time diagnostic data capture shutdown detected, found interim file, some metrics may have been lost. OK
2020-07-29T12:27:36.865+0000 I  SHARDING [ftdc] Marking collection local.oplog.rs as collection version: <unsharded>
正在从最后一个干净的检查点删除数据。
2020-07-29T12:27:25.654+0000 I存储[initandlisten]wiredtiger\u打开配置:创建,缓存大小=256M,缓存溢出=(文件最大=0M),会话最大=33000,逐出=(线程最小=4,线程最大=4),配置基本=false,统计=(快速),日志=(启用=true,存档=true,路径=journal,压缩=snappy),文件管理器=(关闭\u空闲\u时间=100000,关闭\u扫描\u间隔=10,关闭\u句柄\u最小值=250),统计\u日志=(等待=0),详细=[恢复\u进度,检查点\u进度],
2020-07-29T12:27:28.207+0000 I存储[initandlisten]有线数据记录器消息[1596025648:207010][7:0x7fdd6c925b40],txn恢复:恢复日志81到82
2020-07-29T12:27:29.486+0000 I存储[initandlisten]有线数据记录器消息[1596025649:486068][7:0x7fdd6c925b40],txn恢复:恢复日志82到82
2020-07-29T12:27:30.769+0000 I存储[initandlisten]有线数据记录器消息[1596025650:769360][7:0x7fdd6c925b40],txn恢复:主恢复循环:从1996年8月81日开始到2006年8月82日
2020-07-29T12:27:32.214+0000 I存储[initandlisten]有线数据记录器消息[1596025652:214855][7:0x7fdd6c925b40],txn恢复:恢复日志81到82
2020-07-29T12:27:33.546+0000 I存储[initandlisten]有线数据记录器消息[1596025653:546929][7:0x7fdd6c925b40],txn恢复:恢复日志82到82
2020-07-29T12:27:33.599+0000 I存储[initandlisten]有线数据记录器消息[1596025653:599411][7:0x7fdd6c925b40],txn恢复:设置全局恢复时间戳:(0,0)
2020-07-29T12:27:33.833+0000 I恢复[initandlisten]WiredTiger recoveryTimestamp.Ts:时间戳(0,0)
2020-07-29T12:27:34.222+0000 I存储[initandlisten]时间戳监视器启动
2020-07-29T12:27:34.376+0000 I控制[initandlisten]
2020-07-29T12:27:34.376+0000 I控件[初始化侦听]**警告:未为数据库启用访问控制。
2020-07-29T12:27:34.376+0000 I控制[initandlisten]**对数据和配置的读写访问不受限制。
2020-07-29T12:27:34.376+0000 I控件[initandlisten]**警告:您正在以root用户身份运行此进程,不建议这样做。
2020-07-29T12:27:34.376+0000 I控制[initandlisten]
2020-07-29T12:27:34.376+0000 I控制[initandlisten]
2020-07-29T12:27:34.376+0000 I控件[initandlisten]**警告:/sys/kernel/mm/transparent\u hugepage/enabled为“始终”。
2020-07-29T12:27:34.376+0000 I CONTROL[initandlisten]**我们建议将其设置为“从不”
2020-07-29T12:27:34.376+0000 I控制[initandlisten]
2020-07-29T12:27:34.567+0000 I分片[initandlisten]将集合local.system.replset标记为集合版本:
2020-07-29T12:27:35.064+0000 I存储[initandlisten]流控制在此部署上启用。
2020-07-29T12:27:35.064+0000 I分片[initandlisten]将集合admin.system.roles标记为集合版本:
2020-07-29T12:27:35.064+0000 I分片[initandlisten]将collection admin.system.version标记为collection version:
2020-07-29T12:27:35.350+0000 I分片[initandlisten]将收集标记为本地启动日志为收集版本:
2020-07-29T12:27:35.351+0000 I FTDC[initandlisten]使用目录“/data/db/diagnostic.data”初始化全职诊断数据捕获
2020-07-29T12:27:35.353+0000 I分片[LogicalSessionCacheRefresh]将collection config.system.sessions标记为集合版本:
2020-07-29T12:27:35.353+0000 I分片[LogicalSessionCacheEaw]将集合配置事务标记为集合版本:
2020-07-29T12:27:35.353+0000 I网络[listener]监听/tmp/mongodb-27017.sock
2020-07-29T12:27:35.353+0000 I网络[侦听器]在0.0.0.0上侦听
2020-07-29T12:27:35.353+0000 I网络[侦听器]正在端口27017上等待连接
2020-07-29T12:27:36.167+0000 I FTDC[FTDC]检测到不干净的全职诊断数据捕获关闭,找到临时文件,某些指标可能已丢失。确定
2020-07-29T12:27:36.865+0000 I分片[ftdc]将collection local.oplog.rs标记为集合版本:
  • 我怎样才能修好它
  • 将生产数据库放在容器中到底有多好

  • 谢谢。

    我看不到您在此处共享的dockerfile中存在任何问题。但是,如果您对mongo的dockerfile有任何疑问,可以使用官方的mongodb dockerfile()


    为了实际解决问题,您需要了解容器到底发生了什么,并且需要日志。

    “必须在不中断的情况下运行”意味着您必须进行诊断。