How to install MongoDB on RHEL/Centos/Fedora Server

Introduction to MongoDB:-

MongoDB is an open source schema less database system which provides a document-oriented data model. The prime concern was that MySQL is written using SQL queries, while MongoDB is focused on BSON (Binary JSON). It is a cross-platform NoSQL database. It is table based relational database structure in favor of json like documents with dynamic schemas, making the integration of data in certain types of applications easier and faster. MongoDB is free and open-source software.

So let’s see the steps to install mongoDB on RHEL/Centos or Fedora Server.

How-to-install-MongoDB-on-RHELCentos-Fedora-Server

Installation procedure:-

Step: 1  System Login as root user. We are checking system OS type and system bit type.

 # uname –a
   # cat /etc/issue

Step: 2  Now we are creating a yum repo file .like /etc/yum.repos.d/mongodb.repo

# vi /etc/yum.repos.d/mongodb.repo

For we are using as 64 bit System:

[mongodb]
name=mongodb Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
enabled=1

For we are using as 32 bit System:

[mongodb]
name=mongodb Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686
gpgcheck=0
enabled=1

Step:3  Now we install MongoDB client and server using Yum

       # yum install mongo mongo-server

Step:4  Now we can configure and basic setting in MongoDB Database Server

       # vi /etc/mongod.conf
       logpath=/var/log/mongo/mongod.log
       port=27017
       dbpath=/var/lib/mongo

Step:5  Start MongoDB Server

       # /etc/init.d/mongod start

Step:6  Start MongoDB Server on system boot time

       # chkconfig mongod on

Step:7  Test MongoDB server

# mongo
   	> use test
   	switched to db test
  	> db.test.find()
 	> db.test.save({sd: 1})
	> db.test.find()
  	{ "_id" : ObjectId("4b9ef53c4f450969bb35a1a9"), "sd" : 1 }
   > db.test.update( {sd: 1}, {sd: 5})
   > db.test.find()
 	{ "_id" : ObjectId("4b9ef53c4f450969bb35a1a9"), "sd" : 5 }

 

Conclusion:-

MongoDB has an official driver for a variety of popular programming languages and development environments.

We at Andolasoft having vast expertise on implementing MongoDB database as backend in several cutting edge applications. We have developed many apps like OrangeGigs, SQUADZ  by using MongoDB as backend.

You can also see: How to Import csv configuration file to device’s SQLite db

Hope it will be helpful for you. I’d love to hear about your thoughts on this.
Thank you for your Interest.

How To Install Nagios Core on CentOS, Fedora, or RHEL Server

Nagios® Core™ is the industry standard Open Source system and network monitoring application which enables organizations to identify, resolve IT infrastructure problems before they affect critical business processes. It watches hosts and services that you specify, alerting you when things go bad and when they get better. Nagios Core serves as one of the foundation blocks of Nagios XI – commercial monitoring solution.

It was originally designed to run under Linux, although it should work under most other unices as well.

Steps to install :

STEP-1:

Install prerequisites packages

       #   yum  install  gd  gd-devel  httpd  php  gcc  glibc  glibc-common

STEP-2:

Disable selinux. open the file: /etc/selinux/config by issuing the following command          

       # vi /etc/selinux/config

Then, type “disable” opposite to “SELINUX” e.g  SELINUX= disable

STEP-3:

Create a user “nagios” and set password for it by typing the below commands.

       #   /usr/sbin/useradd -m nagios
       #   passwd nagios

STEP-4:

Create a new group “nagios” for allowing external commands to be submitted    through the web interface and add both the nagios user and the apache user to the group by following the below steps

       #    /usr/sbin/groupadd nagios
       #    /usr/sbin/usermod -a -G nagios nagios
       #    /usr/sbin/usermod -a -G nagios apache

STEP-5:

Create a directory “download “ and download nagios-core and plugins to it.

       #  mkdir download                  
       #  cd  download
       #  wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.4.4.tar.gz
       #  wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.16.tar.gz

STEP-6:

Compile and Install nagios-core package by following below steps

  • Change directory to “download” folder
       #   cd ~/download
  • Untar the nagios-core tar bal
       #   tar xzf nagios-3.4.4.tar.gz
  • Change the directory to “nagios-3.4.4”
       # cd nagios-3.4.4
  • Configure the package and install
    #  ./configure
    #   make all
    #   make install
    #   make install-init
    #   make install-commandmode
    #   make install-config
    #   make install-webconf

STEP-7:

Create a password to log in to the web interface by issuing the following command.

       # htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

STEP-8: 

Start the service and set it on chkconfig to start at booting time.

       #  service nagios start
       #  chkconfig nagios on

STEP-9:  

Compile and Install nagios-plugin package by following below steps.

  • Change directory to “download” folder
       # cd   ~/download
  • Untar nagios-plugin tar ball
       # tar xzf  nagios-plugins-1.4.16.tar.gz
  • Change the directory to “nagios-plugins-1.4.16”
       # cd  nagios-plugins-1.4.16
  • Configure the package and install.
       # ./configure
       # make
       # make install

STEP-10:

Start the apache service and enable it on boot by issuing following command.

       # service httpd start
       # chkconfig httpd on

STEP-11:  Now, connect to your nagios server through browser by typing.

       # http://Your-Nagios-IP/nagios or  http://localhost/nagios

Then, enter login credentials.
Username: nagiosadmin & password you have chosen earlier

Features of NAGIOS Core

  • Monitoring of network services (SMTP, POP3, HTTP, NNTP, PING, etc.)
  • Monitoring of host resources (processor load, disk usage, etc.)
  • Simple plugin design that allows users to easily develop their own service checks
  • Parallelized service checks
  • Ability to define network host hierarchy using “parent” hosts, allowing detection of and distinction between hosts that are down and those that are unreachable
  • Contact notifications when service or host problems occur and get resolved (via email, pager, or user-defined method)
  • Ability to define event handlers to be run during service or host events for proactive problem resolution
  • Automatic log file rotation
  • Support for implementing redundant monitoring hosts
  • Optional web interface for viewing current network status, notification and problem history, log file, etc.

Recommended Blog: How to install and configure Jaspersoft in Linux Server(RHEL/Centos/Fedora)

I hope you liked this topic, if you have any questions or comments please feel free to put under comments!

Configure Dropbox in RHEL/Centos/Fedora and File Upload From Linux To Dropbox

Dropbox is a free file hosting service operated by Dropbox, Inc. that lets you bring your photos, docs, and videos

dropbox2from anywhere and share them easily. Dropbox allows users to create a special folder on their computers, which Dropbox then synchronizes so that it appears to be the same folder (with the same contents) regardless of which computer is used to view it. Files placed in this folder also are accessible through a website and mobile phone applications.

Follow the below steps to configure Dropbox:

Step:1 Create an account on www.dropbox.com

Step:2 Login your Linux System

Step:3 we need to install dependency packages

# yum install curl bash

Step:4 Now go to /tmp directory and download dropbox up loader script and give appropriate permission to run script

test@localhost:~$ cd /tmp
test@localhost:~$ wget https://raw.github.com/andreafabrizi/DropboxUploader/master/dropbox_uploader.sh
test@localhost:~$ sudo cp dropbox_uploader.sh /usr/local/bin/droptobox
test@localhost:~$ sudo chmod +x /usr/local/bin/droptobox

Step:5 Now you can run the program anywhere from the terminal by running droptobox command

1
test:~$ droptobox

Here will ask you for the “App Key and App secret”,
Then create it from the Dropbox web and copy below url and paste in browser
# https://www.dropbox.com/developers/apps
Here we click “app” button and create an app. Give “Full Access” while filling the App details.
It will display an “App Key” and “App Secret” after successful creation.
Copy both App key and App Secret key and go to terminal and paste and give “f” in the access option.
# App key: xxxxxxxxxxxxxx
# App secret: xxxxxxxxxxxxxxx
# Access level you have chosen, App folder or Full Dropbox [a/f]: f
Then it will display a Link, Copy and paste it on the web browser and Allow the API access.

How to upload file from Linux terminal to dropbox:

Here we can use ” /usr/local/bin/droptobox ” or ” droptobox ”
## List Directory
# /usr/local/bin/droptobox list
## Upload a file to drop box
# droptobox upload file1
## Upload the files to your drop box /Test directory
# droptobox file1 Test/file1
## Delete a file “file1″ in “Test” directory in dropbox
# droptobox delete Test/file1
## Download a file “file1″ in “Test” directory in dropbox
# droptobox download Test/file1

See also : Andolasoft launches “Patia” – Free App to Find your file in Dropbox & Google Drive

Hope you liked the blog. It would be great if you can share your valuable comments with us.