[MongoDB] : DBQuery.Option.partial
If a shard is inaccessible or unavailable, queries will return with an error. However, a client may set the partial query bit, which will then return results from all available shards, regardless of whether a given shard is unavailable. The…
[MongoDB]: what happend to your queries when any shard (complete RS) goes down
We observed when any complete shard (all nodes in that replica set) got down, all the queries which involved data from that down shard are giving failures as below. Want to know whether it’s expected behavior ? mongos> db.shrcol.count() Thu…
[MognoDB]: How do I enable Sharding (draft version)
To enable sharding :- ================== sh.addShard(“rs1/ip-10-0-0-197:27010,ec2-52-7-8-107.compute-1.amazonaws.com:27011”) sh.addShard(“rs2/ip-10-0-0-197:27020,ec2-52-7-8-107.compute-1.amazonaws.com:27021”) use shard_db db.shard_col.ensureIndex( { user_id : 1 }, { unique : true }) sh.enableSharding(“shard_db”) sh.shardCollection(“shard_db.shard_col”, {“user_id”:1}) sh.startBalancer() sh.getBalancerState() sh.isBalancerRunning() use shard_db for(var i = 1; i <= 100000 ; i++){db.shard_col.insert({“user_id” : i ,…
[MongoDB]: Index Data
Question : – ============================================ I’ve a quick question on Covered/IndexOnly Index – it’s saying query goes to index collection – not to actual collection; but I don’t see any entries in system.indexes collections except 2 – I’m little confused here….
How do I change DB Query shellBatchSize in MongoDB
By default MongoDB displays 20 records in the results for any DB query (which results more than 20 records ) & you can see the next set of result by pressing ‘it’ (iteration) in the prompt. However, you can change the default…
[MongoDB]: Orphaned documents
Orphaned document In a sharded cluster, orphaned documents are those documents on a shard that also exist in chunks on other shards as a result of failed migrations or incomplete migration cleanup due to abnormal shutdown. Delete orphaned documents using…
[MongoDB]: Sharded cluster script
Shell script to run a 3 sharded cluster (3 ReplicaSet) on a single server. [root@dbversity.com bin]# cat shard_creation_script.sh ##### Killing the existing Mongo processes ################ for i in `ps -ef | egrep ‘shardsvr|configsvr|replSet|configdb’ | grep -v egrep | awk -F”…
[MongoDB-Hadoop]: Connectivity testing
Install Hadoop CDH 4/5, Hive, Pig, Java & MongoDB and set environment variables as below. [root@dbversity.com ~]# cat ~/.bashrc | grep “export” export PATH=$PATH:/opt/mongodb/bin export JAVA_HOME=/usr/java/jdk1.8.0_05 export PATH=$JAVA_HOME/bin:$PATH export HADOOP_HOME=/hadoop export PATH=$HADOOP_HOME/bin:$PATH export HIVE_HOME=/hadoop/hive-0.12.0-cdh5.0.0 export PATH=$HIVE_HOME/bin:$PATH export PIG_HOME=/hadoop/pig-0.12.0-cdh5.0.0 export PATH=$PIG_HOME/bin:$PATH…
[MongoDB]: _tmp significance in MongoDB dbpath
What is the significance of _tmp directory is used for in MongoDB and why it gets created? There are at least two ways from MongoDB to create a _tmp directory. INITIAL FILE ALLOCATION : – ======================== During the file allocation,…