mongodump

mongodump from remote node - unable to authenticate using mechanism “SCRAM-SHA-256”

烈酒焚心 提交于 2021-02-11 13:41:45
问题 Tried taking dump from a remote node and got the following error: Failed: can't create session: could not connect to server: connection(): auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-256": (AuthenticationFailed) Authentication failed. Tried two methods to take dump from the remote node. But got the same error in both the methods. # Method 1 mongodump -h remoteip@port -u xxx -p xxx --db xxx --authenticationDatabase xxx # Method 2 mongodump --uri

Restoring the database dump of an older version of mongo to a new version of mongo

元气小坏坏 提交于 2020-06-09 18:12:16
问题 Currently, I have an older version of mongo, i.e 2.6 running on my system. I already have my site in production and have a lot of client data. I am planning an upgrade to mongo 3.2. So, my question is whether mongorestore of mongo v3.2 work with data dump of v2.6 ? Or, is it known to create problems? Any answers will be invaluable! Thanks 回答1: I asked this same question on the official MongoDB mailing list. They said not to upgrade more than 1 major version at a time. (Major versions being: 2

mongodb备份与恢复(下)

江枫思渺然 提交于 2020-04-07 02:39:24
一. 适用于mongodb任何架构(standalon、replic set、sharding)备份脚本 需要安装perl的MongoDB模块,安装方法参见:使用cpanm安装perl相关模块 http://www.ttlsa.com/html/2030.html 。代码这东西,仁者见仁智者见智,一分价钱一分货,所以对于优秀的程序员不要抠门。对语言的熟练度高,编程经验丰富的程序员,写出来的代码,两个字:漂亮! 下面的脚本只需更改变量$mongodb相关参数即可,如有更好的更便捷的方法请赐教。 #!/bin/perl ################################# ### author: www.ttlsa.com ### ### QQ群: 39514058 ### ### E-mail: service@ttlsa.com ### ################################# use strict; use File::Path; use POSIX; use MongoDB; use Data::Dumper; my $mongodump='/usr/local/mongodb/bin/mongodump'; my $mongodb={ 'admin_1'=>{ #定义组别 'email'=>'39514058@qq.com',

Can't create backup mongodump with --db. Authentication failed

萝らか妹 提交于 2019-12-30 03:39:08
问题 When I create backup of all databases in MongoDB (version 3): mongodump --username bacUser --password 12345 It's OK. But when I try to create backup of a selected db: mongodump --username bacUser --password 12345 --db test It gives me this error: Failed: error connecting to db server: server returned error on SASL authentication step: Authentication failed. 回答1: work with this: --authenticationDatabase admin mongodump and mongorestore commands need the name of database where mongodb user's

Which is my database in mongodb?

霸气de小男生 提交于 2019-12-25 05:50:23
问题 Next question in reference with previous one Where does mongodb store databse in ubuntu? $ cd /var/lib/mongodb/ $ ls ihtx.0 ihtx.1 ihtx.ns journal local.0 local.ns mongod.lock Here, I can see ihtx.0 ihtx.1 ihtx.ns three files with the same name. Here which one is mydatabase which I usually see in mongo shell? which one should I dump ? Tried each, getting following error : $ mongodump --dbpath /var/lib/mongodb/ihtx.XX --out /home/user/Desktop/ If you are running a mongod on the same path you

MongoDB- backing up and restoring users and roles

我是研究僧i 提交于 2019-12-24 08:07:40
问题 What are best practices for synching users and roles between Mongo instances? On the same Windows machine, I am trying to copy MongoDB users and roles in the admin database from one Mongo instance to another. Authentication is 'on' for each instance. No combination of mongodump\mongorestore or mongoexport\mongoimport I have tried works. With mongodump\restore, the restore step displays: assuming users in the dump directory are from <= 2.4 (auth version 1) Failed: the users and roles

Mongodump Fails Frequently After upgrade from 2.6 to 3.0

梦想的初衷 提交于 2019-12-23 13:31:20
问题 I'm in the process of upgrading our database to Mongo 3.0, and I'm at the step of upgrading our daily backups process from using mongodump 2.6.1 to 3.0.1, which has has greater performance due to parallelized collection downloads. I'm running into an issue where the mongodump fails midway through with the error .... 2015-04-10T00:42:54.606+0000 [##############..........] XXX.XXXXXXX 6804841/11236617 (60.6%) 2015-04-10T00:42:57.352+0000 Failed: error reading collection: Closed explicitly. Out

Mongodb data files become smaller after migration

南笙酒味 提交于 2019-12-23 10:21:57
问题 On my first server I get: root@prod ~ # du -hs /var/lib/mongodb/ 909G /var/lib/mongodb/ After migration this database with mongodump/mongorestore On my second server I get: root@prod ~ # du -hs /var/lib/mongodb/ 30G /var/lib/mongodb/ After I waited a few hours, mongo finished indexing I got: root@prod ~ # du -hs /var/lib/mongodb/ 54G /var/lib/mongodb/ I tested database and there's no corrupted or missed data. Why there's so big difference in size before and after migration? 回答1: MongoDB does

How to mongodump from OpenShift and mongorestore locally on MongoDB 2.4.9?

可紊 提交于 2019-12-18 13:25:13
问题 I just did this myself (as a RockMongo export and import was corrupted) so just posting here. Note this was for MongoDB verison 2.4.9 with corresponding versions of mongodump and mongorestore . 回答1: Read the documentation relevant to your versions first, backup, make sure the solution below is relevant to your scenario etc. http://docs.mongodb.org/v2.4/reference/program/mongodump/ http://docs.mongodb.org/v2.4/reference/program/mongorestore/ BEGIN 20/11/18 update I just had to revisit these

Mongodb monogorestore “root directory must be a dump of a single database”

℡╲_俬逩灬. 提交于 2019-12-18 09:02:13
问题 I'm trying to restore a mongodump to a differently named database (which should be possible via --db <dbname> switch). My working directory contains a single dump folder, which contains a single db dump. However, when I try this command: mongorestore --port xxxxx --db some_destination_db I get the following error: ERROR: ERROR: root directory must be a dump of a single database ERROR: when specifying a db name with --db I have no idea why I'm getting this, and can't find any help on google.