Guide to Online Casinos - www.Casino.us.org
Cloud Computing Tutorials For Beginners Free

Sunday, 3 July 2016

AWS-Cloudformation Template Model- Basic

    {
      "Resources": {
        "EC2Instance": {
          "Type": "AWS::EC2::Instance",
          "Properties": {
            "InstanceType": "m3.large",
            "SecurityGroupIds": ["sg-e456b68b"],
            "KeyName": "jenson_test",
            "ImageId": "ami-6bcfc42e",
            "AvailabilityZone": "us-west-1c",
            "Tags": [
              {
                "Key": "Name",
                "Value": "VM-Jensonapp-test"
              }
            ],
            "SubnetId": "subnet-5c49a939"
          }
        }
      }
    }


Oracle-Patching rollback

Rollback :

Perform below steps incase the patch applied but database/application is not working as expected.

1. Open command prompt in Administrator mode and perform the below :
    7.1) SET ORACLE_HOME=<PATH_OF_ORACLE_HOME>
    7.2) SET PATH=%ORACLE_HOME%\bin;%ORACLE_HOME%\OPatch\;%ORACLE_HOME%\perl\bin;%PATH%
    7.3) sqlplus / as sysdba
    7.4) shutdown immediatae
    7.5) exit
    7.6) cd d:\patches\21821802\
    7.7) opatch rollback -id 21821802
        7.7.1) Most probably rollback may fail if any files related to oracle are in use. Kill them manually.
    7.8) Inspect the opatch<timestamp>.log file generated in %ORACLE_HOME%\cfgtoollogs\opatch for any errors.
    7.9) When rollback complete, connect to the database and start the database and listener services from start -> run -> services.msc
    7.10) Inspect the opatch<timestamp>.log file generated in %ORACLE_HOME%\cfgtoollogs\opatch for any errors.

Oracle- Patching steps- Rollforward

Instructions to be applied for the databases running on version 11.2.0.4

Pre Release Activity :
======================

1. Take the backup of the complete database using data pumps.
2. Shutdown Apache & Tomcat Services in application host.
3. Check the invalid objects count in schema user by running the query
    sql> select object_name, object_type from user_objects where status='INVALID';


Rollforward :

1. Shutdown all the services related to Oracle by navigating to start -> Run -> Services.msc
    i) Make sure no services related to oracle are running.
    ii) Make sure no files related to oracle softwares are in use by another fore and background processes.
1.1 Stop msdtc using
    Logon to command prompt using administrator
    net stop msdtc
2. Copy the patch zip file (p21821802_112040_MSWIN-x86-64.zip) from remote host D:\oracle_patches\11.2.0.3 to destination server under d:\patches.
3. Copy the Opatch software zip file (p6880880_112000_MSWIN-x86-64.zip) from remote host (172.26.0.43) D:\oracle_patches\OPatch to destination server under d:\patches.
4. unzip p21821802_112040_MSWIN-x86-64.zip & p6880880_112000_MSWIN-x86-64.zip
    4.1) This creates folders 21821802 & OPatch
5. Navigate to %ORACLE_HOME% in windows explorer and rename OPatch directory to OPatch_Old
6. Copy d:\patches\OPatch directory to %ORACLE_HOME%
7. Open command prompt in Administrator mode and perform the below :
    7.1) SET ORACLE_HOME=<PATH_OF_ORACLE_HOME>
    7.2) SET PATH=%ORACLE_HOME%\bin;%ORACLE_HOME%\OPatch\;%ORACLE_HOME%\perl\bin;%PATH%
    7.3) sqlplus / as sysdba
    7.4) shutdown immediatae
    7.5) exit
    7.6) cd d:\patches\21821802\
    7.7) opatch apply
        7.7.1) Most probably the patch may fail if any files related to oracle are in use. Kill them manually.
    7.8) Inspect the opatch<timestamp>.log file generated in %ORACLE_HOME%\cfgtoollogs\opatch for any errors.
    7.9) When patch applied, connect to the database and start the database and listener services from start -> run -> services.msc
    7.10) start msdtc using
        Logon to command prompt using administrator
        net start msdtc
8. Check the invalid objects count in schema user by running the query and the invalid objects count should be matching with the count executed in pre release step.
    sql> select object_name, object_type from user_objects where status='INVALID';
9. start the Apache & Tomcat services in application host.
10. Perform the sanity of the application.       

Linux-Active directory integration



Centrify ( Linux login with AD)

1. Download centrify linux client for linux from (http://www.centrify.com/express/linux-unix/download-    files/#accordion-download-express-02)  ( For downloading use this command from Linux terminal
2. Extract the file  (tar –xvf centrify-suite-2015.1-rhel4-x86_64.tgz2)
3. Run sh install-express.sh
4. Give proper AD domain name and all with proper credentials for checking
5. After installation check ad status with adinfo (if centrifyDC mode: disconnected)
6. Join to the Active Directory (adjoin –w –u administrator domain.com)
u- Username to authenticate AD
7. Provide administrator password.
8.Check adinfo (it’s should be  like below)
[root@VM-RHEL7-TEST ~]# adinfo
Local host name:   vm-rhel7-test
Joined to domain:  domain.com
Joined as:         vm-rhel7-test.domain.com
Pre-win2K name:    vm-rhel7-test
Current DC:        vm-actived-prod.domain.com
Preferred site:    Default-First-Site-Name
Zone             :     Auto Zone
Last password set: 2015-12-02 02:40:22 MeST
CentrifyDC mode:   connected
Licensed Features: Disabled
9. To check AD user name  (getent password | grep “username”
10. To check AD group (getent group | grep “group name”
11. Use ad flush instead of gpupdate (adflush –f (sync with AD and update))
adcheck - checks if all systems are a go to join a domain or to diagnose domain connectivity
adinfo - shows you what's up with the AD client
adjoin/adleave - joins, leaves AD domains

12. Restrict users with SSH configuration (only cops, root and particular user only can login to the server)
13. Edit /etc/centrifydc/ssh/sshd_config file and allow particular group or user (Vim /etc/centrifydc/ssh/sshd_config)
####Add the below lines in to /etc/centrifydc/ssh/sshd_config#####
AllowUsers username1 username2
AllowGroups gropu1 gropu2 root
14. Restart SSH service ([root@VM-RHEL7-TEST ~]# /etc/init.d/centrify-sshd restart)
15. Allow cops and particular group in to sudo group. Edit sudoers file and add the below lines
 Vim /etc/sudoers
##########Add the below lines in to /etc/sudoers ###########
For sysadmins %sysadmin ALL=(ALL)       NOPASSWD: ALL (it will allow cops user to run sudo without prompting user password )
For any other group  %groupname  ALL=(ALL)       ALL
For any users Username  ALL=(ALL)       ALL
Run any root related work with sudo Eg: sudo service sshd restart (copy any file through sftp to home folder or /tmp)

AWS EC2 Machine Restarted Unexpected



AWS EC2 Machine Restarted Unexpected

Error:
Problem signature:
  Problem Event Name:                        BlueScreen
  OS Version:                                          6.1.7601.2.1.0.400.8
  Locale ID:                                             1033

Additional information about the problem:
  BCCode:                                               4e
  BCP1:                                                    0000000000000099
  BCP2:                                                    0000000000000000
  BCP3:                                                    0000000000000000
  BCP4:                                                    0000000000000000
  OS Version:                                          6_1_7601
  Service Pack:                                       1_0
  Product:                                               400_3

Critical - Kernel Power:
The system has rebooted without cleanly shutting down first. This error could be caused if the system stopped responding, crashed, or lost power unexpectedly.
 

Solution:
1.      upgrade the RH drivers to Citrix PV drivers on your instance, here is the documentation on how to do it:
2.      Verify that you have Windows PowerShell 2.0 installed. To verify the version that you have installed, run the following command in a PowerShell window:
PS C:> $PSVersionTable.PSVersion
 
3.       Connect to your instance and log in as the local administrator.
4.       In your instance, download the Citrix upgrade package.( https://ec2-downloads-windows.s3.amazonaws.com/Drivers/Citrix-Win_PV.zip)
5.      Extract the contents of the upgrade package to a location of your choice.
6.      Double-click the Upgrade.bat file. If you get a security warning, click Run.
7.      In the Upgrade Drivers dialog box, review the information and click Yes if you are ready to start the upgrade
8.      Reboot machine

Expand disk space in AWS EC2




Expand disk space in AWS EC2

1.       For expanding disk space in AWS ec2à Login to the console and select EC2àSelect proper instanceàfind which disk you want to extendàfind the EBS ID of the machine.

2.       Click on the EBS ID of the machine àR-click on the volume àSelect create snapshot


4.       Once snapshot created, select create volume


5.       Select your volume size (how much you need to increase)àselect proper availability zone(check instance availability zone)àselect snapshot which you created àselect create

6.        Shutdown the instanceàR-click on the volume which you need to increaseàSelect detach volume






7.       R-click on the new volume you created with snapshot and select Attach VolumeàSelect the instance and set proper mount point.


8.       Start the instance.