mongorestores behaving differently on different machines? - mongodb

I do the following:
mongorestore -d connect connect
on my local machine and it works fine. On my development machine on amazon i get this output from the same command and the same database dump and the same version of mongodb (2.0.4):
don't know what to do with file [connect/connect/channels.metadata.json]
don't know what to do with file [connect/connect/movies.metadata.json]
Thu Dec 12 09:11:46 connect/connect/movies.bson
Thu Dec 12 09:11:46 going into namespace [connect.movies]
2667 objects found
Thu Dec 12 09:11:46 connect/connect/teams.bson
Thu Dec 12 09:11:46 going into namespace [connect.teams]
335 objects found
don't know what to do with file [connect/connect/broadcasts.metadata.json]
Thu Dec 12 09:11:46 connect/connect/channels.bson
Thu Dec 12 09:11:46 going into namespace [connect.channels]
82 objects found
don't know what to do with file [connect/connect/series.metadata.json]
Thu Dec 12 09:11:46 connect/connect/sportsevents.bson
Thu Dec 12 09:11:46 going into namespace [connect.sportsevents]
24 objects found
The data imported is not complete. What do i do wrong?

The metadata.json files are only created in MongoDB 2.2 or newer, so you definitely have a newer version of mongodump on your local machine than your development machine (2.0.4).
The metadata.json file includes useful information like index definitions and capped collection properties. If you try to restore using an older version of mongorestore, it won't know how to handle those files and so your restore will not be complete. If you are relying on newer features of MongoDB such as the Aggregation Framework, these also won't be available in MongoDB 2.0.x.
You should upgrade your development machine on AWS to match the version on your local machine. If you are using a 2.2.x or 2.4.x that isn't the latest production point release in that series, you should also upgrade your local machine at the same time.

Related

CPAN installation prompting "waiting for read lock"

I just installed perl and am trying to install CPAN without root privilege.
As I run cpan App::cpanminus, I got into an infinite loop echoing Waiting for read lock on '~/.cpan/FTPstats.yml'. I tried removing the file and the error persists.
Highly appreciate any solution and thanks in advance!
A snapshot of full log is as follows.
Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/home/louis/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Reading '/home/louis/.cpan/sources/modules/02packages.details.txt.gz'
Database was generated on Tue, 01 Mar 2022 04:17:03 GMT
.............
New CPAN.pm version (v2.29) available.
[Currently running version is v2.16]
You might want to try
install CPAN
reload cpan
to both upgrade CPAN.pm and run the new version without leaving
the current session.
...............................................................DONE
Fetching with LWP:
http://www.cpan.org/modules/03modlist.data.gz
Tue Mar 1 13:33:09 2022: waiting for read lock on '/home/louis/.cpan/FTPstats.yml' (since Tue Mar 1 13:32:59 2022)
Tue Mar 1 13:33:12 2022: waiting for read lock on '/home/louis/.cpan/FTPstats.yml' (since Tue Mar 1 13:32:59 2022)
And some details of access right of FTPstats.yml.
-rw-r--r-- 1 louis louis 0 Mar 1 13:32 /home/louis/.cpan/FTPstats.yml

IR transmitter not working on Raspberry Pi

I am trying to turn on my TV using a Raspberry Pi.
I have followed the below instructions and added my remote config file, however, am having no luck! Any suggestions.
When running sudo /etc/init.d/lircd status, I get
lircd.service - Flexible IR remote input/output application support
Loaded: loaded (/lib/systemd/system/lircd.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2018-11-11 13:27:07 UTC; 5min ago
Docs: man:lircd(8)
http://lirc.org/html/configure.html
Main PID: 334 (lircd)
CGroup: /system.slice/lircd.service
└─334 /usr/sbin/lircd --nodaemon
Nov 11 13:32:23 raspberrypi lircd[334]: lircd-0.9.4c[334]: Info: removed client
Nov 11 13:32:23 raspberrypi lircd-0.9.4c[334]: Info: removed client
Nov 11 13:32:42 raspberrypi lircd[334]: lircd-0.9.4c[334]: Notice: accepted new client on /var/run/lirc/lircd
Nov 11 13:32:42 raspberrypi lircd-0.9.4c[334]: Notice: accepted new client on /var/run/lirc/lircd
Nov 11 13:32:42 raspberrypi lircd[334]: lircd-0.9.4c[334]: Info: removed client
Nov 11 13:32:42 raspberrypi lircd-0.9.4c[334]: Info: removed client
Nov 11 13:32:54 raspberrypi lircd[334]: lircd-0.9.4c[334]: Notice: accepted new client on /var/run/lirc/lircd
Nov 11 13:32:54 raspberrypi lircd-0.9.4c[334]: Notice: accepted new client on /var/run/lirc/lircd
Nov 11 13:32:54 raspberrypi lircd[334]: lircd-0.9.4c[334]: Info: removed client
Nov 11 13:32:54 raspberrypi lircd-0.9.4c[334]: Info: removed client
Here are the steps I took to set it up.
# Add the following lines to /etc/modules file
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17
# Add the following lines to /etc/lirc/hardware.conf file
LIRCD_ARGS="--uinput --listen"
LOAD_MODULES=true
DRIVER="default"
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"
# Update the following line in /boot/config.txt
dtoverlay=lirc-rpi,gpio_in_pin=18,gpio_out_pin=17
# Update the following lines in /etc/lirc/lirc_options.conf
driver = default
device = /dev/lirc0
$ sudo /etc/init.d/lircd stop
$ sudo /etc/init.d/lircd start
# Check status to make lirc is running
$ sudo /etc/init.d/lircd status
# Reboot before testing
$ reboot
Just run into the same problem. There are two main parts to it:
Part 1: new LIRC config
With the new version on lirc 0.9.0+, the configuration needed is much less:
The driver is already included in the kernel, no need to edit anything in modules
The new config syntax is much different, there's a shell script provided to change an old config to the new one. Run: sudo /usr/share/lirc/lirc-old2new.sh
To summarise, you only need to change the /etc/lirc/lirc_options.conf. In particular, you need to edit the lines to driver = default AND device = /dev/lirc0.
This should solve part 1.
Part 2: new IR drivers
As you can see in the /boot/overlays/README, the LIRC driver is being outdated. There are new ones provided for IR input and output. The driver for IR output is the new gpio-ir-tx. You need to use that instead of lirc-rpi in your /boot/config.txt.
In summary, change dtoverlay=lirc-rpi,gpio_out_pin=17,gpio_in_pin=13 to
dtoverlay=gpio-ir-tx,gpio_pin=17
NOTE the missing _out in the config. This driver only supports output, so no need for an input one. To handle inputs, use the gpio-ir one.

Mongodump getting blank folders

I am trying to run this command from a remote ssh
mongodump --host mongodb1.example.net --port 27017 --username user --password pass --out /opt/backup/mongodump-2013-10-24
However, all I am getting is blank folders for each collections.
What am I doing wrong?
Info (if it matters):
Source Mongodb is on Windows Server
And SSH is of a remote Ubuntu Machine
Here is the terminal output:
connected to: ip.ip.ip.ip:27017
Thu Feb 18 00:46:01.757 all dbs
Thu Feb 18 00:46:01.809 DATABASE: admin to /opt/backup/mongodump-2013-10-24/admin
Thu Feb 18 00:46:01.903 DATABASE: anthony_data to /opt/backup/mongodump-2013-10-24/anthony_data
Thu Feb 18 00:46:02.004 DATABASE: temp_data to /opt/backup/mongodump-2013-10-24/temp_data
Thu Feb 18 00:46:02.104 DATABASE: zoomy to /opt/backup/mongodump-2013-10-24/zoomy
So it creates empty folder for all collections. But there is no bson in it
Check that your copy of mongodump and the database itself is the same version.
I had the exact same problem (complete with no terminal output or logs) when I tried to do a dump of a mongo 3.2.4 server with a 2.4.1 mongodump client. Removing the older client and installing the newer one resolved it immediately.
I was using the default mongodb-client deb package with Ubuntu. I removed those and installed the mongodb-org-tools package from mongodb.com https://docs.mongodb.com/master/tutorial/install-mongodb-on-ubuntu/?_ga=2.36209632.1945690590.1499275806-1594815486.1499275806
They have other install instructions for your specific OS if you are not on Ubuntu https://www.mongodb.com/download-center?jmp=nav#community

Get output of mongo shell script

as a part of my mongoDB maintenance I'm running mongo shell and make it to load 2 scripts. The command I'm running looks like follows:
$MONGO_HOME/bin/mongo --verbose --port 27017 replSetConfig.js initializeReplicaSet.js
The output I got is:
MongoDB shell version: 2.2.3
Thu Mar 7 03:00:00 versionCmpTest passed
Thu Mar 7 03:00:00 versionArrayTest passed connecting to: 127.0.0.1:27017/test
Thu Mar 7 03:00:01 creating new connection to:127.0.0.1:27017
Thu Mar 7 03:00:01 BackgroundJob starting: ConnectBG
Thu Mar 7 03:00:01 connected connection!
loading file: js/replSet.config.js
loading file: js/initializeReplicaSet.js
I'm redirecting the output to a log file but I would like to see some output of the loaded scripts as well. I.e. the output which I see in the shell if I start it and call load("...") for the very same scripts. Is there a way how to capture the output?
Thanks
To add output of scripts you must use print() or printjson() statements otherwise MongoDB will remain quiet about any output of a script.

Upgraded MongoDB and now shell dies with 'Illegal instruction'

I was running MongoDB v2.0.4.
I installed v2.2.2 and restarted.
The mongod process is running fine. Client applications are connecting and functioning fine.
But the mongo shell bombs out.
$: ~ mongo localhost/da
MongoDB shell version: 2.2.2
connecting to: localhost/da
Illegal instruction
$: ~
My "install" process was to download & unpack the .tgz and simlink all the binaries in bin to /usr/local/bin.
Here's what I see in the log on start.
Thu Jan 3 16:14:54 Mongo DB : starting : pid = 7225 port = 27017 dbpath = /var/lib/mongodb/ master = 0 slave = 0 32-bit
** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
** see http://blog.mongodb.org/post/137788967/32-bit-limitations for more
Thu Jan 3 16:14:54 db version v1.2.2, pdfile version 4.5
Thu Jan 3 16:14:54 git version: nogitversion
Thu Jan 3 16:14:54 sys info: Linux vernadsky 2.6.24-27-server #1 SMP Fri Mar 12 01:45:06 UTC 2010 i686 BOOST_LIB_VERSION=1_40
Thu Jan 3 16:14:54 waiting for connections on port 27017
This is running on a 32bit machine w/ 4GB memory and dual core PIII 1.4GHz processor.
Thinking this could be the 'floating point exception' mentioned on the MongoDB downloads page I tried the legacy-static build. The result is the same.
UPDATE
I think the limitations of running on an older 32 bit system make running v2.2.2 too unstable. The 2GB limit is easily exceeded (as evidenced by 'Got signal: 4' errors) when doing a repair operation or checking journal files on start up.
I've decided to revert to v1.2.2 using the Ubuntu package manager.
References:
https://jira.mongodb.org/browse/SERVER-5639
https://groups.google.com/d/topic/mongodb-user/gaAlONRvVSU/discussion
I had the same problem on Debian Squeeze 6.0.10 , an old 32-bit/i386 machine and with the 10gen distribution of the official mongodb instructions. On the instalation some problems with --configure of mongo-org-server and dependencies Trying to execute mongod "Illegal instruction" and
I had to purge the packages and install the 1.4.4 version through a simple apt-get install mongodb.