- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
场景:我想从同一个docker-compose启动Mongo和Mongo-Express。
我没有从docker-compose仅启动mongodb的问题。当我尝试将Mongo-Express链接到Mongo DB Service时,会出现此问题。
我不确定是否在docker-compose或mongo-express settup中缺少某些配置。我不希望该问题成为Mongo安装的一部分。顺便说一句,我在下面粘贴了整个docker-compose及其输出。
从波纹管的日志中,我可以看出提高Mongo没有任何问题。 mongo-express尝试连接到Mongo服务时存在一些问题,可能是因为我没有正确设置链接。最重要的是,我的Spring Webflux通过波纹管已成功连接到Mongo DB。这个问题实际上仅限于mongo-express到达mongodb。
允许Spring数据(spring-boot-starter-data-mongodb-active)的application.yml成功连接到此类MongoDb
spring:
data:
mongodb:
host: 192.168.99.100
port: 27017
database: demodb
authentication-database: admin
username: root
password: rootpassword
version: '3.7'
services:
mongo-express:
image: mongo-express
ports:
- 8081:8081
environment:
ME_CONFIG_BASICAUTH_USERNAME: admin
ME_CONFIG_BASICAUTH_PASSWORD: q
ME_CONFIG_MONGODB_PORT: 27017
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: rootpassword
links:
- mongo-db
networks:
- mongo-compose-network
mongo-db:
image: mongo:latest
environment:
MONGO_INITDB_DATABASE: demodb
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: rootpassword
ports:
- "27017:27017"
volumes:
- mongodb_data_container:/data/db
networks:
- mongo-compose-network
networks:
mongo-compose-network:
driver: bridge
volumes:
mongodb_data_container:
PS C:\Dockers\mongodb\express> docker-compose up
Creating express_mongo_1 ... done Creating express_mongo-express_1 ... done Attaching to express_mongo_1, express_mongo-express_1
mongo_1 | 2020-03-18T21:49:37.366+0000 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
mongo_1 | 2020-03-18T21:49:37.370+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=8c1f22435085
mongo_1 | 2020-03-18T21:49:37.370+0000 I CONTROL [initandlisten] db version v4.2.3
mongo_1 | 2020-03-18T21:49:37.370+0000 I CONTROL [initandlisten] git version: 6874650b362138df74be53d366bbefc321ea32d4
mongo_1 | 2020-03-18T21:49:37.370+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
mongo_1 | 2020-03-18T21:49:37.370+0000 I CONTROL [initandlisten] allocator: tcmalloc
mongo_1 | 2020-03-18T21:49:37.370+0000 I CONTROL [initandlisten] modules: none
mongo-express_1 | Waiting for mongo:27017...
mongo_1 | 2020-03-18T21:49:37.370+0000 I CONTROL [initandlisten] build environment:
mongo_1 | 2020-03-18T21:49:37.371+0000 I CONTROL [initandlisten] distmod: ubuntu1804
mongo_1 | 2020-03-18T21:49:37.371+0000 I CONTROL [initandlisten] distarch: x86_64
mongo_1 | 2020-03-18T21:49:37.371+0000 I CONTROL [initandlisten] target_arch: x86_64
mongo_1 | 2020-03-18T21:49:37.371+0000 I CONTROL [initandlisten] options: { net: { bindIp: "*" }, security: { authorization: "enabled" } }
mongo-express_1 | /docker-entrypoint.sh: connect: Connection refused
mongo_1 | 2020-03-18T21:49:37.373+0000 I STORAGE [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
mongo_1 | 2020-03-18T21:49:37.373+0000 I STORAGE [initandlisten]
mongo_1 | 2020-03-18T21:49:37.373+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
mongo_1 | 2020-03-18T21:49:37.373+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
mongo_1 | 2020-03-18T21:49:37.374+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=486M,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],
mongo_1 | 2020-03-18T21:49:38.229+0000 I STORAGE [initandlisten] WiredTiger message [1584568178:229680][1:0x7f9df38f3b00], txn-recover: Recovering log 5 through 6
mongo_1 | 2020-03-18T21:49:38.261+0000 I STORAGE [initandlisten] WiredTiger message [1584568178:261407][1:0x7f9df38f3b00], txn-recover: Recovering log 6 through 6
mongo_1 | 2020-03-18T21:49:38.313+0000 I STORAGE [initandlisten] WiredTiger message [1584568178:313791][1:0x7f9df38f3b00], txn-recover: Main recovery loop: starting at 5/6144 to 6/256
mongo_1 | 2020-03-18T21:49:38.378+0000 I STORAGE [initandlisten] WiredTiger message [1584568178:378014][1:0x7f9df38f3b00], txn-recover: Recovering log 5 through 6
mongo_1 | 2020-03-18T21:49:38.448+0000 I STORAGE [initandlisten] WiredTiger message [1584568178:448927][1:0x7f9df38f3b00], txn-recover: Recovering log 6 through 6
mongo_1 | 2020-03-18T21:49:38.480+0000 I STORAGE [initandlisten] WiredTiger message [1584568178:480668][1:0x7f9df38f3b00], txn-recover: Set global recovery timestamp: (0, 0)
mongo_1 | 2020-03-18T21:49:38.505+0000 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
mongo_1 | 2020-03-18T21:49:38.519+0000 I STORAGE [initandlisten] Timestamp monitor starting
mongo_1 | 2020-03-18T21:49:38.530+0000 I SHARDING [initandlisten] Marking collection local.system.replset as collection version: <unsharded>
mongo_1 | 2020-03-18T21:49:38.535+0000 I STORAGE [initandlisten] Flow Control is enabled on this deployment.
mongo_1 | 2020-03-18T21:49:38.535+0000 I SHARDING [initandlisten] Marking collection admin.system.roles as collection version: <unsharded>
mongo_1 | 2020-03-18T21:49:38.536+0000 I SHARDING [initandlisten] Marking collection admin.system.version as collection version: <unsharded>
mongo_1 | 2020-03-18T21:49:38.541+0000 I SHARDING [initandlisten] Marking collection local.startup_log as collection version: <unsharded>
mongo_1 | 2020-03-18T21:49:38.542+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
mongo_1 | 2020-03-18T21:49:38.544+0000 I SHARDING [LogicalSessionCacheRefresh] Marking collection config.system.sessions as collection version: <unsharded>
mongo_1 | 2020-03-18T21:49:38.545+0000 I SHARDING [LogicalSessionCacheReap] Marking collection config.transactions as collection version: <unsharded>
mongo_1 | 2020-03-18T21:49:38.546+0000 I NETWORK [listener] Listening on /tmp/mongodb-27017.sock
mongo_1 | 2020-03-18T21:49:38.546+0000 I NETWORK [listener] Listening on 0.0.0.0
mongo-express_1 | /docker-entrypoint.sh: line 14: /dev/tcp/mongo/27017: Connection refused
mongo_1 | 2020-03-18T21:49:38.546+0000 I NETWORK [listener] waiting for connections on port 27017
mongo_1 | 2020-03-18T21:49:38.863+0000 I NETWORK [listener] connection accepted from 172.22.0.3:53802 #1 (1 connection now open)
mongo_1 | 2020-03-18T21:49:38.864+0000 I NETWORK [conn1] end connection 172.22.0.3:53802 (0 connections now open)
mongo-express_1 | Wed Mar 18 21:49:38 UTC 2020 retrying to connect to mongo:27017 (2/5)
mongo-express_1 | Welcome to mongo-express
mongo-express_1 | ------------------------
mongo-express_1 |
mongo-express_1 |
mongo-express_1 | Mongo Express server listening at http://0.0.0.0:8081
mongo_1 | 2020-03-18T21:49:39.000+0000 I SHARDING [ftdc] Marking collection local.oplog.rs as collection version: <unsharded>
mongo_1 | 2020-03-18T21:49:39.338+0000 I NETWORK [listener] connection accepted from 172.22.0.3:53804 #2 (1 connection now open)
mongo-express_1 | Server is open to allow connections from anyone (0.0.0.0)
mongo_1 | 2020-03-18T21:49:39.344+0000 I NETWORK [conn2] received client metadata from 172.22.0.3:53804 conn2: { driver: { name: "nodejs", version: "2.2.24" }, os: { type: "Linux", name: "linux", architecture: "x64", version: "4.14.154-boot2docker" }, platform: "Node.js v12.16.1, LE, mongodb-core: 2.1.8" }
mongo_1 | 2020-03-18T21:49:39.350+0000 I SHARDING [conn2] Marking collection admin.system.users as collection version: <unsharded>
mongo-express_1 | Database connected
mongo_1 | 2020-03-18T21:49:39.809+0000 I ACCESS [conn2] Successfully authenticated as principal root on admin from client 172.22.0.3:53804
mongo_1 | 2020-03-18T21:49:39.816+0000 I NETWORK [listener] connection accepted from 172.22.0.3:53806 #3 (2 connections now open)
mongo_1 | 2020-03-18T21:49:39.821+0000 I NETWORK [listener] connection accepted from 192.168.99.1:51536 #4 (3 connections now open)
mongo_1 | 2020-03-18T21:49:39.822+0000 I NETWORK [conn4] received client metadata from 192.168.99.1:51536 conn4: { driver: { name: "mongo-java-driver|legacy", version: "3.11.2" }, os: { type: "Windows", name: "Windows 10", architecture: "amd64", version: "10.0" }, platform: "Java/Oracle Corporation/11.0.6+8-LTS" }
mongo_1 | 2020-03-18T21:49:39.927+0000 I ACCESS [conn3] Successfully authenticated as principal root on admin from client 172.22.0.3:53806
mongo_1 | 2020-03-18T21:49:40.759+0000 I NETWORK [listener] connection accepted from 192.168.99.1:51537 #5 (4 connections now open)
mongo_1 | 2020-03-18T21:49:40.761+0000 I NETWORK [conn5] received client metadata from 192.168.99.1:51537 conn5: { driver: { name: "mongo-java-driver|async|mongo-java-driver-reactivestreams", version: "3.11.2|1.12.0" }, os: { type: "Windows", name: "Windows 10", architecture: "amd64", version: "10.0" }, platform: "Java/Oracle Corporation/11.0.6+8-LTS" }
mongo_1 | 2020-03-18T21:50:39.101+0000 I NETWORK [conn4] end connection 192.168.99.1:51536 (3 connections now open)
mongo_1 | 2020-03-18T21:50:39.102+0000 I NETWORK [conn5] end connection 192.168.99.1:51537 (2 connections now open)
mongo_1 | 2020-03-18T21:50:57.344+0000 I NETWORK [listener] connection accepted from 192.168.99.1:51576 #6 (3 connections now open)
mongo_1 | 2020-03-18T21:50:57.355+0000 I NETWORK [conn6] received client metadata from 192.168.99.1:51576 conn6: { driver: { name: "mongo-java-driver|legacy", version: "3.11.2" }, os: { type: "Windows", name: "Windows 10", architecture: "amd64", version: "10.0" }, platform: "Java/Oracle Corporation/11.0.6+8-LTS" }
mongo_1 | 2020-03-18T21:50:58.325+0000 I NETWORK [listener] connection accepted from 192.168.99.1:51593 #7 (4 connections now open)
mongo_1 | 2020-03-18T21:50:58.355+0000 I NETWORK [conn7] received client metadata from 192.168.99.1:51593 conn7: { driver: { name: "mongo-java-driver|async|mongo-java-driver-reactivestreams", version: "3.11.2|1.12.0" }, os: { type: "Windows", name: "Windows 10", architecture: "amd64", version: "10.0" }, platform: "Java/Oracle Corporation/11.0.6+8-LTS" }
mongo_1 | 2020-03-18T22:04:09.075+0000 I NETWORK [conn6] end connection 192.168.99.1:51576 (3 connections now open)
Gracefully stopping... (press Ctrl+C again to force)
Stopping express_mongo-express_1 ...
Stopping express_mongo_1 ...
Killing express_mongo_1 ... done PS C:\Dockers\mongodb\express> docker-compose down --remove-orphans
Removing express_mongo-express_1 ... done Removing express_mongo_1 ... done Removing network express_mongox-compose-network
PS C:\Dockers\mongodb\express> docker-compose up
Creating network "express_mongo-compose-network" with driver "bridge"
Creating express_mongo-db_1 ... done Creating express_mongo-express_1 ... done Attaching to express_mongo-db_1, express_mongo-express_1
mongo-db_1 | 2020-03-18T22:06:12.909+0000 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
mongo-db_1 | 2020-03-18T22:06:12.913+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=d59ff752b4e0
mongo-db_1 | 2020-03-18T22:06:12.913+0000 I CONTROL [initandlisten] db version v4.2.3
mongo-db_1 | 2020-03-18T22:06:12.913+0000 I CONTROL [initandlisten] git version: 6874650b362138df74be53d366bbefc321ea32d4
mongo-db_1 | 2020-03-18T22:06:12.913+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
mongo-db_1 | 2020-03-18T22:06:12.913+0000 I CONTROL [initandlisten] allocator: tcmalloc
mongo-db_1 | 2020-03-18T22:06:12.914+0000 I CONTROL [initandlisten] modules: none
mongo-db_1 | 2020-03-18T22:06:12.914+0000 I CONTROL [initandlisten] build environment:
mongo-db_1 | 2020-03-18T22:06:12.914+0000 I CONTROL [initandlisten] distmod: ubuntu1804
mongo-db_1 | 2020-03-18T22:06:12.917+0000 I CONTROL [initandlisten] distarch: x86_64
mongo-db_1 | 2020-03-18T22:06:12.917+0000 I CONTROL [initandlisten] target_arch: x86_64
mongo-db_1 | 2020-03-18T22:06:12.917+0000 I CONTROL [initandlisten] options: { net: { bindIp: "*" }, security: { authorization: "enabled" } }
mongo-db_1 | 2020-03-18T22:06:12.917+0000 W STORAGE [initandlisten] Detected unclean shutdown - /data/db/mongod.lock is not empty.
mongo-db_1 | 2020-03-18T22:06:12.918+0000 I STORAGE [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
mongo-db_1 | 2020-03-18T22:06:12.918+0000 W STORAGE [initandlisten] Recovering data from the last clean checkpoint.
mongo-db_1 | 2020-03-18T22:06:12.918+0000 I STORAGE [initandlisten]
mongo-db_1 | 2020-03-18T22:06:12.918+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
mongo-db_1 | 2020-03-18T22:06:12.918+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
mongo-express_1 | Waiting for mongo:27017...
mongo-express_1 | /docker-entrypoint.sh: line 14: mongo: Name does not resolve
mongo-db_1 | 2020-03-18T22:06:12.919+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=486M,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],
mongo-db_1 | 2020-03-18T22:06:13.820+0000 I STORAGE [initandlisten] WiredTiger message [1584569173:820960][1:0x7fc8832f2b00], txn-recover: Recovering log 6 through 7
mongo-db_1 | 2020-03-18T22:06:13.852+0000 I STORAGE [initandlisten] WiredTiger message [1584569173:852058][1:0x7fc8832f2b00], txn-recover: Recovering log 7 through 7
mongo-db_1 | 2020-03-18T22:06:13.905+0000 I STORAGE [initandlisten] WiredTiger message [1584569173:905743][1:0x7fc8832f2b00], txn-recover: Main recovery loop: starting at 6/5760 to 7/256
mongo-db_1 | 2020-03-18T22:06:13.987+0000 I STORAGE [initandlisten] WiredTiger message [1584569173:987253][1:0x7fc8832f2b00], txn-recover: Recovering log 6 through 7
mongo-db_1 | 2020-03-18T22:06:14.031+0000 I STORAGE [initandlisten] WiredTiger message [1584569174:31988][1:0x7fc8832f2b00], txn-recover: Recovering log 7 through 7
mongo-db_1 | 2020-03-18T22:06:14.064+0000 I STORAGE [initandlisten] WiredTiger message [1584569174:64661][1:0x7fc8832f2b00], txn-recover: Set global recovery timestamp: (0, 0)
mongo-db_1 | 2020-03-18T22:06:14.106+0000 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
mongo-db_1 | 2020-03-18T22:06:14.115+0000 I STORAGE [initandlisten] Timestamp monitor starting
mongo-db_1 | 2020-03-18T22:06:14.122+0000 I SHARDING [initandlisten] Marking collection local.system.replset as collection version: <unsharded>
mongo-db_1 | 2020-03-18T22:06:14.126+0000 I STORAGE [initandlisten] Flow Control is enabled on this deployment.
mongo-db_1 | 2020-03-18T22:06:14.126+0000 I SHARDING [initandlisten] Marking collection admin.system.roles as collection version: <unsharded>
mongo-db_1 | 2020-03-18T22:06:14.126+0000 I SHARDING [initandlisten] Marking collection admin.system.version as collection version: <unsharded>
mongo-db_1 | 2020-03-18T22:06:14.130+0000 I SHARDING [initandlisten] Marking collection local.startup_log as collection version: <unsharded>
mongo-db_1 | 2020-03-18T22:06:14.130+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
mongo-db_1 | 2020-03-18T22:06:14.132+0000 I SHARDING [LogicalSessionCacheRefresh] Marking collection config.system.sessions as collection version: <unsharded>
mongo-db_1 | 2020-03-18T22:06:14.133+0000 I SHARDING [LogicalSessionCacheReap] Marking collection config.transactions as collection version: <unsharded>
mongo-db_1 | 2020-03-18T22:06:14.133+0000 I NETWORK [listener] Listening on /tmp/mongodb-27017.sock
mongo-db_1 | 2020-03-18T22:06:14.133+0000 I NETWORK [listener] Listening on 0.0.0.0
mongo-express_1 | /docker-entrypoint.sh: line 14: /dev/tcp/mongo/27017: Invalid argument
mongo-express_1 | Wed Mar 18 22:06:14 UTC 2020 retrying to connect to mongo:27017 (2/5)
mongo-express_1 | /docker-entrypoint.sh: line 14: mongo: Name does not resolve
mongo-db_1 | 2020-03-18T22:06:14.133+0000 I NETWORK [listener] waiting for connections on port 27017
mongo-db_1 | 2020-03-18T22:06:15.054+0000 I FTDC [ftdc] Unclean full-time diagnostic data capture shutdown detected, found interim file, some metrics may have been lost. OK
mongo-express_1 | /docker-entrypoint.sh: line 14: /dev/tcp/mongo/27017: Invalid argument
mongo-express_1 | Wed Mar 18 22:06:15 UTC 2020 retrying to connect to mongo:27017 (3/5)
mongo-express_1 | /docker-entrypoint.sh: line 14: mongo: Name does not resolve
mongo-express_1 | /docker-entrypoint.sh: line 14: /dev/tcp/mongo/27017: Invalid argument
mongo-express_1 | Wed Mar 18 22:06:16 UTC 2020 retrying to connect to mongo:27017 (4/5)
mongo-express_1 | /docker-entrypoint.sh: line 14: mongo: Name does not resolve
mongo-express_1 | /docker-entrypoint.sh: line 14: /dev/tcp/mongo/27017: Invalid argument
mongo-express_1 | Wed Mar 18 22:06:18 UTC 2020 retrying to connect to mongo:27017 (5/5)
mongo-express_1 | /docker-entrypoint.sh: line 14: mongo: Name does not resolve
mongo-express_1 | /docker-entrypoint.sh: line 14: /dev/tcp/mongo/27017: Invalid argument
mongo-express_1 | Welcome to mongo-express
mongo-express_1 | ------------------------
mongo-express_1 |
mongo-express_1 |
mongo-express_1 | Mongo Express server listening at http://0.0.0.0:8081
mongo-express_1 | Server is open to allow connections from anyone (0.0.0.0)
mongo-express_1 |
mongo-express_1 | /node_modules/mongodb/lib/server.js:265
mongo-express_1 | process.nextTick(function() { throw err; })
mongo-express_1 | ^
mongo-express_1 | Error [MongoError]: failed to connect to server [mongo:27017] on first connect
mongo-express_1 | at Pool.<anonymous> (/node_modules/mongodb-core/lib/topologies/server.js:326:35)
mongo-express_1 | at Pool.emit (events.js:311:20)
mongo-express_1 | at Connection.<anonymous> (/node_modules/mongodb-core/lib/connection/pool.js:270:12)
mongo-express_1 | at Object.onceWrapper (events.js:418:26)
mongo-express_1 | at Connection.emit (events.js:311:20)
mongo-express_1 | at Socket.<anonymous> (/node_modules/mongodb-core/lib/connection/connection.js:175:49)
mongo-express_1 | at Object.onceWrapper (events.js:418:26)
mongo-express_1 | at Socket.emit (events.js:311:20)
mongo-express_1 | at emitErrorNT (internal/streams/destroy.js:92:8)
mongo-express_1 | at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) {
mongo-express_1 | name: 'MongoError',
mongo-express_1 | message: 'failed to connect to server [mongo:27017] on first connect'
mongo-express_1 | }
express_mongo-express_1 exited with code 1
最佳答案
根据docs,您应该使用一个名为的ENV ME_CONFIG_MONGODB_SERVER
ME_CONFIG_MONGODB_SERVER : MongoDB container name. Use comma delimited list of host names for replica sets.
services:
mongo-express:
image: mongo-express
ports:
- 8081:8081
environment:
ME_CONFIG_MONGODB_SERVER: mongo-server
ME_CONFIG_BASICAUTH_USERNAME: admin
ME_CONFIG_BASICAUTH_PASSWORD: q
ME_CONFIG_MONGODB_PORT: 27017
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: rootpassword
links:
- mongo-db
networks:
- mongo-compose-network
mongo-db:
image: mongo:latest
container_name: mongo-server
environment:
MONGO_INITDB_DATABASE: demodb
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: rootpassword
ports:
- "27017:27017"
volumes:
- mongodb_data_container:/data/db
networks:
- mongo-compose-network
networks:
mongo-compose-network:
driver: bridge
volumes:
mongodb_data_container:
关于mongodb - 由Docker-Compose启动的Mongo-Express导致错误[MongoError]:首次连接时无法连接到服务器[mongo:27017],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60748269/
SQLite、Content provider 和 Shared Preference 之间的所有已知区别。 但我想知道什么时候需要根据情况使用 SQLite 或 Content Provider 或
警告:我正在使用一个我无法完全控制的后端,所以我正在努力解决 Backbone 中的一些注意事项,这些注意事项可能在其他地方更好地解决......不幸的是,我别无选择,只能在这里处理它们! 所以,我的
我一整天都在挣扎。我的预输入搜索表达式与远程 json 数据完美配合。但是当我尝试使用相同的 json 数据作为预取数据时,建议为空。点击第一个标志后,我收到预定义消息“无法找到任何内容...”,结果
我正在制作一个模拟 NHL 选秀彩票的程序,其中屏幕右侧应该有一个 JTextField,并且在左侧绘制弹跳的选秀球。我创建了一个名为 Ball 的类,它实现了 Runnable,并在我的主 Draf
这个问题已经有答案了: How can I calculate a time span in Java and format the output? (18 个回答) 已关闭 9 年前。 这是我的代码
我有一个 ASP.NET Web API 应用程序在我的本地 IIS 实例上运行。 Web 应用程序配置有 CORS。我调用的 Web API 方法类似于: [POST("/API/{foo}/{ba
我将用户输入的时间和日期作为: DatePicker dp = (DatePicker) findViewById(R.id.datePicker); TimePicker tp = (TimePic
放宽“邻居”的标准是否足够,或者是否有其他标准行动可以采取? 最佳答案 如果所有相邻解决方案都是 Tabu,则听起来您的 Tabu 列表的大小太长或您的释放策略太严格。一个好的 Tabu 列表长度是
我正在阅读来自 cppreference 的代码示例: #include #include #include #include template void print_queue(T& q)
我快疯了,我试图理解工具提示的行为,但没有成功。 1. 第一个问题是当我尝试通过插件(按钮 1)在点击事件中使用它时 -> 如果您转到 Fiddle,您会在“内容”内看到该函数' 每次点击都会调用该属
我在功能组件中有以下代码: const [ folder, setFolder ] = useState([]); const folderData = useContext(FolderContex
我在使用预签名网址和 AFNetworking 3.0 从 S3 获取图像时遇到问题。我可以使用 NSMutableURLRequest 和 NSURLSession 获取图像,但是当我使用 AFHT
我正在使用 Oracle ojdbc 12 和 Java 8 处理 Oracle UCP 管理器的问题。当 UCP 池启动失败时,我希望关闭它创建的连接。 当池初始化期间遇到 ORA-02391:超过
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 9 年前。 Improve
引用这个plunker: https://plnkr.co/edit/GWsbdDWVvBYNMqyxzlLY?p=preview 我在 styles.css 文件和 src/app.ts 文件中指定
为什么我的条形这么细?我尝试将宽度设置为 1,它们变得非常厚。我不知道还能尝试什么。默认厚度为 0.8,这是应该的样子吗? import matplotlib.pyplot as plt import
当我编写时,查询按预期执行: SELECT id, day2.count - day1.count AS diff FROM day1 NATURAL JOIN day2; 但我真正想要的是右连接。当
我有以下时间数据: 0 08/01/16 13:07:46,335437 1 18/02/16 08:40:40,565575 2 14/01/16 22:2
一些背景知识 -我的 NodeJS 服务器在端口 3001 上运行,我的 React 应用程序在端口 3000 上运行。我在 React 应用程序 package.json 中设置了一个代理来代理对端
我面临着一个愚蠢的问题。我试图在我的 Angular 应用程序中延迟加载我的图像,我已经尝试过这个2: 但是他们都设置了 src attr 而不是 data-src,我在这里遗漏了什么吗?保留 d
我是一名优秀的程序员,十分优秀!