Bulk inserts to MongoDB Collection with a for loop

[user@hostname bin]$ ./mongo hostname:37017/admin -u admin_mongodb -p –ssl MongoDB shell version: 2.4.5 Enter password: connecting to: hostname:37017/admin Welcome to the MongoDB shell. For interactive help, type “help”. For more comprehensive documentation, see http://docs.mongodb.org/ Questions? Try the support group http://groups.google.com/group/mongodb-user rs1:PRIMARY>…

MongoDB Job trends from INDEED.COM (http://www.indeed.com/)

MongoDB Job trends from INDEED.COM (http://www.indeed.com/)

    Here’s a look at the current, trending NoSQL jobs. This is a clear indicator that MongoDB® jobs are the hottest NoSQL jobs in town.      MongoDB® has significant adoption among the Fortune 500 and Global 500 companies. Companies like eBay, The New York…

MongoDB with SSL, KeyFile & Kerberos Authentication

It is recommended that MongoDB uses SSL to ensure any sensitive information is transmitted securely between clients and MongoDB. By default the MongoDB configuration file contains 3 entries for SSL communication. To enable MongoDB to start up using SSL requires…

Enabling MongoDB authentication with –keyFile option.

Create a keyFile as below and change it’s permissions & owner as below [root@host-name bin]$ cat /srv/mongodb/keyfile SrinivasMutyalakeyFileforTesting [root@host-name bin]$ chown root:mongod /srv/mongodb/keyfile [root@host-name bin]$ chmod 700 /srv/mongodb/keyfile [root@host-name bin]$ [root@host-name bin]$ ls -lhtr /srv/mongodb/keyfile -rwx—— 1 root mongod 33…

How do I stop Replication within Replica-set in MongoDB

Is there any single command/short process to stop/pause the Replication within a Replica Set (Not Shard enabled) instead following the below long process. 1. PRIMARY> rs.remove(secondary.host.name:port); 2. restart secondary without –replSet 3. do your activity 4. restart secondary with –replSet,…

MongoDB Admin user creation script

## Copy this script to your mongo /bin folder ################################# ID=`id -u -n` echo echo ” AdminUserCreation.sh script is executed by user : $ID” echo echo ” Date and Time of Execution : `date`” echo read -p “Enter the port…

MongoDB User management shell script

MongoDB User management shell script #!/bin/bash ## Copy this script to your mongo /bin folder ################################# PWP_HOME=/opt/pwp/3.0 MONGO_HOME=/apps/bin SCRIPTS=/apps/UMG_Menu/Scripts HOME=/apps/UMG_Menu/UMG_PWP LOGS=/apps/UMG_Menu/ScriptLogs TIMESTAMP=`date +%d-%m-%y_%H:%M:%S` DATE=`date +%d-%m-%y` db=admin local_host=`hostname` ID=`id -u -n` echo echo ” User_Management.sh script is executed by user :…

There is no reason at all to use MySQL !

MySQL was once the most popular open source database (it still is), but it’s popularity and deployment is declining under the ownership of Oracle. The founder of MySQL Michael Widenius “Monty” was not happy when Oracle announced to acquire MySQL…

Write file to HDFS/Hadoop Read File From HDFS/Hadoop Using Java

import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hdfs.DistributedFileSystem; /** * * @author    Srinivas * @email     srinivas@dbversity.com * @Web       www.dbversity.com */ public class WritetoHDFSReadFromHDFSWritToLocal {     private…