Showing posts with label aws. Show all posts
Showing posts with label aws. Show all posts

Friday, August 14, 2015

How To Set Up GUI On Amazon EC2 Ubuntu server?(101/285 technotes for 2015).

This was published in http://bit.ly/1LaP9tT. Based on the comments and minor changes (maked in bold) the below worked for me.

-------------------------------

This can be done. Following are the steps to setup the GUI

* Create new user with password login

How To Set Up GUI On Amazon EC2 Ubuntu server?(101/285 technotes for 2015).

This was published in http://bit.ly/1LaP9tT. Based on the comments and minor changes (maked in bold) the below worked for me.


This can be done. Following are the steps to setup the GUI

* Create new user with password login

sudo useradd -m awsgui
sudo passwd awsgui
sudo usermod -aG admin awsgui
su - awsgui

sudo vim /etc/ssh/sshd_config # edit line "PasswordAuthentication" to yes

sudo /etc/init.d/ssh restart

* Setting up ui based ubuntu machine on AWS.

* In security group open port 5901. Then ssh to the server instance. Run following commands to install ui and vnc server:

sudo apt-get update
sudo apt-get install ubuntu-desktop
sudo apt-get install vnc4server

* Then run following commands and enter the login password for vnc connection:

vncserver

vncserver -kill :1

vim awsgui/.vnc/xstartup

* replace the text with the text below (make sure u have a copy)

#!/bin/sh
def
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &

* When you’re done, hit Ctrl + C on the keyboard, type :wq and hit Enter.

* Restart the server

* Then start vnc server again.

vncserver

In the vnc client, give public DNS plus “:1” (e.g. www.example.com:1) or private ip address. Enter the vnc login password. Make sure to use a normal connection. Don’t use the key files.

Wednesday, May 13, 2015

Importing Image into AWS as an AMI using AWS CLI. (84/285 technotes for 2015)

Importing an external image into AWS requires the steps below.

aws ec2 help

  • Download the VM image from its current environment as an OVA file (or VMDK, VHD, or RAW).
  • Upload the VM image to S3 using the web console. Goto S3 –> choose / create a bucket and upload the VM file.
image
image


  • Once the VM image is uploaded, import your VM using the ec2 import-image command.

aws ec2 import-image –cli-input-json “
{  "Description": "Datapower OVA",
    "DiskContainers": [
          { "Description": "First CLI task",
            "UserBucket": 

             { "S3Bucket": "datapower-bucket", 

               "S3Key" : "rel_agoradco_nonpd_xen.vhd" 

           }
        } ]
}”

  • Use the ec2 describe-import-image-tasks command to monitor the import progress.

aws ec2 describe-import-image-tasks –import-task-ids import-ami-fgifmh5x

  • Once your import task is completed, you can use the ec2 run-instances command to create an Amazon EC2 instance from the AMI generated during the import process.

References:

Wednesday, April 29, 2015

What is ENI (Elastic Network Interface) in AWS? (72/285 technotes for 2015)

Elastic Network Interface is a Virtual Network Interface that you can attach to an instance in VPC.

NIC - A network interface is the point of interconnection between a computer and a private or public network. A network interface is generally anetwork interface card (NIC), but does not have to have a physical form. Instead, the network interface can be implemented in software.

For eg: Loop back address or 127.0.0.1 is not a physical device - but a software simulating a network device



References:

http://bit.ly/1bEtFc0

What is Reverse DNS for email applications? (71/285 technotes for 2015)

If you plan to send email from one of the instances

When should we use instances with multiple IP addresses? (70/285 technotes for 2015)

It can be useful to have multiple IP addresses to your instance in VPC to do the following

  • Host multiple websites on a single server by using multiple SSL Certificates on a single server and associating each server with a specific ip address.
  • Operate network appliances, such as firewalls and load balancers that have multiple private ip addresses for each network interface
  • Redirect internal traffic to a standby inatance in case your instance fails by re-assigning the secondary private ip address to the standby instance

References:

http://amzn.to/1zq6M7g

What is a Network ACL? (69/285 technotes for 2015)



A network ACL is an optional layer of security that acts as a firewall for controlling traffic in and out of a subnet.


What is an Amazon VPC? (68/285 technotes for 2015)

Amazon VPC (Virtual Private Cloud) is a 

  • virtual network 
  • Logically isolated area in the AWS cloud

Benefits: By launching your instances in VPC

  • Assign static IP addresses
  • Assign multiple IP addresses
  • Define Network Interfaces and attach multiple Network Interfaces
  • Change Security Group membership - while running
  • Control Outbound (egress) / Inbound (ingress) traffic from your instances
  • Add an additional layer of access control to your instance in the form of Network Access Control Lists (ACL)
  • Run your instance in a single-tenant hardware.
  • ELP is associated even when the instance is stopped
  • Assign private IP address from a range of private IP addresses
image


  • C1, C2, C3, C4 are EC2-Classic
    • C1, C2 - was launched by an account
    • C3, C4 - was alunched by a different account
    • Can communicate with each other
    • Access internet and other services such as S3 directly
  • V1, V2 are instances
    • V1 & v2 belong to different subnets in the same VPC
    • They were launched by the account that owns the VPC
    • No other accounts can launch instance in this VPC.
    • V1 & v2 can communicate with each other
    • V1 & v2 can communicate with C1-C4, S2 and Internet through the Internet Gateway


References:

http://amzn.to/1zpcw0Y

What is an IAM and IAM Role in AWS? (67/285 technotes for 2015)

IAM 

IAM (Identity and Access Management) is used to manage access to Compute, Storage, Database and Application Services in the AWS cloud.

image


  • Applications can sign their API requests with AWS Credentials.
  • Securely distribute your AWS credentials to the instances
  • Applications on those instances to sign requests - while protecting them from otehr users

Challenge - to securely distribute credentials across all instances - especially those created by AWS on your behalf - Spot Instances and Auto Scalling group.

IAM Roles

  • With IAM Roles applications can securely access AWS service API from EC2 instances. 
  • Now you can create IAM role, which has a set of permissions, and launch EC2 instances with the IAM role.


References:

https://www.youtube.com/watch?v=Ul6FW4UANGc

http://amzn.to/1zp4Cow

Trouble shooting working with roles

What is IAAS, PAAS and SAAS with examples? (66/285 technotes for 2015)

*** This is a very good discussion found in StackOevrflow - with little modification for my notes - you can find the actual discussion here***

IaaS, PaaS and SaaS are cloud computing service models 

IaaS (Infrastructure as a Service), as the name suggests, provides you the computing infrastructure, physical or (quite often) virtual machines and other resources like virtual-machine disk image library, block and file-based storage, firewalls, load balancers, IP addresses, virtual local area networks etc. 

  • Amazon EC2, S3, EBS, ELB, VPC, Route53

  • Windows Azure, 
  • Rackspace, 
  • Google Compute Engine.

PaaS (Platform as a Service) - , as the name suggests, provides you computing platforms which typically includes operating system, programming language execution environment, database, web server etc. 

  • Aamzon

    RDS, Elastic Beanstalk, Dynamo DB, RedShift

  • Windows Azure, 
  • Heroku, 
  • Force.com, 
  • Google App Engine, 
  • Apache Stratos.

While in SaaS (Software as a Service) model you are provided with access to application softwares often referred to as on-demand softwares. You don’t have to worry about the installation, setup and running of the application. Service provider will do that for you. You just have to pay and use it through some client. 

  • Google Apps, 
  • Microsoft Office 365.


Few additional points regarding your question:

1- AWS(Amazon web services) is a complete suite which involves a whole bunch of useful web services. Most popular are EC2 and S3 and they belong to IaaS service model.

2- Although Hadoop is based on previous works by Google(GFS and MapReduce), it is not from Google. It is an Apache project. You can find more here. It is just a distributed computing platform and does not fall into any of these service models, IMHO.

3- Microsoft’s Windows Azure is again an example of IaaS.

As far as popularity of these services is concerned, they all are popular. It’s just that which one fits into your requirements better. For example, if you want to have a Hadoop cluster on which you would run MapReduce jobs, you will find EC2 a perfect fit, which is IaaS. On the other hand if you have some application, written in some language, and you want to deploy it over the cloud, you would choose something like Heroku, which is an example of PaaS.

References:

StackOverflow - http://bit.ly/1AgaDP3

Tuesday, April 28, 2015

What is a default Security Group in AWS? (64/285 technotes for 2015)

  • If an instance is created without specifying a Security Group, a default Security Group for the VPC will be automatically associated to the instance
  • Rules
    • Specifies itself as a source Security Group, This is what allows Inbound traffic only from other instances associated with the default Security Group.
    • Allow all outbound traffic from this instance.
  • You cant delete a default security group.

Security Groups and Security Rules in AWS. (63 of 285 technotes for 2015)

  • Security Group - acts as a virtual firewall that controls traffic for one or more instances.
  • You can add multiple Security Groups to a instance.
  • You can add multiple Rules to a Security Group.
  • The rules from different security groups and aggregated and applied to the instance.

Caution:

Because you can assign multiple rules to a security group, an instance can have hundreds of rules that apply. This can cause complexity. 

Suggestion:

Condense your rules as much as possible,

Saturday, April 25, 2015

Cannot ping a Elastic IP Address in AWS. (59 of 285 technotes for 2015)

Check the Security Group associated to the instance. Most likely the incoming rule for ICMP Echo Request is disabled.

Friday, April 24, 2015

What is Cloud Watch in AWS? (58 of 285 technotes for 2015)

Cloud Watch - collects, processes raw data from EC2, into readable, near realtime metrics.

The Analytics of CloudWatch is very limited. Librato is good option to add value to the data is generated from CloudWatch. 

image

Thursday, April 23, 2015

What is a NAT Instance? (54 of 285 technotes for 2015)



Instances that you launch into a private subnet in a virtual private cloud (VPC) can’t communicate with the Internet. 

You can optionally use a network address translation (NAT) instance in a public subnet in your VPC to enable instances in the private subnet to initiate outbound traffic to the Internet, but prevent the instances from receiving inbound traffic initiated by someone on the Internet.


References:

http://amzn.to/1aW2pVE

What is the Difference between EBS and S3? (53 of 285 technotes for 2015)

References:

What is the difference bettwen Elastic IP and Public IP? (52 of 285 technotes for 2015)



Elastic IP address - designed for dynamic cloud computing

  • static IP address
  • assigned to your account, until you release it.
  • there is a small hourly charge for EIP which is not associated to and instance, or if it is associated to an instance, but the instance is turned down.
  • EIP is limited to 5 per account
  • IPv4 static IP’s are very scare, so the limitation
  • EIP should be used only incase of Load Balancing and use DNS hostnames for all other internode communication
  • You can mask the failure of an instance by rapidly re-mapping the address to another instance of the account.

Public IP Address -

  • dynamically assigned IP Addresses
  • also given an external dns hostname
  • when launching an instance in VPC … public IP is determined by subnet setting
  • when an instance is stopped – public ip address is released to the Amazon’s pool of public addresses
  • public ip address is released when it is associated with EIP
  • if an instance is assigned an EIP, it automatically received a DNS hostname, if DNS hostname is enabled.

Best Practice  EIP (Static IP)

  • Internet IP Address is a scare public resource.
  • Use EIP for Load Balancers use case.
  • Use DNS hostnames for all internode communication.


References:

http://amzn.to/1aW1WCS

What is an AMI?(51 of 285 technotes for 2015)



Amazon Machine Image. Its a template that contains software configurations. From an AMI you can launch an Instance which is a virtual server running on the host computer in Amazon’s data center.

What is a Key Pair? (50 of 285 technotes for 2015)



AWS uses public key cryptography to secure login info. A Linux instance has no password. U use the key pair to login to the system. Steps: 

  • Mention the name of the key pair
  • Provide private key when u login to the system 

How is a private/public IP Address allocated to an Ec2 instance (48/285 technotes for 2015)

Private IP Address:

  • Launch an instance - private IP address is allocated using DHCP
  • Private IP address is not reachable from internet
  • Ecah instance has a default Network Interface - which specifies primary private IP address for the instance
  • You can specify additional priavate IP address
  • secondary IP address can be reassigned from one instance to another
  • each instance is provided an internal DNS name
  • DNS name is not resolvable from outside the network

Public IP Address:

  • Is assigned from a pool of Public IP address.
  • once de-associated, cannot be reused for the same instance
  • cannot manually associate/de-associate public ip address
    • when instance is stopped or terminated
    • instance associated with Elastic IP address
  • If you want the same IP address for the instance, use a Elastic IP address.