1

我尝试使用以下配置使用 Meteor Up 部署我的应用程序:

module.exports = {
  servers: {
    one: {
      host: '192.168.0.220',
      username: 'root',
      password: '******',
    },
  },
  app: {
    name: 'my_app',
    path: '../',
    docker: {
      image: 'abernix/meteord:node-12.14.0-base',
    },
    servers: {
      one: {},
    },
    buildOptions: {
      serverOnly: true,
    },
    env: {
      ROOT_URL: 'http://192.168.0.220:5000',
      MONGO_URL: 'mongodb://localhost/my_app',
      PORT: 5000,
    },
  },
  mongo: {
    version: '4.0.5',
    servers: {
      one: {},
    },
  },
}

错误日志:

Started TaskList: Start Meteor
[192.168.0.220] - Start Meteor
[192.168.0.220] - Start Meteor: SUCCESS
[192.168.0.220] - Verifying Deployment
[192.168.0.220] x Verifying Deployment: FAILED
    
          ------------------------------------STDERR------------------------------------
          de_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/pool.js:562:14
        at /built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/pool.js:995:11
        at /built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connect.js:32:7
        at callback (/built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connect.js:280:5)
        at Socket.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connect.js:310:7)
        at Object.onceWrapper (events.js:300:26)
        at Socket.emit (events.js:210:5)
        at Socket.EventEmitter.emit (domain.js:475:20)
        at emitErrorNT (internal/streams/destroy.js:92:8)
        at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
        at processTicksAndRejections (internal/process/task_queues.js:80:21) {
      name: 'MongoNetworkError'
    }
    => Starting meteor app on port:3000
    /built_app/programs/server/node_modules/fibers/future.js:313
                            throw(ex);
                            ^
    
    MongoNetworkError: failed to connect to server [localhost:27017] on first connect [Error: connect ECONNREFUSED 127.0.0.1:27017
        at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1129:14) {
      name: 'MongoNetworkError'
    }]
        at Pool.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/topologies/server.js:438:11)
        at Pool.emit (events.js:210:5)
        at Pool.EventEmitter.emit (domain.js:475:20)
        at /built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/pool.js:562:14
        at /built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/pool.js:995:11
        at /built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connect.js:32:7
        at callback (/built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connect.js:280:5)
        at Socket.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connect.js:310:7)
        at Object.onceWrapper (events.js:300:26)
        at Socket.emit (events.js:210:5)
        at Socket.EventEmitter.emit (domain.js:475:20)
        at emitErrorNT (internal/streams/destroy.js:92:8)
        at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
        at processTicksAndRejections (internal/process/task_queues.js:80:21) {
      name: 'MongoNetworkError'
    }

docker ps日志:

root@pop-os:~# docker ps
CONTAINER ID   IMAGE                       COMMAND                  CREATED          STATUS                          PORTS                            NAMES
3174bb5bad23  my_app:latest   "/bin/sh -c 'exec $M…&quot;   4 minutes ago    Restarting (1) 48 seconds ago                                    my_app
790f807e9b2d   mongo:4.0.5                 "docker-entrypoint.s…&quot;   39 minutes ago   Up 

MongoDB日志:

root@pop-os:~# docker exec -it mongodb mongo my_app 
MongoDB shell version v4.0.5
connecting to: mongodb://127.0.0.1:27017/my_app?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("8fbe6eaa-de5a-47c5-8d56-3e0723739cfc") }
MongoDB server version: 4.0.5
Server has startup warnings: 
2021-08-02T01:12:26.510+0000 I STORAGE  [initandlisten] 
2021-08-02T01:12:26.510+0000 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2021-08-02T01:12:26.510+0000 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2021-08-02T01:12:31.613+0000 I CONTROL  [initandlisten] 
2021-08-02T01:12:31.613+0000 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2021-08-02T01:12:31.613+0000 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2021-08-02T01:12:31.613+0000 I CONTROL  [initandlisten] 
---
Enable MongoDB's free cloud-based monitoring service, which will then receive and display
metrics about your deployment (disk utilization, CPU, operation statistics, etc).

The monitoring data will be available on a MongoDB website with a unique URL accessible to you
and anyone you share the URL with. MongoDB may use this information to make product
improvements and to suggest MongoDB products and deployment options to you.

To enable free monitoring, run the following command: db.enableFreeMonitoring()
To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
---

版本:

  • 流星版本:v2.1
  • MUP版本:v1.5.3

谁能解释导致此错误的原因?对不起,我对这些东西不熟悉。

4

0 回答 0