Code Monkey home page Code Monkey logo

vagrant-vbox-rac's Introduction

vagrant-vbox-rac

Vagrant setup to install one or more Oracle RAC clusters

The provisioning step of this vagrant solution is: https://github.com/oravirt/ansible-oracle

Getting started

Pre-requisites:

Clone this repository: git clone --recursive https://github.com/oravirt/vagrant-vbox-rac.git

cd vagrant-vbox-rac

Update the submodules:

./update-repo.sh

Edit the hosts.yml file if you want to change the ip, number of cpu's, amount of RAM etc.

If you want to use a different version or Oracle Linux (or use RHEL), change the parameter box: oravirt/ol75 to one of the following:

  • oravirt/ol74
  • oravirt/ol73
  • oravirt/ol72
  • oravirt/ol69
  • oravirt/ol68
  • oravirt/ol67
  • oravirt/ol65
  • oravirt/rhel75
  • oravirt/rhel610

These boxes are prepared with all Oracle pre-req packages installed

Download the Oracle binaries (see below) and place them in the swrepo directory. Alternatively, if you already have a directory where all Oracle binaries are located, change the synced_folders: src to point to your local directory (/Users/xxx/Downloads/oracle)

And then: setup=true vagrant up

This will (by default):

  • create 2 VM's based on Oracle Linux 7.5
  • create a 18.3 container database called 'orclcdb'
  • create a pdb called 'orclpdb'
  • sys/system passwords are Oracle_123
  • The diskgroups are called crs, data & fra and uses asmlib for device naming persistency.

NOTE: The default config will consume ~74GB of storage. 40GB of this is to accomodate the GIMR database in 18.3. If you want to install a different version, you can just change the size of the crs disk in hosts.yml to something smaller

If you just want to create the machine, and not run the provisioning step run this:

vagrant up

For more detail on how the vagrant part of this project works, look at this

Modifying the Oracle installation, GI (Ansible style)

If you want to install a different version of GI , edit the extra-provision/ansible-oracle/group_vars/vbox-rac-dc1/2 file and change the parameter oracle_install_version_gi to either of:

  • 18.3.0.0
  • 12.2.0.1
  • 12.1.0.2
  • 12.1.0.1
  • 11.2.0.4
  • 11.2.0.3

Modifying the Oracle installation, DB (Ansible style)

  • THIS SECTION NEEDS TO BE RE-WRITTEN AS IT IS NO LONGER CORRECT. USE ENVIRONMENT VARIABLES FOR NOW.

Modifying the Oracle installation (using environment variables)

You have the possibility to override some of the defaults using environment variables, as described in more detail here.

But it is basically a simple matter of setting provisioning_env_override: true in hosts.yml, and then e.g:

setup=true giver=12.2.0.1 dbver=12.1.0.2 dbtype=RAC dbstorage=ASM vagrant up

Logging in to the VM(s)

To log on to the VM (ssh), you have the following options:

  • run vagrant ssh <vmname> from within the directory, then sudo to oracle/root
  • ssh to VM using the ssh binary of your choice, i.e: ssh 192.168.7.10 -l oracle (vagrant/vagrant, oracle/oracle, root/root). The oracle user also have sudo rights

For each database created there is a /home/oracle/.profile_<dbname> created which have all the environment variables set up for this particular database.

Install more than 1 cluster

To install more than 1 cluster, just comment out the commented part in hosts.yml (called vbox-rac-dc2). Since the Vagrant provisioner works on 1 hostgroup at the time, it will first create the vbox-rac-dc1 cluster, and then move on the vbox-rac-dc2. This will take ~2H

It is possible to just create the machines (just vagrant up) and then run Ansible as a separate step manually. Doing it this way cut the runtime down to ~80min (on the same hardware)

These are the Oracle binaries that should be used.

For 18.3.0.0:

    LINUX.X64_180000_db_home.zip
    LINUX.X64_180000_grid_home.zip

For 12.2.0.1:

    linuxx64_12201_database.zip
    linuxx64_12201_grid_home.zip

For 12.1.0.2

    linuxamd64_12102_database_1of2.zip
    linuxamd64_12102_database_2of2.zip
    linuxamd64_12102_grid_1of2.zip
    linuxamd64_12102_grid_2of2.zip

For 12.1.0.1:

    linuxamd64_12c_database_1of2.zip
    linuxamd64_12c_database_2of2.zip
    linuxamd64_12c_grid_1of2.zip
    linuxamd64_12c_grid_2of2.zip

For 11.2.0.4:

    p13390677_112040_Linux-x86-64_1of7.zip
    p13390677_112040_Linux-x86-64_2of7.zip
    p13390677_112040_Linux-x86-64_3of7.zip

For 11.2.0.3:

   p10404530_112030_Linux-x86-64_1of7.zip
   p10404530_112030_Linux-x86-64_2of7.zip
   p10404530_112030_Linux-x86-64_3of7.zip

vagrant-vbox-rac's People

Contributors

msandstr avatar oravirt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vagrant-vbox-rac's Issues

18c build failing at TASK [oradb-manage-db : manage-db | create/manage database] -[FATAL] ORA-03113: end-of-file on communication channel

Hi Mikael,
I have been trying your build for several times now and it still fails at the same stage .
I took the liberty to change few attributes ( ips ,hostnames,scan name,dbnames, db_home path ) in the corresponding VagrantFile and host.yml.

It seems that the failure kicks in just before or during PDB creation. As all the prior steps are processed until this task : > [oradb-manage-db : manage-db | create/manage database]
dbca creates the db but couldn't bounce the instances .(previous run had successfully installed dbs but stopped at the PDB creation)
here is the output I got at the last try :

TASK [oradb-manage-db : manage-db | create/manage database] ********************
fatal: [london1]: FAILED! => {"changed": false, "msg": "Error - STDOUT: [WARNING] [DBT-09102] Target environment does not meet some optional requirements.\n CAUSE: Some of the optional prerequisites are not met. See logs for details.\n
ACTION: Find the appropriate configuration from the log file or from the installation guide to meet the prerequisites and fix this manually.\nPrepare for db operation\n8% complete\nCopying database files\n33% complete\nCreating and st
arting Oracle instance\n34% complete\n35% complete\n39% complete\n[FATAL] ORA-03113: end-of-file on communication channel\n\n50% complete\n100% complete\n[FATAL] ORA-03113: end-of-file on communication channel\n\n33% complete\n8% complet
e\n0% complete\nLook at the log file "/u01/app/oracle/cfgtoollogs/dbca/racdb/racdb.log" for further details.\n, STDERR: , COMMAND: /u01/app/oracle/product/18.3.0.0/db1/bin/dbca -createDatabase -silent -responseFile /u01/stage/rsp/dbca
_racdb.rsp -initParams db_create_file_dest=+DATA,db_create_online_log_dest_1=+FRA,db_recovery_file_dest=+FRA,db_recovery_file_dest_size=20G"}

NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @/vagrant/extra-provision/ansible-oracle/vbox-rac-dc1.retry
PLAY RECAP *********************************************************************
london1 : ok=116 changed=64 unreachable=0 failed=1
london2 : ok=95 changed=53 unreachable=0 failed=0

Ansible failed to complete successfully. Any error output should be visible above. Please fix these errors and try again.

when I check the crs status the instances are there but just not up and runing.

Instance racdb1 is not running on node london1
Instance racdb2 is not running on node london2

any idea what could be the problem here ? . I can show the host.yml and vagrant if you want .
Thanks again

vbox-rac-dc2 build issues

Hi Mikael,

I was trying to build 18c RAC using vbox-rac-dc2 but it failed looking for 12.2.0.1 images
and checking ansible directories extra-provision/ansible-oracle/group_vars/vbox-rac-dc1/2
they do not look like synchronized.
Would you have a look?

Thank you,
Andrey

TASK [oraswgi-install : install-home-gi | Extract files to ORACLE_HOME (gi) (from remote location)] ***
failed: [racnode-dc2-2] (item={u'creates': u'xdk/mesg/lsxja.msb', u'version': u'12.2.0.1', u'filename': u'linuxx64_12201_grid_home.zip'}) => {"changed": false, "item": {"creates": "xdk/mesg/lsxja.msb", "filename": "linuxx64_12201_grid_home.zip", "version": "12.2.0.1"}, "msg": "Source '/media/swrepo/linuxx64_12201_grid_home.zip' does not exist"}
failed: [racnode-dc2-1] (item={u'creates': u'xdk/mesg/lsxja.msb', u'version': u'12.2.0.1', u'filename': u'linuxx64_12201_grid_home.zip'}) => {"changed": false, "item": {"creates": "xdk/mesg/lsxja.msb", "filename": "linuxx64_12201_grid_home.zip", "version": "12.2.0.1"}, "msg": "Source '/media/swrepo/linuxx64_12201_grid_home.zip' does not exist"}
to retry, use: --limit @/vagrant/extra-provision/ansible-oracle/vbox-rac-dc2.retry

Can't build 11.2.0.4

I've tried to build 11.2.0.4, with ol75 and ol69 without luck. With ol75, I get this error:

.......................................
TASK [oraswgi-install : install-home-gi | Run oraInstroot script after installation] ***
changed: [racnode-dc1-2]
changed: [racnode-dc1-1]

TASK [oraswgi-install : install-home-gi | Run root script after installation (Master Node)] ***
fatal: [racnode-dc1-1]: FAILED! => {"changed": true, "cmd": "/u01/app/grid/product/11.2.0.4/grid/root.sh", "delta": "0:35:31.901595", "end": "2019-04-30 23:56:57.768903", "msg": "non-zero return code", "rc": 1, "start": "2019-04-30 23:21:25.867308", "stderr": "", "stderr_lines": [], "stdout": "Check /u01/app/grid/product/11.2.0.4/grid/install/root_racnode-dc1-1_2019-04-30_23-21-25.log for the output of root script", "stdout_lines": ["Check /u01/app/grid/product/11.2.0.4/grid/install/root_racnode-dc1-1_2019-04-30_23-21-25.log for the output of root script"]}

NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @/vagrant/extra-provision/ansible-oracle/vbox-rac-dc1.retry

PLAY RECAP *********************************************************************
racnode-dc1-1 : ok=71 changed=42 unreachable=0 failed=1
racnode-dc1-2 : ok=66 changed=38 unreachable=0 failed=0
................................................................................

And in the root-racnode-dc1-1 log for ol75:
...................................................................................
Adding Clusterware entries to inittab
ohasd failed to start
Failed to start the Clusterware. Last 20 lines of the alert log follow:
2019-04-30 23:23:22.411:
[client(30726)]CRS-2101:The OLR was formatted using version 3.

/u01/app/grid/product/11.2.0.4/grid/perl/bin/perl -I/u01/app/grid/product/11.2.0.4/grid/perl/lib -I/u01/app/grid/product/11.2.0.4/grid/crs/install /u01/app/grid/product/11.2.0.4/grid/crs/install/rootcrs.pl execution failed
.............................................................................................................................

With ol69, I get this error on install (I think it may have to do with the version of Jinja being used in the vagrant box -- my solution may be to create a local version of the vagrant box and update the Jinja version and save it):
............................................................................................
TASK [oraasm-createdg : ASMCA | Create ASM diskgroups] *************************

TASK [oraasm-createdg : Print Results] *****************************************
fatal: [racnode-dc1-1]: FAILED! => {"msg": "template error while templating string: no filter named 'map'. String: {{ asmca.results|map(attribute='stdout_lines')|list }}"}
...ignoring

TASK [oraasm-createdg : ASMCA | List ASM diskgroups] ***************************

TASK [oraasm-createdg : list diskgroups] ***************************************
fatal: [racnode-dc1-1]: FAILED! => {"msg": "template error while templating string: no filter named 'map'. String: {{ srvctlasm.results|map(attribute='stdout_lines')|list }}"}
...ignoring

TASK [oraasm-manage-diskgroups : oraasm-manage-dgs | Manage diskgroups] ********
fatal: [racnode-dc1-1]: FAILED! => {"msg": "An unhandled exception occurred while templating '{% if item.attributes is defined %}{{item.attributes |default (omit) | map(attribute='name') | list }}{% else %}None{%endif%}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: template error while templating string: no filter named 'map'. String: {% if item.attributes is defined %}{{item.attributes |default (omit) | map(attribute='name') | list }}{% else %}None{%endif%}"}

...............................................................................................

And in the root-racnode-dc1-1 log for ol69:
..................................................................................................
ASM created and started successfully.

Disk Group crs created successfully.

clscfg: -install mode specified
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4256: Updating the profile
Successful addition of voting disk 0684b4435ed04f05bfa039a86c91af3c.
Successfully replaced voting disk group with +crs.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
'## STATE File Universal Id File Name Disk group


  1. ONLINE 0684b4435ed04f05bfa039a86c91af3c (ORCL:CRS01) [CRS]
    Located 1 voting disk(s).
    CRS-2672: Attempting to start 'ora.asm' on 'racnode-dc1-1'
    CRS-2676: Start of 'ora.asm' on 'racnode-dc1-1' succeeded
    CRS-2672: Attempting to start 'ora.CRS.dg' on 'racnode-dc1-1'
    CRS-2676: Start of 'ora.CRS.dg' on 'racnode-dc1-1' succeeded
    ^[[1mConfigure Oracle Grid Infrastructure for a Cluster ... succeeded
    ^[[0m

..........................................................................

Failure on 11.2.0.3/11.2.0.4

I revisited this today and tried out 11.2.0.3 after finding the install files in Oracle's support site and also with 11.2.0.4. The install went fine until I got to this error with either one. It doesn't seem to see the grid install file in the swrepo along with the other two install files:

TASK [oraswgi-install : install-home-gi | Extract files to stage-area (GI) (from remote location)] ***
failed: [racnode-dc1-1] (item={u'creates': u'grid/welcome.html', u'version': u'11.2.0.4', u'filename': u'p13390677_112040_Linux-x86-64_3of7.zip'}) => {"changed": false, "item": {"creates": "grid/welcome.html", "filename": "p13390677_112040_Linux-x86-64_3of7.zip", "version": "11.2.0.4"}, "msg": "Source '/media/swrepo/p13390677_112040_Linux-x86-64_3of7.zip' does not exist"}
failed: [racnode-dc1-2] (item={u'creates': u'grid/welcome.html', u'version': u'11.2.0.4', u'filename': u'p13390677_112040_Linux-x86-64_3of7.zip'}) => {"changed": false, "item": {"creates": "grid/welcome.html", "filename": "p13390677_112040_Linux-x86-64_3of7.zip", "version": "11.2.0.4"}, "msg": "Source '/media/swrepo/p13390677_112040_Linux-x86-64_3of7.zip' does not exist"}
to retry, use: --limit @/vagrant/extra-provision/ansible-oracle/vbox-rac-dc1.retry

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.