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 28 May 2017

AWS DynamoDB vs AWS S3

When to use aws dynamodb

It depends on your use case for the application and type of data. If you want to use it for the real apps, use dynamodb.
DynamoDb is good for storing structured data. It has some limits in the storage size but it has very high access speed.

S3 storage is good for storing files.It cloud be read over http with REST Api. If you want to update images or some files, you can go with AWS S3.

When you create an image for the ec2 instance, it will be stored in AWS S3. It is very cheap.
If you want to upload user data with image, you can store image in s3 and store the image link in the dynamodb along with the data.



Saturday 27 May 2017

Http to Https redirection for ec2 instance

If you want traffic coming to web server redirect to https without change the backed listener to port 443,
ELB supports a HTTP header called X-FORWARDED-PROTO. you can force the http to https redirection by writing simple rule.
If your using IIS,
<rewrite xdt:Transform="Insert">
  <rules>
    <rule name="HTTPS rewrite behind ELB rule" stopProcessing="true">
      <match url="^(.*)$" ignoreCase="false" />
      <conditions>
        <add input="{HTTP_X_FORWARDED_PROTO}" pattern="^http$" ignoreCase="false" />
      </conditions>
      <action type="Redirect" redirectType="Found" url="https://{SERVER_NAME}{URL}" />
    </rule>
  </rules>
</rewrite>
If your using Apache,

<VirtualHost *:80>
    RewriteEngine On
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [NE]
</VirtualHost>

If your using NGINX,
server {
    listen 80;
    location / {
        if ($http_x_forwarded_proto != 'https') {
            return 301 https://$server_name$request_uri;
        }
        try_files $uri $uri/ /index.php?$args;
    }
}

Friday 26 May 2017

Strategy of Amazon Route 53


  • With Amazon Route 53 , you can manage domain names, register the domain names and pay yearly charge for each domain name registered via Route 53.
  • It provides DNS queries for mapping subdomain with public ip. For example, you registered a domain with Route 53, you want to create subdomain dynamically, aws provides api for creating subdomains, you don't pay any upfront fees, like  all other aamazon services, you pay as you go. You will get charges for hosted zones you configure and every DNS query answered by Route53.
  • Check the health of your resources created.



Tuesday 16 May 2017

aws route53 Tried to create resource record set type=\'CNAME\'] but it already exists'

{ [InvalidChangeBatch: Tried to create resource record set [name='demotest3d.test.com.', type='CNAME'] but it already exists]
  message: 'Tried to create resource record set [name=\'demotest3d.test.com.\', type=\'CNAME\'] but it already exists',
  code: 'InvalidChangeBatch',
  time: Wed May 17 2017 13:05:26 GMT+0800 (Malay Peninsula Standard Time),
  requestId: '7684460-3abe-11e7-b5fe-5bc5fdddcbjcxdb52370',
  statusCode: 400,


Solution : Subdomain already exists. Check in route53.

Wednesday 10 May 2017

Installing Nodejs in Redhat in aws

1. Run this command to setup required components before installing nodejs
sudo rpm -Uvh https://rpm.nodesource.com/pub_4.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm


2. Then install Nodejs
sudo yum install nodejs

3. Check nodejs installed version 

node --version


 sudo rpm -Uvh https://rpm.nodesource.com/pub_4.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm
Retrieving https://rpm.nodesource.com/pub_4.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm
warning: /var/tmp/rpm-tmp.hOuTrS: Header V3 RSA/SHA1 Signature, key ID 34fa74dd: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:nodesource-release-el7-1         ################################# [100%]
[ec2-user@ip- ~]$ sudo yum install nodejs
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
epel/x86_64/metalink                                     | 6.3 kB     00:00
nodesource                                               | 2.5 kB     00:00
pgdg93                                                   | 4.1 kB     00:00
rhui-REGION-client-config-server-7                       | 2.9 kB     00:00
rhui-REGION-rhel-server-optional                         | 3.5 kB     00:00
rhui-REGION-rhel-server-releases                         | 3.5 kB     00:00
rhui-REGION-rhel-server-rh-common                        | 3.8 kB     00:00
rhui-REGION-rhel-server-supplementary                    | 3.4 kB     00:00
(1/3): nodesource/x86_64/primary_db                        |  59 kB   00:00
(2/3): rhui-REGION-rhel-server-supplementary/7Server/x86_6 |  45 kB   00:00
(3/3): rhui-REGION-rhel-server-supplementary/7Server/x86_6 | 230 kB   00:00
Resolving Dependencies
--> Running transaction check
---> Package nodejs.x86_64 1:6.10.1-2.el7 will be installed
--> Processing Dependency: npm = 1:3.10.10-1.6.10.1.2.el7 for package: 1:nodejs-6.10.1-2.el7.x86_64
--> Processing Dependency: libuv >= 1:1.9.1 for package: 1:nodejs-6.10.1-2.el7.x86_64
--> Processing Dependency: libuv.so.1()(64bit) for package: 1:nodejs-6.10.1-2.el7.x86_64
--> Running transaction check
---> Package libuv.x86_64 1:1.10.2-1.el7 will be installed
---> Package npm.x86_64 1:3.10.10-1.6.10.1.2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package       Arch          Version                          Repository   Size
================================================================================
Installing:
 nodejs        x86_64        1:6.10.1-2.el7                   epel        4.6 M
Installing for dependencies:
 libuv         x86_64        1:1.10.2-1.el7                   epel        109 k
 npm           x86_64        1:3.10.10-1.6.10.1.2.el7         epel        2.5 M

Transaction Summary
================================================================================
Install  1 Package (+2 Dependent packages)

Total download size: 7.3 M
Installed size: 26 M
Is this ok [y/d/N]: y
Downloading packages:
(1/3): libuv-1.10.2-1.el7.x86_64.rpm                       | 109 kB   00:02
(2/3): npm-3.10.10-1.6.10.1.2.el7.x86_64.rpm               | 2.5 MB   00:08
(3/3): nodejs-6.10.1-2.el7.x86_64.rpm                      | 4.6 MB   00:16
--------------------------------------------------------------------------------
Total                                              447 kB/s | 7.3 MB  00:16
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : 1:libuv-1.10.2-1.el7.x86_64                                  1/3
  Installing : 1:npm-3.10.10-1.6.10.1.2.el7.x86_64                          2/3
  Installing : 1:nodejs-6.10.1-2.el7.x86_64                                 3/3
  Verifying  : 1:libuv-1.10.2-1.el7.x86_64                                  1/3
  Verifying  : 1:nodejs-6.10.1-2.el7.x86_64                                 2/3
  Verifying  : 1:npm-3.10.10-1.6.10.1.2.el7.x86_64                          3/3

Installed:
  nodejs.x86_64 1:6.10.1-2.el7

Dependency Installed:
  libuv.x86_64 1:1.10.2-1.el7        npm.x86_64 1:3.10.10-1.6.10.1.2.el7

Complete!
[ec2-user@ip-172-31-4-45 ~]$ node --version
v6.10.1



curl -sL https://rpm.nodesource.com/setup | bash -

================================================================================
================================================================================

                           SCRIPT DEPRECATION WARNING

  This script, located at https://rpm.nodesource.com/setup, used to
  install Node.js v0.10, is being deprecated and will eventually be made
  inactive.

  You should use the script that corresponds to the version of Node.js you
  wish to install. e.g.

   * https://rpm.nodesource.com/setup_4.x — Node.js v4 LTS "Argon" (recommended)
   * https://rpm.nodesource.com/setup_6.x — Node.js v6 Current

  Please see https://github.com/nodejs/LTS/ for details about which version
  may be appropriate for you.

  The NodeSource Node.js Linux distributions GitHub repository contains
  information about which versions of Node.js and which Linux distributions
  are supported and how to use the install scripts.
    https://github.com/nodesource/distributions

================================================================================
================================================================================

Continuing in 10 seconds (press Ctrl-C to abort) ...


## Installing the NodeSource Node.js v0.10 repo...


## Inspecting system...

+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release
+ uname -m

## Confirming "el7-x86_64" is supported...

+ curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_0.10/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Downloading release setup RPM...

+ mktemp
+ curl -sL -o '/tmp/tmp.YqE52h2nSA' 'https://rpm.nodesource.com/pub_0.10/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Installing release setup RPM...

+ rpm -i --nosignature --force '/tmp/tmp.YqE52h2nSA'
error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)
Error executing command, exiting
[ec2-user@ip-172-31-4-45 ~]$ sudo curl -sL https://rpm.nodesource.com/setup | bash -

================================================================================
================================================================================

                           SCRIPT DEPRECATION WARNING

  This script, located at https://rpm.nodesource.com/setup, used to
  install Node.js v0.10, is being deprecated and will eventually be made
  inactive.

  You should use the script that corresponds to the version of Node.js you
  wish to install. e.g.

   * https://rpm.nodesource.com/setup_4.x — Node.js v4 LTS "Argon" (recommended)
   * https://rpm.nodesource.com/setup_6.x — Node.js v6 Current

  Please see https://github.com/nodejs/LTS/ for details about which version
  may be appropriate for you.

  The NodeSource Node.js Linux distributions GitHub repository contains
  information about which versions of Node.js and which Linux distributions
  are supported and how to use the install scripts.
    https://github.com/nodesource/distributions

================================================================================
================================================================================

Continuing in 10 seconds (press Ctrl-C to abort) ...


## Installing the NodeSource Node.js v0.10 repo...


## Inspecting system...

+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release
+ uname -m

## Confirming "el7-x86_64" is supported...

+ curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_0.10/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Downloading release setup RPM...

+ mktemp
+ curl -sL -o '/tmp/tmp.lEXvKWHzpI' 'https://rpm.nodesource.com/pub_0.10/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Installing release setup RPM...

+ rpm -i --nosignature --force '/tmp/tmp.lEXvKWHzpI'
error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)
Error executing command, exiting

Wednesday 3 May 2017

Unable to run yum list

 Unable to run yum info, yum list , i got the follwoing issues


Could not contact any CDS load balancers: rhui2-cds01.ap-southeast-1.a

RHEL on AWS ec2 missing the following packages

sudo yum install httpd24 php56 mysql55-server php56-mysqlnd
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
No package httpd24 available.
No package php56 available.
No package mysql55-server available.
No package php56-mysqlnd available.
Error: Nothing to do

Labels

Online Training

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

Powered by Blogger.

Recent Posts

Find Us On Facebook

Popular Posts