Meteor Up设置“启动Mongo:失败”:Docker容器

3
我正在尝试推送自动生成的默认 Meteor 应用程序。
meteor create myApp

我需要将内容翻译成中文。这是关于IT技术的,涉及到运行在Raspbian Stretch Lite上的树莓派3B+。

在Meteor Up页面的2-3步骤中遇到了困难:http://meteor-up.com/getting-started.html

我在配置步骤2中的“mup.js”文件时一定出了问题,在运行后的第3步中抛出了一个错误。

sudo mup setup --verbose

在终端上我获得了以下输出:

Started TaskList: Setup Docker
[192.168.1.30] - Setup Docker
18.06.1-ce
Major 18
Minor 06
[192.168.1.30] - Setup Docker: SUCCESS

Started TaskList: Setup Meteor
[192.168.1.30] - Setup Environment
[192.168.1.30] - Setup Environment: SUCCESS

Started TaskList: Setup Mongo
[192.168.1.30] - Setup Environment
[192.168.1.30] - Setup Environment: SUCCESS
[192.168.1.30] - Copying mongodb.conf
[192.168.1.30] - Copying mongodb.conf: SUCCESS

Started TaskList: Start Mongo
[192.168.1.30] - Start Mongo
3.4.1: Pulling from library/mongo
Digest: sha256:aff0c497cff4f116583b99b21775a8844a17bcf5c69f7f3f6028013bf0d6c00c
Status: Image is up to date for mongo:3.4.1
mongodb
Error response from daemon: Container 7d3155f5765a449501cb31f5150f4fb671a4e63b153fd49d702edb597679f1f8 is restarting, wait until the container is running
mongodb
Running mongo:3.4.1
9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb
Creating replica set
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
Failed connecting to mongo to create replica set
[192.168.1.30] x Start Mongo: FAILED

          ------------------------------------STDERR------------------------------------
          Error response from daemon: Container 7d3155f5765a449501cb31f5150f4fb671a4e63b153fd49d702edb597679f1f8 is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running
    Failed connecting to mongo to create replica set

          ------------------------------------STDOUT------------------------------------
          3.4.1: Pulling from library/mongo
    Digest: sha256:aff0c497cff4f116583b99b21775a8844a17bcf5c69f7f3f6028013bf0d6c00c
    Status: Image is up to date for mongo:3.4.1
    mongodb
    mongodb
    Running mongo:3.4.1
    9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb
    Creating replica set

          ------------------------------------------------------------------------------

我的“mup.js”配置文件如下:

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

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

    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://app.com',
      MONGO_URL: 'mongodb://mongodb/meteor',
      MONGO_OPLOG_URL: 'mongodb://mongodb/local',
    },

    docker: {
      // change to 'abernix/meteord:base' if your app is using Meteor 1.4 - 1.5
      image: 'abernix/meteord:node-8.4.0-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: {}
    }
  },

  // (Optional)
  // Use the proxy to setup ssl or to route requests to the correct
  // app when there are several apps

  // proxy: {
  //   domains: 'mywebsite.com,www.mywebsite.com',

  //   ssl: {
  //     // Enable Let's Encrypt
  //     letsEncryptEmail: 'email@domain.com'
  //   }
  // }
};

我必须承认我不知道要为“ROOT_URL”或“MONGO_URL”设置什么内容。在这里找到的最小配置示例: http://meteor-up.com/docs.html

该示例将这两个字段设置为默认值,我一直使用这些默认值,所以我不确定这是否是问题所在。

当我查看终端循环前错误的位置时,我看到了这个:

Status: Image is up to date for mongo:3.4.1
mongodb
Error response from daemon: Container 7d3155f5765a449501cb31f5150f4fb671a4e63b153fd49d702edb597679f1f8 is restarting, wait until the container is running
mongodb
Running mongo:3.4.1
9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb
Creating replica set
Error response from daemon: Container 9c0755e4657323e0f4661713a32aeb0fa337debfab9d51c35437ef5879eef1eb is restarting, wait until the container is running

我的理解是MongoDB已经安装并更新到最新版本。在设置过程尝试使用Docker运行MongoDB时出现问题,因为循环的点涉及容器。由于我以前从未使用过docker,所以我不知道从哪里开始。
当运行MongoDB进程时出了什么问题呢?
sudo mup setup --verbose

?

我会在此期间去看一些有关Docker的视频。

抱歉问题有点长,但我想尽可能提供详细信息。如果有任何需要改进题目格式的地方,请告知我。

先行致谢!


我最近发现在meteor-up网站的文档页面中,在Meteor支持部分中指出,您必须根据您的Meteor版本更改docker.image字段。即使更新了这个字段,我仍然遇到相同的错误。 - AustinFoss
1个回答

0

我有两个选项:

  1. 使用内置的mongo更改 MONGO_URL:'mongodb://localhost/ADD_HERE_DB_NAME',设置oplog:true并删除您拥有mongoversion。像这样:
mongo: {
    oplog: true,
    port: 27017,
    servers: {
        one: {},
    },
}
使用外部数据库。在您的树莓派3B+或不同的主机上安装mongodb。

设置MONGO_URL: 'mongodb://DB_USERNAME:USER_PASSWORD@DB_HOST_IP:DB_PORT/DB_NAME'
移除:
mongo: {
    version: '3.4.1',
    servers: {
        one: {},
    },
}
我建议选择第二个选项,因为备份数据库更容易。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接