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.

Sunday, 23 July 2017

Docker Machine

It is a tool thats lets you install Docker Engine on virtual hosts.

It creates servers, installs docker and then configures the docker client to take to them.


Linux :

ubuntu@ip-192.33.33.22:~$ docker-machine ls
docker-machine: command not found

Install docker machine
$ curl -L https://github.com/docker/machine/releases/download/v0.12.1/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine &&
chmod +x /tmp/docker-machine &&
sudo cp /tmp/docker-machine /usr/local/bin/docker-machine

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   617    0   617    0     0    428      0 --:--:--  0:00:01 --:--:--   428
100 25.1M  100 25.1M    0     0   490k      0  0:00:52  0:00:52 --:--:-- 1211k

ubuntu@ip-192.33.33.22:~$ docker-machine version
docker-machine version 0.12.1, build c8b17e8

Example :

$ docker-machine create -d digitalocean --digitalocean-access-token=secret dev

$ docker-machine ls

NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER   ERRORS

dev   -          digitalocean   Running   tcp://253.1.113.91:4366             v1.8.9

Saturday, 15 July 2017

Install AWS Cli

Installing AWS Cli on Mac

Installing with Homebrew is easy. It is a popular package manager for MAC OSX.

To install Homebrew, 

Check , ruby is installed in your mac ,

ruby -v

Install homebrew 

Once homebrew installed, install python. To install Python, Gcc to be installed. you need xcode or commandline tools to be installed

you can download and install xcode or commandline tool.
https://developer.apple.com/download/more/

Step1 : brew install python
Install with Homebrew. It is a popular package manager for MAC OSX.
To install Homebrew, you must install xcode first.
Then install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew doctor
to check brew installed properly.
Step2 :pip install awscli
Terminal output is here
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
apache-arrow        freedink            ipython@5           overmind
asdf                get_iplayer         jose                packetq
bitcoin             git-cinnabar        kubectx             pycodestyle
dcm2niix            gradle-completion   libmypaint          rustup-init
docker2aci          grakn               libnice             tectonic
dwarf               haste-client        libopusenc          tokei
erlang@19           iamy                mruby-cli           vips
faas-cli            insect              neovim              wpscan
fd                  ipython             openfortivpn        zork
==> Updated Formulae
abcl                                     libextractor
advancemame                              libgcrypt
afflib                                   libgit2
afl-fuzz                                 libgit2-glib
allure                                   libgosu
amazon-ecs-cli                           libgphoto2
      zurl
libepoxy
==> Renamed Formulae
osh -> etsh                              speedtest_cli -> speedtest-cli
==> Deleted Formulae
kibana@4.1          node@0.10           node@0.12           snescom
==> Installing dependencies for python: sqlite
==> Installing python dependency: sqlite
==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.19.3.el_capitan.bo
######################################################################## 100.0%
==> Pouring sqlite-3.19.3.el_capitan.bottle.tar.gz
==> Using the sandbox
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS provides an older sqlite3.
If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.bash_profile
For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/sqlite/lib
    CPPFLAGS: -I/usr/local/opt/sqlite/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/sqlite/lib/pkgconfig
==> Summary
🍺  /usr/local/Cellar/sqlite/3.19.3: 12 files, 3MB
==> Installing python
Warning: Building python from source:
  The bottle needs the Apple Command Line Tools to be installed.
  You can install them, if desired, with:
    xcode-select --install
==> Downloading https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/python/2.7.13 --enable-ipv6 --dataroo
==> make
==> make install PYTHONAPPSDIR=/usr/local/Cellar/python/2.7.13
==> make frameworkinstallextras PYTHONAPPSDIR=/usr/local/Cellar/python/2.7.13/sh
==> Downloading https://files.pythonhosted.org/packages/26/d1/dc7fe14ce4a3ff3fae
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/11/b6/abcb525026a4be042b
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/c9/1d/bd19e691fd4cfe908c
######################################################################## 100.0%
==> /usr/local/Cellar/python/2.7.13/bin/python -s setup.py --no-user-cfg install
==> /usr/local/Cellar/python/2.7.13/bin/python -s setup.py --no-user-cfg install
==> /usr/local/Cellar/python/2.7.13/bin/python -s setup.py --no-user-cfg install
==> Caveats
Pip and setuptools have been installed. To update them
  pip install --upgrade pip setuptools
You can install Python packages with
  pip install <package>
They will install into the site-package directory
  /usr/local/lib/python2.7/site-packages
See: http://docs.brew.sh/Homebrew-and-Python.html
==> Summary
🍺  /usr/local/Cellar/python/2.7.13: 6,337 files, 86.7MB, built in 6 minutes 19 seconds
pip install awscli
Collecting awscli
  Downloading awscli-1.11.120-py2.py3-none-any.whl (1.2MB)
    100% |████████████████████████████████| 1.2MB 79kB/s 
Collecting botocore==1.5.83 (from awscli)
  Downloading botocore-1.5.83-py2.py3-none-any.whl (3.5MB)
    100% |████████████████████████████████| 3.6MB 23kB/s 
Collecting rsa<=3.5.0,>=3.1.2 (from awscli)
  Downloading rsa-3.4.2-py2.py3-none-any.whl (46kB)
    100% |████████████████████████████████| 51kB 43kB/s 
Collecting docutils>=0.10 (from awscli)
  Downloading docutils-0.13.1-py2-none-any.whl (537kB)
    100% |████████████████████████████████| 542kB 72kB/s 
Collecting PyYAML<=3.12,>=3.10 (from awscli)
  Downloading PyYAML-3.12.tar.gz (253kB)
    100% |████████████████████████████████| 256kB 181kB/s 
Collecting colorama<=0.3.7,>=0.2.5 (from awscli)
  Downloading colorama-0.3.7-py2.py3-none-any.whl
Collecting s3transfer<0.2.0,>=0.1.9 (from awscli)
  Downloading s3transfer-0.1.10-py2.py3-none-any.whl (54kB)
    100% |████████████████████████████████| 61kB 28kB/s 
  Running setup.py bdist_wheel for PyYAML ... done
  Stored in directory: /Users/srinivas/Library/Caches/pip/wheels/2c/f7/79/13f3a12cd723892437c0cfbde1230ab4d82947ff7b3839a4fc
Successfully built PyYAML
Installing collected packages: six, python-dateutil, docutils, jmespath, botocore, pyasn1, rsa, PyYAML, colorama, futures, s3transfer, awscli
Successfully installed PyYAML-3.12 awscli-1.11.120 botocore-1.5.83 colorama-0.3.7 docutils-0.13.1 futures-3.1.1 jmespath-0.9.3 pyasn1-0.2.3 python-dateutil-2.6.1 rsa-3.4.2 s3transfer-0.1.10 six-1.10.0

Thursday, 13 July 2017

Online training

We provide training on Amazon Web Services

1. AWS Architecture and different models of Cloud Computing 
2. Compute Services: AWS EC2, Auto Scaling and Load Balancing, AWS Lambda, Elastic Beanstalk
3. Storage Services : AWS S3, AWS EBS,  AWS Glacier, AWS CloudFront, Storage Gateway,AWS Snowball
4. Database Services: AWS RedShift, AWS RDS,  ElastiCache, AWS DynamoDB
5. Security and Identity Services: IAM, KMS
6. Networking Services: Route 53, Amazon VPC, Direct Connect

7. Management Tools: AWS CloudTrail, Trusty Advisor, AWS CloudWatch, CloudFormation, OpsWorks


We also provide training on Angular, NodeJS, MongoDB, MySQL, Android, iOS

you can reach us:    srinivas.n462@gmail.com. 

Wednesday, 12 July 2017

Installing MongoDB on Ubuntu 16.04

MongoDB is  included in Ubuntu package repositories, but official MongoDB repository provides most upto date version.

We use official version of MongoDB
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927

The output should look like this
ubuntu@ip-192-41-15-154:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
Executing: /tmp/tmp.u96cXK2VEb/gpg.1.sh --keyserver
hkp://keyserver.ubuntu.com:80
--recv
EA312927
gpg: requesting key EA312927 from hkp server keyserver.ubuntu.com
gpg: key EA312927: public key "MongoDB 3.2 Release Signing Key <packaging@mongodb.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)



We add MongoDB repository to Apt, so that apt know where to download the repository

echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
Output:
deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse
Update the Apt 
$ sudo apt-get update 
Output:
Hit:1 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Ign:3 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 InRelease
Get:4 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Get:5 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release [3,457 B]
Get:6 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg [801 B]
Get:7 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/main Sources [258 kB]
Get:8 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [573 kB]
Get:9 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [504 kB]
Ign:6 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg
Hit:10 http://ppa.launchpad.net/webupd8team/atom/ubuntu xenial InRelease
Get:11 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:12 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4/multiverse amd64 Packages [5,870 B]
Get:13 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4/multiverse arm64 Packages [5,872 B]
Fetched 1,658 kB in 1s (938 kB/s)
Reading package lists... Done
W: GPG error: http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AC711F9BA35703V6
W: The repository 'http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Install MongoDB

$ sudo apt-get install mongodb-org

Output:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
The following NEW packages will be installed:
  mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 66.8 MB of archives.
After this operation, 270 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
WARNING: The following packages cannot be authenticated!
  mongodb-org-shell mongodb-org-server mongodb-org-mongos mongodb-org-tools mongodb-org
Install these packages without verification? [y/N] Y
Get:1 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4/multiverse amd64 mongodb-org-shell amd64 3.4.6 [7,981 kB]
Get:2 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4/multiverse amd64 mongodb-org-server amd64 3.4.6 [14.2 MB]
Get:3 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4/multiverse amd64 mongodb-org-mongos amd64 3.4.6 [8,110 kB]
Get:4 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4/multiverse amd64 mongodb-org-tools amd64 3.4.6 [36.5 MB]
Get:5 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4/multiverse amd64 mongodb-org amd64 3.4.6 [3,556 B]
Fetched 66.8 MB in 3s (20.3 MB/s)
Selecting previously unselected package mongodb-org-shell.
(Reading database ... 108006 files and directories currently installed.)
Preparing to unpack .../mongodb-org-shell_3.4.6_amd64.deb ...
Unpacking mongodb-org-shell (3.4.6) ...
Selecting previously unselected package mongodb-org-server.
Preparing to unpack .../mongodb-org-server_3.4.6_amd64.deb ...
Unpacking mongodb-org-server (3.4.6) ...
Selecting previously unselected package mongodb-org-mongos.
Preparing to unpack .../mongodb-org-mongos_3.4.6_amd64.deb ...
Unpacking mongodb-org-mongos (3.4.6) ...
Selecting previously unselected package mongodb-org-tools.
Preparing to unpack .../mongodb-org-tools_3.4.6_amd64.deb ...
Unpacking mongodb-org-tools (3.4.6) ...
Selecting previously unselected package mongodb-org.
Preparing to unpack .../mongodb-org_3.4.6_amd64.deb ...
Unpacking mongodb-org (3.4.6) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up mongodb-org-shell (3.4.6) ...
Setting up mongodb-org-server (3.4.6) ...
Adding system user `mongodb' (UID 113) ...
Adding new user `mongodb' (UID 113) with group `nogroup' ...
Not creating home directory `/home/mongodb'.
Adding group `mongodb' (GID 118) ...
Done.
Adding user `mongodb' to group `mongodb' ...
Adding user mongodb to group mongodb
Done.
Setting up mongodb-org-mongos (3.4.6) ...
Setting up mongodb-org-tools (3.4.6) ...
Setting up mongodb-org (3.4.6) ...
Create mongodb.service configuration file
$ sudo nano /etc/systemd/system/mongodb.service
Start MongoDB as Daemon
$ sudo systemctl start mongod
Check status of MongoDB
$ sudo systemctl status mongod
Output:

 mongodb.service - High-performance, schema-free document-oriented database
   Loaded: loaded (/etc/systemd/system/mongodb.service; disabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-07-16 03:25:42 UTC; 1min 43s ago
 Main PID: 13102 (mongod)
    Tasks: 20
   Memory: 34.8M
      CPU: 408ms
   CGroup: /system.slice/mongodb.service
           └─13102 /usr/bin/mongod --quiet --config /etc/mongod.conf
Jul 13 03:25:42 ip-192-31-13-143 systemd[1]: Started High-performance, schema-free document-oriented database.

Enable process start for MongoDB when system reboot
$ sudo systemctl enable mongodb
Output:
Created symlink from /etc/systemd/system/multi-user.target.wants/mongodb.service to /etc/systemd/system/mongodb.service.

Tuesday, 11 July 2017

Amazon VPC




What is Aws VPC ?
VPC is a virtual private cloud or virtual private network which you can define on Amazon cloud and create logically isolated sections on amazon cloud  which supports IPv4 and IPv6 supports hardware VPN connections.
You can have full control of AWS architecture. We can control the selection of ip range.

With VPC, you can able to increase the capacity of existing on-premises infra for your organisation.
Launch the disaster recovery environment.
Launch the testing environment.
Serve the virtual desktop apps with your organisation.

Saturday, 8 July 2017

AWS DynamoDB



DynamoDB is no sql, fully managed database.
What is the difference between relational database and nosql database.

Relational database stores the data in table format where as no sql database stores the data as document for high scalability.
NoSQL database stores the data as key value.

There are many no sql database available in the market like mongodb, Cassandra, Redis etc.

What is the difference about DynamoDB.

With dynamoDB, you never worry about database maintanance and administration.

You can use the local version of DynamoDB to developer your app locally. Then use DynamoDB service to scale globally.

It is great for bigdata, gaming, mobile apps etc for high availability.
It takes backup with regular intervals.  You dont need to follow ACID properties.
It is accessed by web services.


AWS Lambda and Pricing


Lambda is a compute service where you can upload your code to and your code will be executed on your behalf using Amazon infrastructure.

Each piece of your code is called a function on the Lambda platform.Using Lambda is bit like porting your code to a server except that you don’t have to manage that and your don’t have to worry about scaling or availability.

Lambda functions can be written in Java, Python or Nodejs.

All the functions you upload to lambda are stateless.
All persistence data you can store using S3 and DynamoDB to store stateful information.

Lambda will automatically scale the  incoming events and scale back down when needed. There is no autoscaling is configured. Everything is automatically handled by Amazon.

How can we trigger a Lambda function ?
Lambda functions can be trigger by events from other AWS services.

For example, you can trigger a lambda function when a new file is uploaded to S3 bucket. You can also trigger through HTTP.

Pricing :

Free Tier Available
1M requests
3M seconds of compute time each and every month.
No usage -  no cost


First Lambda function in Nodejs

Go To AWS Console

Go to Compute Section and open Lambda

Choose runtime as NodeJS 4.3 , this is the latest stable version, please do not pick NodeJS older version - which is a legacy version.
We will go with simple hello-world function

Configure trigger section - we not going to set up triggers right now.
We just set up the function and in future, we are going to connect this function to api gateway.
Configure function section -
Name : Your function name    example: random-number-generator
Description : Simple Lambda function
Runtime : NodeJS 4.3


you have options here
you can edit the code, you can upload the code.
‘use strict’
exports.handler = (event, context, callback) =>{

console.log(‘value1=’,event.key1);
callback(null,event.key1);
};



Labels

Online Training

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

Powered by Blogger.

Recent Posts

Find Us On Facebook

Popular Posts