【问题标题】:Meteor app deployment using MeteorUp tool使用 MeteorUp 工具部署 Meteor 应用程序
【发布时间】:2018-10-27 20:02:22
【问题描述】:

感谢@fnkrm 和@Jankapunkt 来自Deploy Meteor js App on Centos 7 之前的帖子,他们向我指出了这个 Meteor 部署工具。我正在使用流星进行部署。我相信这是我用过的最好的部署工具。

按照文档中的要求设置配置后,这是我到达的配置

module.exports = {
  servers: {
    one: {
      // TODO: set host address, username, and authentication method
      host: 'xxx.xxx.xx.xx',
      username: 'root',
      // pem: './path/to/pem'
       password: 'xxxxxxxxxxxxx'
      // or neither for authenticate from ssh-agent
    }
  },

  app: {
    // TODO: change app name and path
    name: 'mpapps',
    path: '../myapps',

    servers: {
      one: {},
    },

    buildOptions: {
      serverOnly: true,
    },

    env: {
      // TODO: Change to your app's url
      // If you are using ssl, it needs to start with https://
      ROOT_URL: 'http://xxxxxx.xxxxxxx.com',
      MONGO_URL: 'mongodb://localhost:3001/meteor',
    },

    // ssl: { // (optional)
    //   // Enables let's encrypt (optional)
    //   autogenerate: {
    //     email: 'email.address@domain.com',
    //     // comma separated list of domains
    //     domains: 'website.com,www.website.com'
    //   }
    // },

    docker: {
      // change to 'kadirahq/meteord' if your app is using Meteor 1.3 or older
      image: 'abernix/meteord:base',
    },

    // Show progress bar while uploading bundle to server
    // You might need to disable it on CI servers
    enableUploadProgressBar: true
  },

  mongo: {
    version: '3.4.1',
    servers: {
      one: {}
    }
  }
};

这是我运行mup.cmd setup时在服务器上得到的错误日志

[103.219.22.54] - Start Mongo
[103.219.22.54] x Start Mongo: FAILED

        -----------------------------------STDERR-----------------------------------
        Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?). Using system default: https://index.docker.io/v1/
        Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
        -----------------------------------STDOUT-----------------------------------
        ----------------------------------------------------------------------------

【问题讨论】:

    标签: meteor deployment windows-10 ubuntu-16.04 meteor-up


    【解决方案1】:

    似乎您正试图将您的 mongo 指向 localhost。据我所知,Meteor 将两个 docker 容器(如果您只有一台服务器)部署到您的服务器,一个用于您的流星应用程序,一个用于您的数据库,通常称为 mongodb(您可以拥有更多像 UAT 和 LIVE 每个 ex)。

    您也可以在这里查看官方网站文档Meteor Up Example Configs

    您可以尝试将您的 env -> MONGO_URL 指向正确的容器,如下所示:

    MONGO_URL: 'mongodb://mongodb:3001/YOUR_APP_NAME' 而不是:

    MONGO_URL: 'mongodb://localhost:3001/meteor'

    确保我们正在部署的端口。

    OBS:我不知道您是否更改了在此处发布的应用名称和路径,但也请检查一下。

    【讨论】:

      【解决方案2】:

      Mongo 默认在 27017 端口上运行,但您使用的是 3001。

      我认为如果你改变它,它应该会工作。

      MONGO_URL: 'mongodb://localhost:27017/meteor',
      

      为了安全,我会添加

      port: 27017,

      到 mongo 配置

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-11-08
        • 1970-01-01
        • 1970-01-01
        • 2016-01-21
        • 2015-01-01
        • 2017-05-30
        • 1970-01-01
        • 2017-04-26
        相关资源
        最近更新 更多