Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Thursday, June 26, 2014

Oracle Amazon Linux updates

The Amazon Linux AMI repositories are available in S3, configured such that instances with EC2 IP addresses can access the repositories and download packages onto the Amazon Linux AMI instances.  Once a package has been downloaded from the Amazon Linux AMI repository to an instance, any further actions taken with that package are up to the customer who launched the instance.

Thursday, May 22, 2014

Oracle Database Huge Pages

Oracle DBAs will use Oracle Hug pages to increase Oracle database performance : http://docs.oracle.com/cd/E11882_01/server.112/e10839/appi_vlm.htm#UNXAR394

The only requirement for huge-pages (2MB pages) is that you run a HVM instance. However, all the Oracle AMIs are PVM.

For now to use huge pages with Oracle on EC2,  the best option would be to go with SUSE HVM AMI and then install the Oracle Database on the EC2 instance. 

Monday, March 31, 2014

HVM and PVM : Oracle AMIs

AWS AMIs are either Para Virtual Machine (PVM) or Hardware Virtual Machine (HVM) images. All of the AMIs from Oracle are currently only PVM-based. Therefore, they will not run on cluster compute or i2 instance types.

More information on HVM-based instances types:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cluster_computing.html#concepts_cluster_compute_hvmAMI
http://aws.amazon.com/ec2/faqs/#Does_use_of_Cluster_Compute_Instances_differ_from_other_Amazon_EC2_instance_types

Currently, the new i2 instance types are HVM only:
http://aws.amazon.com/about-aws/whats-new/2013/12/19/announcing-the-next-generation-of-amazon-ec2-high-i/o-instance/

More on HVM and PVM can be found here:
http://serverfault.com/questions/222010/difference-between-xen-pv-xen-kvm-and-hvm

If you are looking to run Oracle solutions on Oracle Enterprise Linux and require more then 68 GB of memory, you would have to run on hs1.8xlarge (117 GiB) as all other instance types with more then 68 GB are HVM. See more here: http://aws.amazon.com/amazon-linux-ami/instance-type-matrix/

Sunday, March 30, 2014

AWS CLI multiple profiles

When using the AWS CLI, you may be working with multiple AWS accounts.  Therefore, you will want to have multiple profiles.  The profile configuration file is contained in the ~/.aws/config on Linux, OS X, or Unix.  In this file, you will list all of your profiles. At the command prompt or in your .profile file you can have do the following to chose the profile you would like:
export AWS_DEFAULT_PROFILE=<profilename>

Sunday, March 23, 2014

Installing PHP and AWS PHP SDK on Mac

Many instructions for PHP and AWS PHP SDK installation and configuration assume deep knowledge of PHP and ability to locate configuration files.

To get the AWS PHP SDK, you first need to get PHP running on Mac.  PHP comes preinstalled but not running, here is how to get it running:
1. Modify https.conf in directory /private/etc/apache2.
2. To change this file, you need to have access as root or super user.  I attempted to su - root and sudo vi but this did not work as not supported on Mac. I had to sudo su as specified here: http://serverfault.com/questions/43362/su-not-working-on-mac-os-x
4. Test if PHP is running.  
a. First need to create php.info file in eh DocumentRoot directotoy.  The default directory (DocumentRoot) on the Mac is "/Library/WebServer/Documents". You can always check: /private/etc/apache2/httd.conf to find the DocumentRoot directory.
The php.info looks like:
            <php phpinfo(); ?>


Some good information here: http://www.php.net/manual/en/install.macosx.bundled.php

b. Test using this in browser: http://localhost/info.php

6. Install AWS PHP SDK using Composer. The instructions are here: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/installation.html
Follow these instructuions with these caveats/changes. 
WARNING: Be careful where you run the install from. I ran from /private/etc and my AWS SDK was installed in /private/key/vendor.  So my AWS PHP SDK is here:  /private/etc/vendor/aws/aws-sdk-php
a. During this step-  curl -sS https://getcomposer.org/installer | php,
you will get this error. 
#!/usr/bin/env php
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:

The detect_unicode setting must be disabled.
Add the following to the end of your `php.ini`:
            detect_unicode = Off

A php.ini file does not exist. You will have to create one.
The file is in /private/etc/php.ini. You can copy /private/etc/php.ini.default to /private/etc/php.ini and then modify php.ini to add detect_unicode = Off.
Note: You need to be su and also need to chmod 666 to the php.ini file to be able to edit it.

b. If you try this command "php composer.phar install", you will probably get this error unless you did the first step. So do the first step, if not done.  It does not tell you this in instructions but file needs to be here: /private/etc

The instructions for testing the installation are here:
http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SettingUpTestingSDKPHP.html.  I did the test for DynamoDB as this what I was going to be using.
1.The following is an example of such a configuration file, named config.php:
This file can be placed anywhere. I decided to put it here: /private/etc/vendor/aws/aws-sdk-php

1. The instructions tell you to execute these commands (it may appear as thought they need to be issued from the command prompt, this is not the case):
use Aws\DynamoDb\DynamoDbClient;
// Instantiate the client with your AWS access keys
$aws = Aws\Common\Aws::factory('./config.php');
$client = $aws->get('dynamodb');
This actually needs to be in a php file:
<?php
use Aws\DynamoDb\DynamoDbClient;
// Instantiate the client with your AWS access keys
$aws = Aws\Common\Aws::factory('/private/etc/vendor/aws/aws-sdk-php/config.php');
$client = $aws->get('dynamodb');
?>

When you run the test php fle (“php test.php”, or whatever you called it), you will get the error: PHP Fatal error:  Class 'Aws\Common\Aws' not found in /private/etc/vendor/aws/aws-sdk-php/dynamodb/test.php on line 

You need to add this line to all you php files:
1.require '/private/etc/vendor/autoload.php';
This is actually documented here but unless you know PHP makes no sense:
http://docs.aws.amazon.com/aws-sdk-php/guide/latest/installation.html


Your updated test.php file will look like this:

            <?php
            require '/private/etc/vendor/autoload.php';
use Aws\DynamoDb\DynamoDbClient;
// Instantiate the client with your AWS access keys
$aws = Aws\Common\Aws::factory('/private/etc/vendor/aws/aws-sdk-php/config.php');
$client = $aws->get('dynamodb');
?>


2. Also change line “$aws = Aws\Common\Aws::factory("./config.php");” to point to location of configuration file.  In my case, you can see the change made above: Aws\Common\Aws::factory('/private/etc/vendor/aws/aws-sdk-php/config.php');

Monday, August 12, 2013

Oracle MySQL Connect session time set

The session I am co-presenting at has been set for this time and place:

Session ID: CON4513
Session Title: Best Practices for Deploying MySQL on Amazon Web Services
Venue / Room: Hilton - Powell
Date and Time: 9/21/13 (Saturday), 16:00 - 17:00

Hope to see you there.

Monday, July 22, 2013

Moving EBS volumes between Linux and Windows


EBS volumes are portable between instances running different operating systems but this does not mean the underlying file system format will be compatible.  EBS is a block level storage device.  The volume must be formatted with a file system which may or may not run across different EC2 instances based upon the OS of the instance.

Moving between Linux and Windows file formatted EBS formatted volumes were most of the compatible issues may arise. NTFS and EXT4 are some of the most common file system formats.  

An option is to used NTFS as your 'master' file system.  Then use a utility like ntfsprogs (http://en.wikipedia.org/wiki/Ntfsprogson) to use the EBS volume for both Windows and Linux instances. If you don't need writing on Linux, you can mount the NTFS drive and read it on Linux . Linux can natively read NTFS but it can not write to NTFS drives natively.  

The other option is to use EXT4 (or another Linux file system) as your 'master' file system. For example, EXT4 is not natively supported on Windows.  Good discussion here:

Also, ext2fsd  (http://www.ext2fsd.com)  a proven solution for reading EXT4 from Linux.  For those that don't need NTFS, sharing filesystems between Windows and Linux can be done using exFAT. Another potential solution that supports reading and writing to NTFS on Linux is: http://sourceforge.net/projects/ntfs-3g/

Tuesday, July 9, 2013

Oracle OEL AMIs running on cluster compute instances

AWS cluster compute instances types (cc1.4xlarge,cg1.4xlarge, cr1.8xlarge, cc2.8xlarge), all require to be run as HVM instances.  Currently, all the AMIs from Oracle are PVM only. Windows EC2 instances can only be HVM as PV does not support windows, so Windows AMIs or HVM based Linux AMIs can be used.

OVM based Oracle AMIs can also not be run on cluster compute instance types.

Saturday, June 29, 2013

Inheriting the Oracle user environment


Here is the command:

sudo –H –u oracle logbash –login

You must have permissions to sudo to “oracle” directly for this to work. This is preferred rather than sudo’ing to root and then su’ing to oracle (su - oracle)

Friday, June 7, 2013

EC2 instances adding SSH users



Each EC2 instance has a ec2-user user which can be used access (via SSH) the EC2 Linux instance.  You can add addition SSH users by following these instructions:  http://www.e-zest.net/blog/how-to-add-ssh-users-in-amazon-linux/


Friday, May 31, 2013

Oracle Linux and HVM AMIs

OEL is not supported on cr1.8xlarge. These instances run as HVM-base instances.  All Oracle AMIs are PVM.    For HVM you have to go with Windows, SUSE or RHEL for now. You can spin one of these up and install Oracle DB on them.  There are ways to convert a PV AMI to  HVM AMI, but whether Oracle will support you is another question.   This applies to the other cluster compute instances types as well: CC2 and CG1.  However, it is mostly likely someone wants to run the cr1 instance type as this is the largest memory footprint by far (244 GB).  This size instance is great for in memory databases or large EBusiness Suite/Fustion installations.  

Wednesday, May 15, 2013

EC2 (classic) instance hostname is not hostname and is not hostname


This is the results from wget and hostname at command line.
1. wget -q -O - http://169.254.169.254/latest/meta-data/public-hostname
Output ---> ec2-50-13-20-1.compute-1.amazonaws.com
2. wget -q -O - http://169.254.169.254/latest/meta-data/hostname
Output-->   ip-10-222-1-241.ec2.internal
3. wget -q -O - http://169.254.169.254/latest/meta-data/local-hostname
output--->ip-10-222-1-241.ec2.internal
4. wget -q -O - http://169.254.169.254/latest/meta-data/local-ipv4
output--->10.222.1.241
5. wget -q -O - http://169.254.169.254/latest/meta-data/public-ipv4
50.13.20.1
6. [root@wls1 ~]# hostname  ---> linux command line
wls1.labs.oracleweblogic.com

Someone changed the host name after boot or at boot time using user-data or another method.  Normally you would see:


1. wget -q -O - http://169.254.169.254/latest/meta-data/hostname
Output ---> ip-14-222-22-28.us-west-2.compute.internal

2. hostname: hostname ---> linux command line
ip-14-222-22-28


Monday, April 29, 2013

Determining if you are running Oracle VM on EC2


The question has come up on how to determine whether an EC2 instances started from an Oracle AMI is running OVM or Amazon Xen.  You can not find this out on the AWS management console.  You must use the AWS EC2 CLI.  The ec2-describe-instances command shows 'ovm' next to virtualization type (paravitual) or 'xen' of Amazon xen.

Wednesday, February 20, 2013

Running Oracle EBusiness Suite on AWS


A common question for Oracle EBusiness Suite users or potential users is 'Where do I get started?'.  Here is some information to help with:
  1. Where not to start :
  2. It is best to create your own AMI or using an existing Linux AMI:
  3. Instructions for installing Oracle EBusiness Suite vision demo
  4. Creating you own AMI 'gold imagine' 
  5. CloudFormation : You will want to use CloudFormation templates to automate the process of configuring the security groups, VPC, and the EC2 instances required:
  6. Test drives : The Oracle EBusiness Suite test drive labs are a great place to start:

Thursday, January 31, 2013

DNS Server, Gateway and subnet mask

When installing some software on AWS, the software package may ask for the DNS server ip address, default gateway IP address and the subnet mask.   If you are running windows, you can simply log into the Windows instance running on AWS using RDP and issue an ipconfig command. When running on Linux, you need to issue three different commands to get the information:
1. ‘ifconfig eth0’ (Subnet mask)
2.   ‘route –n | grep ‘UG[ \t]’ | awk ‘{print $2}’ (Default gateway IP)
3.  ‘cat /etc/resolv.conf’ (DNS Server)

Tuesday, October 16, 2012

AWS Boston User Group

Great session yesterday at Boston Amazon Web Services Meetup Group -
http://www.meetup.com/The-Boston-Amazon-Web-Services-Meetup-Group/

Glad to see the good attendance and the group back up and running.  

Here is the linked in group:
http://www.linkedin.com/groups?home=&gid=4651147&trk=anet_ug_hm

Tuesday, October 9, 2012

AWS EBS PIOPS volume creating tablespace

Creating you EBS volume and attaching it to your EC2 instance through the AWS console, CLI or APIs is just the first step in using this volume in your Oracle database.  If on Linux, you then need to format, create a mount point, and then mount your volume as follows:
1.mkfs -t ext3 /dev/sdg
2. mkdir /mnt/oracle1000
3. mount /dev/sdg /mnt/oracle1000
(Remember to give permissions - chmod - to oracle user on your mount point)
 More information on mounting EBS volumes can be found here:
http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html

To check if the device has been mounted properly, you can issue these commands:
-  df -l
-  mount

To insure that your EBS volumes get mounted at start up time, you can add the device mapping to the /etc/fstab file

Then the Oracle tablespace needs to be created.  This is done using the following command:
This is for creating a tablespace larger then the Oracle standard limits:
create bigfile tablespace datapiops1k
datafile '/mnt/oracle1000/bigfiledata.dbf'
size 600G;