|
| 1 | +# Oracle Globally Distributed Database (GDD) Vagrant boxes on VirtualBox or KVM/libVirt provider |
| 2 | + |
| 3 | +###### Author: Ruggero Citton (<[email protected]>) - Oracle RAC Pack, Cloud Innovation and Solution Engineering Team |
| 4 | + |
| 5 | +This directory contains Vagrant build files to provision automatically |
| 6 | +Oracle Globally Distributed Database 23ai for free host, using Vagrant, Oracle Linux 8 and shell scripts. |
| 7 | + |
| 8 | + |
| 9 | +The virtualization provider can be VirtualBox or KVM/libVirt |
| 10 | + |
| 11 | +## Prerequisites for VirtualBox |
| 12 | +1. Install [Oracle VM VirtualBox](https://www.virtualbox.org/wiki/Downloads) |
| 13 | +2. Install [Vagrant](https://vagrantup.com/) |
| 14 | +3. You need to download Database binary separately |
| 15 | + |
| 16 | +## Prerequisites for KVM/libVirt provider |
| 17 | +1. Install [KVM]/[libVirt] |
| 18 | +2. Install [Vagrant](https://vagrantup.com/) |
| 19 | +3. Install extra packages such ruby-devel libvirt-devel |
| 20 | + - `dnf install -y ruby-devel libvirt-devel` |
| 21 | +4. Install vagrant-libvirt as user |
| 22 | + - `vagrant plugin install vagrant-libvirt` |
| 23 | +5. You need to download Database binary separately |
| 24 | + |
| 25 | +#### Note: *Using KVM/libVirt provider you may need to disable or manage host firewall to permit NFS traffic with the guest VMs* |
| 26 | +#### Note: if you are going to use KVM on OL8/OL9 please read 'https://blogs.oracle.com/linux/getting-started-with-the-vagrant-libvirt-provider-for-oracle-linux' |
| 27 | + |
| 28 | + |
| 29 | +## Free disk space requirement |
| 30 | +- VM OS disk: ~5.5 Gb |
| 31 | +- Storage containers disk : ~11 Gb |
| 32 | +- Oradata disks: ~30 Gb |
| 33 | + |
| 34 | +## Memory requirement |
| 35 | +Running Oracle Globally Distributed Database host at least 32Gb are required |
| 36 | + |
| 37 | +## Getting started |
| 38 | +1. Clone this repository `git clone https://github.com/oracle/vagrant-projects.git` |
| 39 | +2. Change into OracleGDD folder (`/repo clone path>/vagrant-projects/OracleGDD/<OL8 | OL9>`) |
| 40 | +4. Run `vagrant up` |
| 41 | +5. Connect the hosts issuing: `vagrant ssh`. |
| 42 | +6. You can shut down the box via the usual `vagrant halt` and the start it up again via `vagrant up` |
| 43 | + |
| 44 | +## Customization |
| 45 | +You can customize your Oracle environment by amending the parameters in the configuration file: "./config/vagrant.yml" |
| 46 | +The following can be customized: |
| 47 | + |
| 48 | +#### node1 |
| 49 | +- `vm_name`: VM Guest partial name. The full name will be <prefix_name>-<vm_name> |
| 50 | +- `mem_size`: VM Guest memory size Mb (minimum 32Gb --> 32768) |
| 51 | +- `cpus`: VM Guest virtual cores |
| 52 | +- `public_ip`: VM public ip. VirtualBox `vboxnet0` hostonly is in use |
| 53 | +- `storage_pool_name`: KVM/libVirt host storage pool name |
| 54 | + |
| 55 | +#### environment |
| 56 | +- `provider`: It's defining the provider to be used: 'libvirt' or 'virtualbox' |
| 57 | +- `prefix_name`: VM Guest prefix name |
| 58 | +- `network`: Hostonly/public |
| 59 | +- `netmask`: Podman netmask |
| 60 | +- `gateway`: Podman gateway |
| 61 | +- `dns_public_ip`: Podman DNS public IP |
| 62 | +- `domain`: Podman domain |
| 63 | +- `bridge_nic`: In case of libvirt provider, bridge nic for the public network |
| 64 | +- `storage_pool_name`: Oradata storage pool name |
| 65 | +- `oradata_disk_num` : Oradata storage disk size |
| 66 | +- `oradata_disk_size`: Oradata storage pool name |
| 67 | +- `root_password`: VM Guest root password |
| 68 | +- `sharding_secret`: Oracle Globally Distributed Database password |
| 69 | +- `podman_registry_uri`: Registry URI |
| 70 | +- `podman_registry_user`: Registry user |
| 71 | +- `podman_registry_password`: Registry password |
| 72 | +- `sidb_image`: Oracle Globally Distributed Database 23ai for free image |
| 73 | +- `gsm_image`: Oracle Globally Distributed Manager 23ai for free image |
| 74 | + |
| 75 | + |
| 76 | +#### VirtualBox provider Example: |
| 77 | + host1: |
| 78 | + vm_name: host1 |
| 79 | + mem_size: 32768 |
| 80 | + cpus: 2 |
| 81 | + public_ip: 192.168.56.60 |
| 82 | + sc_disk: ./storage_container.vdi |
| 83 | + |
| 84 | + env: |
| 85 | + provider: virtualbox |
| 86 | + # --------------------------------------------- |
| 87 | + prefix_name: vgt-235-gdd |
| 88 | + # --------------------------------------------- |
| 89 | + network: hostonly |
| 90 | + netmask: |
| 91 | + gateway: |
| 92 | + domain: localdomain |
| 93 | + # --------------------------------------------- |
| 94 | + dns_public_ip: 192.168.178.1 |
| 95 | + # --------------------------------------------- |
| 96 | + oradata_disk_path: |
| 97 | + oradata_disk_num: 2 |
| 98 | + oradata_disk_size: 20 |
| 99 | + # --------------------------------------------- |
| 100 | + root_password: welcome1 |
| 101 | + sharding_secret: welcome1 |
| 102 | + # --------------------------------------------- |
| 103 | + podman_registry_uri: container-registry.oracle.com |
| 104 | + podman_registry_user: |
| 105 | + podman_registry_password: |
| 106 | + # --------------------------------------------- |
| 107 | + sidb_image: container-registry.oracle.com/database/free |
| 108 | + gsm_image: container-registry.oracle.com/database/gsm:latest |
| 109 | + # ---------------------------------------------- |
| 110 | + |
| 111 | +#### KVM/libVirt provider Example: |
| 112 | + # ----------------------------------------------- |
| 113 | + # vagrant.yml for libVirt |
| 114 | + # ----------------------------------------------- |
| 115 | + host1: |
| 116 | + vm_name: host1 |
| 117 | + mem_size: 32768 |
| 118 | + cpus: 2 |
| 119 | + public_ip: 192.168.125.60 |
| 120 | + storage_pool_name: Vagrant_KVM_Storage |
| 121 | + |
| 122 | + env: |
| 123 | + provider: libvirt |
| 124 | + # --------------------------------------------- |
| 125 | + prefix_name: vgt-235-gdd |
| 126 | + # --------------------------------------------- |
| 127 | + network: hostonly |
| 128 | + netmask: |
| 129 | + gateway: |
| 130 | + dns_public_ip: |
| 131 | + domain: localdomain |
| 132 | + bridge_nic: |
| 133 | + # --------------------------------------------- |
| 134 | + dns_public_ip: 192.168.178.1 |
| 135 | + # --------------------------------------------- |
| 136 | + storage_pool_name: Vagrant_KVM_Storage |
| 137 | + oradata_disk_num: 2 |
| 138 | + oradata_disk_size: 20 |
| 139 | + # --------------------------------------------- |
| 140 | + root_password: welcome1 |
| 141 | + sharding_secret: welcome1 |
| 142 | + # --------------------------------------------- |
| 143 | + podman_registry_uri: container-registry.oracle.com |
| 144 | + podman_registry_user: |
| 145 | + podman_registry_password: |
| 146 | + # --------------------------------------------- |
| 147 | + sidb_image: container-registry.oracle.com/database/free |
| 148 | + gsm_image: container-registry.oracle.com/database/gsm:latest |
| 149 | + # --------------------------------------------- |
| 150 | + |
| 151 | + |
| 152 | +## Running scripts after setup |
| 153 | +You can have the installer run scripts after setup by putting them in the `userscripts` directory below the directory where you have this file checked out. Any shell (`.sh`) or SQL (`.sql`) scripts you put in the `userscripts` directory will be executed by the installer after the database is set up and started. Only shell and SQL scripts will be executed; all other files will be ignored. These scripts are completely optional. |
| 154 | +Shell scripts will be executed as the root user, which has sudo privileges. SQL scripts will be executed as SYS. |
| 155 | +To run scripts in a specific order, prefix the file names with a number, e.g., `01_shellscript.sh`, `02_tablespaces.sql`, `03_shellscript2.sh`, etc. |
| 156 | + |
| 157 | +## Note |
| 158 | +- `SYSTEM_TIMEZONE`: `automatically set (see below)` |
| 159 | + The system time zone is used by the database for SYSDATE/SYSTIMESTAMP. |
| 160 | + The guest time zone will be set to the host time zone when the host time zone is a full hour offset from GMT. |
| 161 | + When the host time zone isn't a full hour offset from GMT (e.g., in India and parts of Australia), the guest time zone will be set to UTC. |
| 162 | + You can specify a different time zone using a time zone name (e.g., "America/Los_Angeles") or an offset from GMT (e.g., "Etc/GMT-2"). For more information on specifying time zones, see [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). |
| 163 | +- Wallet Zip file location `/tmp/wallet_<pdb name>.zip`. |
| 164 | + Copy the file on client machine, unzip and set TNS_ADMIN to Wallet loc. Connect to DB using Oracle Sql Client or using your App |
| 165 | +- Using KVM/libVirt provider you may need add a firewall rule to permit NFS shared folder mounted on the guest |
| 166 | + |
| 167 | + example: using 'uwf' : `sudo ufw allow to 192.168.121.1` where 192.168.121.1 is the IP for the `vagrant-libvirt` network (created by vagrant automatically) |
| 168 | + |
| 169 | + virsh net-dumpxml vagrant-libvirt |
| 170 | + <network connections='1' ipv6='yes'> |
| 171 | + <name>vagrant-libvirt</name> |
| 172 | + <uuid>d2579032-4e5e-4c3f-9d42-19b6c64ac609</uuid> |
| 173 | + <forward mode='nat'> |
| 174 | + <nat> |
| 175 | + <port start='1024' end='65535'/> |
| 176 | + </nat> |
| 177 | + </forward> |
| 178 | + <bridge name='virbr1' stp='on' delay='0'/> |
| 179 | + <mac address='52:54:00:05:12:14'/> |
| 180 | + <ip address='192.168.121.1' netmask='255.255.255.0'> |
| 181 | + <dhcp> |
| 182 | + <range start='192.168.121.1' end='192.168.121.254'/> |
| 183 | + </dhcp> |
| 184 | + </ip> |
| 185 | + </network> |
| 186 | +- If you are behing a proxy, set the following env variables |
| 187 | + |
| 188 | + |
| 189 | + #### (Linux/MacOSX) |
| 190 | + - export http_proxy=http://proxy:port |
| 191 | + - export https_proxy=https://proxy:port |
| 192 | + |
| 193 | + #### (Windows) |
| 194 | + - set http_proxy=http://proxy:port |
| 195 | + - set https_proxy=https://proxy:port |
0 commit comments