Monday, 31 August 2015

MongoDB Backup and restore (mongodump, mongorestore, mongoexport, mongoimport)

This Post describes the process for creating backups and restoring data using the utilities provided with MongoDB.

The mongorestore and mongodump utilities work with BSON data dumps, and are useful for creating backups of small deployments. For resilient and non-disruptive backups, use a file system or block-level disk snapshot function, such as the methods described in the MongoDB Backup Methods document.

mongodump -d testDB
 
This command will give backup in dump directory (/home/user/dump) here will give your db backup 


mongorestore --host localhost --port 27017 <path_of_database>
 
this command will restore database and then you can check it in to mongo console 
 
 
 
MongoDB’s mongoimport and mongoexport tools allow you to work with your data in a human-readable Extended JSON or CSV format. This is useful for simple ingestion to or from a third-party system, and when you want to backup or export a small subset of your data. For more complex data migration tasks, you may want to write your own import and export scripts using a client driver to interact with the database.
The examples in this section use the MongoDB tools mongoimport and mongoexport. These tools may also be useful for importing data into a MongoDB database from third party applications.
If you want to simply copy a database or collection from one instance to another, consider using the copydb, clone, or cloneCollection commands, which may be more suited to this task. The mongo shell provides the db.copyDatabase() method.
 
 
 
 
When you export in CSV format, you must specify the fields in the documents
to export. The operation specifies the name and address fields
to export.
 
 
mongoexport --db users --collection contacts --type=csv --fields name,address --out /opt/backups/contacts.csv 



Import JSON to Remote Host Running with Authentication

In the following example, mongoimport imports data from the file /opt/backups/mdb1-examplenet.json into the contacts collection within the database marketing on a remote MongoDB database with authentication enabled.
mongoimport connects to the mongod instance running on the host mongodb1.example.net over port 37017. It authenticates with the username user and the password pass.



mongoimport --host mongodb1.example.net --port 37017 --username user --password pass --collection contacts --db marketing --file /opt/backups/mdb1-examplenet.json

 

Tuesday, 27 January 2015

SmartOS Introduction

SmartOS unites four extraordinary technologies to revolutionize the datacenter:

ZFS + DTrace + Zones + KVM
These technologies are combined into a single operating system, providing an arbitrarily-observable, highly multi-tenant environment built on a reliable, enterprise-grade storage stack


SmartOS is a specialized Type 1 Hypervisor platform based on Illumos.  It supports two types of virtualization:
  • OS Virtual Machines (Zones): A light-weight virtualization solution offering a complete and secure userland environment on a single global kernel, offering true bare metal performance and all the features Illumos has, namely dynamic introspection via DTrace
  • KVM Virtual Machines: A full virtualization solution for running a variety of guest OS's including Linux, Windows, *BSD, Plan9 and more

MongoDB(NoSQL Database)

MongoDB is a powerful, flexible, and scalable data store. It combines the ability to
scale out with many of the most useful features of relational databases, such as secondary
indexes, range queries, and sorting. MongoDB is also incredibly featureful: it has
tons of useful features such as built-in support for MapReduce-style aggregation and
geospatial indexes.
There is no point in creating a great technology if it’s impossible to work with, so a lot
of effort has been put into making MongoDB easy to get started with and a pleasure to
use. MongoDB has a developer-friendly data model, administrator-friendly configuration
options, and natural-feeling language APIs presented by drivers and the database
shell. MongoDB tries to get out of your way, letting you program instead of worrying
about storing data.

Tuesday, 18 February 2014

How To Install Python On Ubuntu and create your first Program

Here i am going to install Python On ubuntu

1. sudo apt-get install python

than open terminal and type python

atul@ubuntu:~$ python

 Than type the program