MongoError:第一次连接时无法连接到服务器[192.168.100.2:9001] - Meteor

时间:2018-04-16 13:14:37

标签: mongodb meteor

我有一个流星应用程序。我试图通过自定义部署过程(在我的本地计算机上)按照以下文章部署我的应用程序:

https://guide.meteor.com/deployment.html#custom-deployment

但是当我通过节点运行应用程序时,我遇到了这个错误:

MongoError: failed to connect to server [192.168.100.2:9001] on first connect [MongoError: connect ECONNREFUSED 192.168.100.2:9001]
    at Object.wait (/home/martini-henry/myapp-build/bundle/programs/server/node_modules/fibers/future.js:449:15)
    at new MongoConnection (packages/mongo/mongo_driver.js:210:27)
    at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote_collection_driver.js:4:16)
    at Object.<anonymous> (packages/mongo/remote_collection_driver.js:38:10)
    at Object.defaultRemoteCollectionDriver (packages/underscore.js:784:19)
    at new Mongo.Collection (packages/mongo/collection.js:99:40)
    at AccountsServer.AccountsCommon (packages/accounts-base/accounts_common.js:23:18)
    at AccountsServer (packages/accounts-base/accounts_server.js:18:5)
    at server_main.js (packages/accounts-base/server_main.js:9:12)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    - - - - -
    at Pool.<anonymous> (/home/martini-henry/myapp-build/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/topologies/server.js:336:35)
    at emitOne (events.js:96:13)
    at Pool.emit (events.js:188:7)
    at Connection.<anonymous> (/home/martini-henry/myapp-build/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:280:12)
    at Connection.g (events.js:292:16)
    at emitTwo (events.js:106:13)
    at Connection.emit (events.js:191:7)
    at Socket.<anonymous> (/home/martini-henry/myapp-build/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:187:49)
    at Socket.g (events.js:292:16)
    at emitOne (events.js:96:13)

我执行的步骤:

首先,我进入Meteor App目录并运行:

meteor build ../myapp-build --architecture os.linux.x86_64

然后我提供了myapp.tar.gz,然后我提取了它。

比我做的更多:

- cd programs/server && npm install
- export MONGO_URL='mongodb://martini-henry:123456@192.168.100.2:9001/myappdb'
- export ROOT_URL='http://192.168.100.2:9000'

最后当我跑步时:

- cd ../.. node main.js

我上面有这个错误。这可能有什么问题?谁能帮助我,我在这里做错了什么?

0 个答案:

没有答案