mongodb - Mongodump from remote server -
we ported data on mongodb , looking running daily backups, preferably cron job, , restore 1 of backups secondary mongo database.
our system set follows:
there 3 servers: server 1 has development mongo database, server 2 has 2 mongo databases, 1 staging data , 1 production, , third server run of our cron jobs/batch scripts from.
i checked mongo docs, , logged our cron job server , tried run following command: (username, host, , password changed security, i'm not connecting localhost)
mongodump --host 127.0.0.1/development --port 27017 --username user --password pass --out /opt/backup/mongodump-2013-10-07-1 i following messages:
mon oct 7 10:03:42 starting new replica set monitor replica set 127.0.0.1 seed of development:27017
mon oct 7 10:03:42 connected seed development:27017 replica set 127.0.0.1
mon oct 7 10:03:42 warning: node: development:27017 isn't part of set: 127.0.0.1 ismaster: { ismaster: true, maxbsonobjectsize: 16777216, ok: 1.0 }
mon oct 7 10:03:44 replica set monitor replica set 127.0.0.1 started, address 127.0.0.1/
mon oct 7 10:03:44 [replicasetmonitorwatcher] starting couldn't connect [127.0.0.1/development:27017] connect failed set 127.0.0.1/development:27017
i confirmed can connect mongo database using mongo -u -p ip/development
our ultimate goal dump data production database , store in staging database. these 2 databases both located on same box, if makes difference, testing purposes trying backup of development test data.
mongo client can parse mongodb connection string uri, instead of specifying connection parameters separately may pass single connection string uri.
in case you're trying pass connection uri host, 127.0.0.1/development not valid host name. means should specify database parameter separately host:
mongodump --host 127.0.0.1 -d development --port 27017 --username user --password pass --out /opt/backup/mongodump-2013-10-07-1
Comments
Post a Comment