0

我有以下内容mup.json

  // Install MongoDB in the server, does not destroy local MongoDB on future setup
  "setupMongo": true,

  // WARNING: Node.js is required! Only skip if you already have Node.js installed on server.
  "setupNode": true,

  // WARNING: If nodeVersion omitted will setup 0.10.36 by default. Do not use v, only version number.
  "nodeVersion": "0.10.43",

  // Install PhantomJS in the server
  "setupPhantom": false,

  // Show a progress bar during the upload of the bundle to the server.
  // Might cause an error in some rare cases if set to true, for instance in Shippable CI
  "enableUploadProgressBar": true,

  // Application name (No spaces)
  "appName": "myapp",

  // Location of app (local directory)
  "app": "/path/to/myapp",

  // Configure environment
  "env": {
    "PORT": 5555,
    "ROOT_URL": "http://myserver.com"
  },

我在deploy日志中得到了这个

Started TaskList: Deploy app 'myapp' (linux)
[myserver.com] - Uploading bundle
[myserver.com] - Uploading bundle: SUCCESS
[myserver.com] - Setting up Environment Variables
[myserver.com] - Setting up Environment Variables: SUCCESS
[myserver.com] - Invoking deployment process
[myserver.com] x Invoking deployment process: FAILED

    -----------------------------------STDERR-----------------------------------
    eding commands with `sudo`, or if
    npm WARN deprecated on Windows, run them from an Administrator prompt.)
    npm WARN deprecated 
    npm WARN deprecated If you're running the version of npm bundled with
    npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
    npm WARN deprecated will be bundled with a version of npm@2, which has some small
    npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
    npm WARN deprecated semver behavior.
    npm WARN package.json meteor-dev-bundle@0.0.0 No description
    npm WARN package.json meteor-dev-bundle@0.0.0 No repository field.
    npm WARN package.json meteor-dev-bundle@0.0.0 No README data
    js-bson: Failed to load c++ bson extension, using pure JS version

    /usr/lib/node_modules/wait-for-mongo/bin/wait-for-mongo:14
        throw err;
              ^
    Error: TIMEOUTED_WAIT_FOR_MONGO
        at null._onTimeout (/usr/lib/node_modules/wait-for-mongo/lib/waitForMongo.js:20:14)
        at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)
    -----------------------------------STDOUT-----------------------------------
    .1:27017]
    wait-for-mongo: failed to connect to [127.0.0.1:27017]
    wait-for-mongo: failed to connect to [127.0.0.1:27017]
    wait-for-mongo: failed to connect to [127.0.0.1:27017]
    wait-for-mongo: failed to connect to [127.0.0.1:27017]

当我 ssh 到 ec2 服务器时,它看起来mongod没有启动?

/opt/myapp$ ps -aux | grep mongod
ubuntu    9566  0.7  2.1 661524 22144 ?        Sl   22:32   0:00 node /usr/bin/wait-for-mongo mongodb://127.0.0.1/myapp 300000
ubuntu    9569  0.0  0.0  10464   916 pts/0    S+   22:33   0:00 grep --color=auto mongod

/opt/myapp$ mongo myapp
MongoDB shell version: 2.6.12
connecting to: myapp
2016-04-05T22:44:07.802+0000 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2016-04-05T22:44:07.803+0000 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed

mongo鉴于我将责任“移交”给meteor-upwith ,我不确定如何访问服务器"setup-mongo":true

任何想法,将不胜感激。

update 切换到mupx,并且 set "deployCheckWaitTime": 300mongo 现在正在正确加载。但是现在我收到了这个错误:

/bundle/bundle/programs/server/node_modules/fibers/future.js:278
                        throw(ex);
                              ^
MongoError: driver is incompatible with this server version
    at Object.Future.wait (/bundle/bundle/programs/server/node_modules/fibers/future.js:398:15)
    at [object Object].MongoConnection._ensureIndex (packages/mongo/mongo_driver.js:790:1)
    at [object Object].Mongo.Collection._ensureIndex (packages/mongo/collection.js:635:1)

它似乎与这些问题有关: https://github.com/arunoda/meteor-up/issues/841 https://github.com/meteor/meteor/issues/5809

4

1 回答 1

0

解决了

我必须在我的系统上使用不兼容的版本,并且在 ec2 服务器上mup也更早。meteor create; meteor mongo我链接/opt到不同分区中的一个空文件夹(有空间问题)并mupx setup/deploy从头开始再次运行。这次它运行良好(使用 Meteor 1.3)。

奇怪的是,我注意到没有/opt/nodejs文件夹,这可能是我第一次尝试使用mup.

此外,docker daemon 似乎没有运行,但我可以通过ssh会话连接到我的mupmongoDB

$ mongo myapp // works fine

$ docker exec -it mongodb mongo myapp 
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
于 2016-04-06T07:16:07.877 回答