Author Archive

How to reuse dropped sharded collection’s name

It happens that sometimes you want to drop your sharded collection and be able to reuse its name again. However, it might not be as straightforward as one expects it to be: mongos>sh.shardColelction(“your_database.your_collection”, { “sharded_key”: 1}) “code” : 13449, “ok” : 0, “errmsg” : “exception: collection your_database.your_collection already sharded” The error message might be different […]

Posted on July 19, 2017 at 12:35 pm by sergeyt · Permalink · Leave a comment
In: MongoDB

TIL MongoDB Index Build could exceed 100%

A quote from SERVER-7631: Since data can be inserted while its running, this can go over 100 by design.

Posted on July 4, 2017 at 2:23 pm by sergeyt · Permalink · Leave a comment
In: MongoDB

TIL Remove a Znode from Zookeeper

Yep, you could easily achieve that (and much more) using zkCli.sh (Zookeeper client): $ /usr/share/zookeeper/bin/zkCli.sh Connecting to localhost:2181 Welcome to ZooKeeper! JLine support is enabled WATCHER:: WatchedEvent state:SyncConnected type:None path:null [zk: localhost:2181(CONNECTED) 0] help ZooKeeper -server host:port cmd args connect host:port get path [watch] ls path [watch] set path data [version] rmr path delquota [-n|-b] […]

Posted on May 30, 2017 at 12:16 pm by sergeyt · Permalink · Leave a comment
In: TIL

TIL HSTS requires a secure transport

Otherwise (quoting RFC6797): If an HTTP response is received over insecure transport, the UA MUST ignore any present STS header field(s). That means SSL certificate on your server must be valid, i.e. no errors or warnings when you open a page from a browser over https.

Posted on May 25, 2017 at 2:25 pm by sergeyt · Permalink · Leave a comment
In: TIL

Restart your Mongos after maxConsecutiveFailedChecks

Take it literally. If you configured your MongoDB config servers as a replica set and for some reason, say a network outage, Mongos server lost connection to all of them and is not able to reconnect during maxConsecutiveFailedChecks attempts then, surprise, it becomes useless. Even if the network is up and running again, Mongos will […]

Posted on February 9, 2017 at 5:03 pm by sergeyt · Permalink · Leave a comment
In: MongoDB

Watch “Monitorama 2016: All of Your Networking Monitoring is (probably) wrong” talk

Just came across this talk being mentioned in the comments on Hacker news and, boy, it’s absolutely amazing! Watch this hilarious talk here – Monitorama 2016: All of Your Networking Monitoring is (probably) wrong Btw, the talk is presented, presumably, by the same guy who wrote Monitoring and Tuning the Linux Networking Stack: Receiving Data […]

Posted on February 8, 2017 at 11:55 am by sergeyt · Permalink · Leave a comment
In: Linux

TIL gethostbyname*() and gethostbyaddr*() functions are obsolete

It wasn’t obvious to me until I tried to run netcat utility (aka nc) on Ubuntu 10.04 (lucid) release to check Zookeeper’s status: echo “stat” | nc zookeer_server_name 2181 zookeer_server_name: forward host lookup failed: No address associated with name It wouldn’t have been a problem had Zookeeper server used IPv4 address but it was configured […]

Posted on January 28, 2017 at 11:54 am by sergeyt · Permalink · 2 Comments
In: Linux, TIL

jbd2 is munching your disks? Use ftrace to find why.

Have you ever been wondering why jbd2 (or jbd if your are still using ext3) is sitting at the top of iotop and consuming the most of IO bandwidth? Well, it’s certainly not because it’s doing that just to drive you nuts but there is a reason. And the reason is most probably there is […]

Posted on January 27, 2017 at 11:51 am by sergeyt · Permalink · Leave a comment
In: Linux, MongoDB

MongoDB – Defeating RangeDeleter

Not closing a cursor in MongoDB could hurt you big, so it’s generally not recommended to use no_cursor_timeout=True (pymongo3) or timeout=False (pymongo2). Especially when you run shared MongoDB installation: PyMongo does “close” cursors when they are garbage collected, but they aren’t closed immediately and closing a cursor in all current versions of MongoDB is asynchronous. […]

Posted on January 19, 2017 at 7:47 pm by sergeyt · Permalink · Leave a comment
In: MongoDB

Another FreeBSD drop into the Digital Ocean

After several happy years with FreeBSD running in AWS I finally have switched to Digital Ocean. That happened a few days ago and was driven mainly by the lack of the console support which “aws ec2 get-console-output”, in my opinion, is certainly not. After the upgrade to FreeBSD 11 I found my instance unreachable and […]

Posted on November 9, 2016 at 7:30 pm by sergeyt · Permalink · 2 Comments
In: FreeBSD, Life