Monthly Archives: October 2015

Building MongoDB for Debian Jessie

Today Debian Jessie doesn’t have a recent version of MongoDb. They provide 2.4.10 when I (and you if you arrived here) need something newer like 3.0.6. On MongoDB website, you can download Debian packages but only for the already old Wheezy…

So you will need to download the MongoDB 3.0.6 tgz source file here and try to build the .deb on your own. That’s how I did it:

First, I’ve Installed this list of debian packages:

apt-get install debtools devscripts gcc libboost-date-time-dev libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libgoogle-perftools-dev libpcap-dev libpcre3-dev libreadline-dev libsnappy-dev libstemmer-dev libssl-dev libv8-dev python-pymongo scons dh-systemd

Once you’ve untar the archive, go to the debian/ directory and add thoses links:

ln -s mongodb-org-unstable.control control
ln -s mongodb-org-unstable.rules rules

In the control file change the first line from “Source: mongodb-org-unstable” to “Source: mongodb”.

In the rules files, uncomment each commented scons command, especially in the build-stamp part. I’ve changed it to “scons -j12 all” to build it with 12 parallel gcc process (depends how many cores your CPUs have).

Still in the debian/ directory, In the changelog file add thoses lines at the beginning:

mongodb (3.0.6) unstable; urgency=low

  * Rebuild debian package for Jessie

 -- Aurelien Beaujean <> Thu, 08 Oct 2015 12:02:36 +0200

Then you are ready to build MongoDB by running the command “dpkg-buildpackage -rfakeroot” in the mongodb-src-r3.0.6 directory. It takes a while, for me it took about 15 minutes. And if everything gone good, you shoud get .deb files in the upper directory to give to install to dpkg.

Feel free to comment on this article if you solved some issues I didn’t had while building.

Happy new year from Logstash & syslog

Once you’re running syslog-ng | logstash | elasticsearch for to archive all the syslogs from your servers, there is probably something you didn’t noticed: syslog don’t care about year.

So when 2015 coming, Logstash don’t know about it and push into elasticsearch the year of it’s last starts. So your January 2015 syslogs coming to January 2014 ones…

How I fixed it ? I’ve restarted logstash when I understood the problem, but it was somehow too late.

Some solution is explained here: but you need some more code to handle the year move and using @timestamp don’t allow you to replay piece of logs when you need…