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.

Wednesday, 31 May 2017

AWS EC2 - Install Docker on Ubuntu

These are the steps for installing docker on Ubuntu machine.  

    1  sudo apt-get update
    2  sudo apt-key adv --keyserver hkp:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
    3  sudo apt-add-repository 'deb ubuntu-xenial main'
    4  sudo apt-get update
    5  apt-cache policy docker-engine
    6  sudo apt-get install -y docker-engine
    7  sudo systemctl status docker
    8  docker
   9  docker info
   10  sudo docker info
   11  docker run hello-world
   12  sudo docker run hello-world
   13  docker search ubuntu
   14  sudo docker search ubuntu
   15  history

Tuesday, 30 May 2017

There is insufficient memory for the Java Runtime Environment to continue AWS Ec2

docker run --rm -p .........
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 715849728 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /usr/zeppelin/hs_err_pid1.log
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000d5550000, 715849728, 0) failed; error='Cannot allocate memory' (errno=12)
[root@centos-1gb-sgp1-01 ~]# java -Xmx2G -Xms2G

-bash: java: command not found

solution : 
There isn't enough RAM for the Java program to run. please check your ram size

Monday, 29 May 2017

Install Docker in AWS EC2

This article will help you to install docker in centOS version or RHEL version of linux.

Install the Docker from official Docker repository

$ sudo yum check-update

$ curl  curl -fsSL | sh

Once docker installed, start the Docker daemon

sudo systemctl start docker

To check the docker status

$ sudo systemctl status docker

start the docker at the server reboot

$ sudo systemctl enable docker

sudo systemctl enable docker

Created symlink from /etc/systemd/system/ to /usr/lib/systemd/system/docker.service.

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">
    <rule name="HTTPS rewrite behind ELB rule" stopProcessing="true">
      <match url="^(.*)$" ignoreCase="false" />
        <add input="{HTTP_X_FORWARDED_PROTO}" pattern="^http$" ignoreCase="false" />
      <action type="Redirect" redirectType="Found" url="https://{SERVER_NAME}{URL}" />
If your using Apache,

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

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='', type='CNAME'] but it already exists]
  message: 'Tried to create resource record set [name=\'\', 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.


Online Training

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

Powered by Blogger.

Recent Posts

Find Us On Facebook

Popular Posts