外部数据库在本地使用 Meteor 但在我部署后不使用?

External database working with Meteor when local but not after i deploy?

在本地开发时,如果我使用以下命令启动 Meteor 而不仅仅是 meteor

,我可以让 Meteor 使用外部数据库
MONGO_URL='mongodb://user:MY-PASSWORD.mlab.com:57057/DB-NAME' meteor --settings settings.json

当我使用 meteor-up 部署时,我的网站上没有任何内容,所以它似乎使用了一个空的本地数据库,没有连接到远程数据库。 Meteor-up 的设置看起来很简单,所以我不确定我可能做错了什么:

module.exports = {
    servers: {
        one: {
            // TODO: set host address, username, and authentication method
            host: 'DIGITAL-OCEAN-IP',
            username: 'root',
            pem: '~/.ssh/id_rsa',
            // password: 'PASSWORD',
            // or neither for authenticate from ssh-agent
        },
    },

    app: {
        // TODO: change app name and path
        name: 'APP-NAME',
        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://DIGITAL-OCEAN-IP',
            // MONGO_URL: 'mongodb://localhost/meteor',
            MONGO_URL: 'mongodb://DB-USER:PASSWORD@ds157057.mlab.com:57057/DB-NAME',
        },

        // 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 '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: {},
        },
    },
};

你必须注释掉这个:

// Remove so mlab works when deployed
// mongo: {
//  version: '3.4.1',
//  servers: {
//      one: {},
//  },
// },