This forum provides solutions for aws developers for their issues.It provides solutions for aws elastic ip, ec2 instance, public ip,route53 pricing, load balancers in aws,Orchestration, ebs,, lambda, installing mongodb on ubuntu etc.

Monday 7 August 2017

conda install traitlets tornado jinja2 sqlalchemy 

conda: command not found

Permission error- Unable to ssh into Amazon EC2 instance



ssh -i ec2-instance-cert.pem root@publicip or public dns
@@@@@@@@@@@@@@@@@@@@@@@@######@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ ###        WARNING: UNPROTECTED PRIVATE KEY FILE! ###   @
@@@@@@@@@@@@@@@@@@@@@@@@######@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Permissions 0644 for 'test.pem' are too open.
It is required that your private key files are NOT accessible by others.


Solution :
key must not be publicly viewable for SSH to work. Use this command if required

$ chmod 400 ec2-instance-cert.pem


Sunday 6 August 2017

Mongoose

It is an object modeling tool for nodejs that connects MongoDB.Mongoose take the models and maps them to MongoDB database.

install required dependencies
npm install mongoose

var mongoose = require('mongoose');



/*without callback */
mongoose.connect('localhost','mydatabase');

/* with callback */ create a connection object and bind two callabcks.

var db = mongoose.connection;
db.on('open',function callback(){
//connection success
});
db.on('error',function(msg){
//connection error
});

Schema Creation :

var empSchema = mongoose.Schema({
name: String,
designation : String,
location: String,
Skills: String
});

Model Creation :

var Employee =  mongoose.model('employee',empSchema);

Saving the model :

employee.save(function(err,emp){
if(err){
//error handling
}else{
//success
}
});

Reading the model :

var Employee =  mongoose.model('employee',empSchema);

Employee.find(function(err,emp){
if(err){
//error handling
}else{
//success
}
});

Reading specific model :


Employee.find({name:'SrinivasNidadavolu'},function(err,emp){
if(err){
//error handling
}else{
//success
}
});

output:

[{name:'SrinivasNidadavolu',designation:'software engineer',location:'building number 14,Raheja Mindpsace, Hyderabad',Skills:'Java,C++,AWS,AZURE,Containers,cloud specialist'}]

Elastic Load Balancing

Elastic Load Balancing automatically distributes the incoming application traffic across multiple was ec2 instances.

Two types of load balancers :
Application Load Balancer
Classic Load Balancer

Elastic Load Balancing :
It is in-region load balancing service and distributed traffic  across multiple availability zones -HTTP/S, TCP/S.
Fully fault tolerant
Buit in health check













Application Load Balancer Features:
• It has Containerized Application Support
• It has Content-Based Routing
• It support for  HTTP/2
• Contains Delete Protection
• Supports WebSockets
• Supports Layer-7 Load Balancing
• Supports Web Application Firewall (WAF)
• Contains Request Tracing

Classic Load Balancer Features:
• Contains Health Checks
• It has High Availability
• Supports Security Features
• Supports Sticky Sessions
• Supports SSL Offloading
• Support for Layer 4 or 7 Load Balancing
• It has Operational Monitoring
• provides Logging
• provides IPv6 Support

Saturday 5 August 2017

Creating Database MongoDB


MongoDB is document based database.
Creating Database NodeJS - MongoDB

Once mongoDB is up and running,

var mongoDB =  require('mongodb');


var mydbserver =  new mongodb.server('localhost', 27017, {auto_reconnect:true});

/* new mongodb.Db() creates a new database */
/* w:1 sets the write concern */

var database =  new mongodb.Db('eCommerceDb',mydbserver, {w:1});



Collections :

Relational databases uses tables to store data. MongoDB stores data as document format uses collection. It is NoSql type database.

Collections are represented as JSON format.

Tuesday 1 August 2017

Installing MongoDB


Mac Installation :

The easy way to install MongoDB is by using package manager like Homebrew  or MacPorts.
$ sudo brew install mongodb
or 
sudo port install mongodb
Setup the data directory
sudo mkdir -p /data/db
setup appropriate permissions
$ sudo chown 'id -u' /data/db
Ubuntu Installation :
To authenticate apt-get package, install the public GPG key from MongoDB creators.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10

create a file /etc/apt/sources.list.d/10gen.list  and  add the below text

deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
Install latest stable build of MongoDB
$ sudo apt-get update
$ sudo apt-get install mongodb-10gen
Windows Installation :
Download the latest stable build from https://www.mongodb.com/download-center#community
Make sure appropriate version 64 bit or 32 bit
Install with the installation file.
create the data directory 
mkdir data
mkdir data\db
Running MongoDB
On Mac :


mongod
On Ubuntu :
$ sudo service mongodb start
On Windows :
c:\mongodb\bin\mongod.exe












Monday 31 July 2017

Features of MongoDB

One of the  main reasons  to use NOSQL database is built in sharing capabilities.
Sharing allows to distribute single database across cluster of machines.

It means, distribute the load rather than purchasing the large server. 
Sharing also help in server handling big data. The data stored in database is increasing exponentially. 
Some databases are very large for each server. So distribution across cluster is necessary. 


No sql databases are lot easier to maintain with the administration tools.

It also supports aggregation (Batch data processing ) and aggregate calculations using the native operations.
It is a schema less database.
It supports map reduce (Large volume of data into useful aggregated data.)
It also supports geospatial and secondary indexes on the collections.

Indexes are efficient execution of queries.Create a simple and complex indexes which will be used for speeding up the query execution.

Labels

Online Training

Your Name :
Your Email: (required)
Your Message: (required)

Powered by Blogger.

Recent Posts

Find Us On Facebook

Popular Posts