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…

Writing Hadoop MapReduce Program in Python

Map step: mapper.py It will read data from STDIN, split it into words and output a list of lines mapping words to their (intermediate) counts to STDOUT. The Map script will not compute an (intermediate) sum of a word’s occurrences…

Prevent accidental data loss in Hadoop

Some time you have accidentally delete some file which you are not suppose to do. So what will you do in that case? The option with you is to enable trash (Recycle bin) for hadoop, and define fs.trash.interval to one…

Warning: $HADOOP_HOME is deprecated

Do you have below warnings issue for every command with your Hadoop set-up ? Warning: $HADOOP_HOME is deprecated. [root@hostname logs]# hadoop dfs -ls / Warning: $HADOOP_HOME is deprecated. Found 3 items drwxr-xr-x – root supergroup 0 2014-07-09 09:06 /hadoop drwxr-xr-x…