Giter VIP home page Giter VIP logo

oci-arch-web-ha's Introduction

oci-arch-web-ha

Web applications typically include a web client, servers, and a datastore. Flask is a popular Python framework for developing web applications quickly and easily.

This reference architecture uses a sample Flask application that interacts with an Oracle Database on the backend. The application is containerized using Docker, and the reference architecture is deployed to Oracle Cloud Infrastructure.

For details of the architecture, see Deploy a highly available web application

Prerequisites

  • Permission to manage the following types of resources in your Oracle Cloud Infrastructure tenancy: vcns, internet-gateways, route-tables, network-security-groups, subnets, autonomous-database-family, and instances.

  • Quota to create the following resources: 1 VCN, 2 subnets, 1 Internet Gateway, 1 NAT Gateway, 2 route rules, 1 ATP database instance, and 2 compute instances.

If you don't have the required permissions and quota, contact your tenancy administrator. See Policy Reference, Service Limits, Compartment Quotas.

Deploy Using Oracle Resource Manager

  1. Click Deploy to Oracle Cloud

    If you aren't already signed in, when prompted, enter the tenancy and user credentials.

  2. Review and accept the terms and conditions.

  3. Select the region where you want to deploy the stack.

  4. Follow the on-screen prompts and instructions to create the stack.

  5. After creating the stack, click Terraform Actions, and select Plan.

  6. Wait for the job to be completed, and review the plan.

    To make any changes, return to the Stack Details page, click Edit Stack, and make the required changes. Then, run the Plan action again.

  7. If no further changes are necessary, return to the Stack Details page, click Terraform Actions, and select Apply.

Deploy Using the Terraform CLI

Clone the Repository

Now, you'll want a local copy of this repo. You can make that with the commands:

git clone https://github.com/oracle-quickstart/oci-arch-web-ha.git
cd oci-arch-web-ha
ls
  1. Create a terraform.tfvars file, and specify the following variables:
# Authentication
tenancy_ocid         = "<tenancy_ocid>"
user_ocid            = "<user_ocid>"
fingerprint          = "<finger_print>"
private_key_path     = "<pem_private_key_path>"
private_key_password = "<pem_private_key_password>"

# SSH Keys
ssh_public_key       = "<contents_of_public_ssh_key>"
### USE ONE ^ OR THE OTHER v
ssh_public_key_path  = "<public_ssh_key_path>"

# database
ATP_password           = "<ATP_user_password>"
ATP_data_guard_enabled = false # set the value to true only when you want to enable standby and then re-run terraform apply

# Region
region = "<oci_region>"

# Availability Domain 
availability_domain = "<availability_domain_number>"
### USE ONE ^ OR THE OTHER v
availability_domain_name = "<availability_domain_name>"

# Compartment
compartment_ocid = "<compartment_ocid>"

Create the Resources

Run the following commands:

terraform init
terraform plan
terraform apply

Destroy the Deployment

When you no longer need the deployment, you can run this command to destroy the resources:

terraform destroy

Deploy as a Module

It's possible to utilize this as a module, providing the necessary inputs:

module "oci-arch-web-ha" {
  source               = "github.com/oracle-quickstart/oci-arch-web-ha"
  tenancy_ocid         = "<tenancy_ocid>"
  user_ocid            = "<user_ocid>"
  fingerprint          = "<finger_print>"
  region               = "<oci_region>"
  availability_domain  = "<availability_domain_number>"
  compartment_ocid     = "<compartment_ocid>"
  
  private_key          = "<contents_of_private_key>"
  ### USE ONE ^ OR THE OTHER v
  private_key_path     = "<pem_private_key_path>"
  private_key_password = "<pem_private_key_password>"

  # SSH Keys
  ssh_public_key       = "<contents_of_public_ssh_key>"
  ### USE ONE ^ OR THE OTHER v
  ssh_public_key_path  = "<public_ssh_key_path>"

  ATP_password           = "<ATP_user_password>"
  ATP_data_guard_enabled = false # set the value to true only when you want to enable standby and then re-run terraform apply
}

Architecture Diagram

oci-arch-web-ha's People

Contributors

benofben avatar flavio-santino avatar j0nheck avatar kartikshrikanthegde avatar kumar-dhanagopal avatar lfeldman avatar nugoncal avatar oegentil avatar timclegg avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oci-arch-web-ha's Issues

Unable to create the DEPT table...

While running the terraform setup the job gets stuck at creating the DEPT table in the ATP.

logs ....

null_resource.compute-script1 (remote-exec): == [compute_instance1] 5. Move sqlnet.ora to /usr/lib/oracle/18.3/client64/lib/network/admin/
null_resource.compute-script1: Provisioning with 'remote-exec'...
null_resource.compute-script1 (remote-exec): Connecting to remote host via SSH...
null_resource.compute-script1 (remote-exec): Host: 129.146.87.71
null_resource.compute-script1 (remote-exec): User: opc
null_resource.compute-script1 (remote-exec): Password: false
null_resource.compute-script1 (remote-exec): Private key: true
null_resource.compute-script1 (remote-exec): Certificate: false
null_resource.compute-script1 (remote-exec): SSH Agent: false
null_resource.compute-script1 (remote-exec): Checking Host Key: false
null_resource.compute-script1 (remote-exec): Target Platform: unix
null_resource.compute-script1 (remote-exec): Connected!
null_resource.compute-script1 (remote-exec): == [compute_instance1] 6. Create DEPT table in ATP
null_resource.compute-script1: Still creating... [20s elapsed]
null_resource.compute-script1: Still creating... [30s elapsed]
null_resource.compute-script1: Still creating... [40s elapsed]
null_resource.compute-script1: Still creating... [50s elapsed]
null_resource.compute-script1: Still creating... [1m0s elapsed]
null_resource.compute-script1: Still creating... [1m10s elapsed]
null_resource.compute-script1: Still creating... [1m20s elapsed]
null_resource.compute-script1: Still creating... [1m30s elapsed]
null_resource.compute-script1: Still creating... [1m40s elapsed]
null_resource.compute-script1: Still creating... [1m50s elapsed]
null_resource.compute-script1: Still creating... [2m0s elapsed]
null_resource.compute-script1: Still creating... [2m10s elapsed]
null_resource.compute-script1: Still creating... [2m20s elapsed]
null_resource.compute-script1: Still creating... [2m30s elapsed]
null_resource.compute-script1: Still creating... [2m40s elapsed]
null_resource.compute-script1: Still creating... [2m50s elapsed]
null_resource.compute-script1: Still creating... [3m0s elapsed]
null_resource.compute-script1: Still creating... [3m10s elapsed]
null_resource.compute-script1: Still creating... [3m20s elapsed]
null_resource.compute-script1: Still creating... [3m30s elapsed]
null_resource.compute-script1: Still creating... [3m40s elapsed]
null_resource.compute-script1: Still creating... [3m50s elapsed]
null_resource.compute-script1: Still creating... [4m0s elapsed]
null_resource.compute-script1: Still creating... [4m10s elapsed]
null_resource.compute-script1: Still creating... [4m20s elapsed]
null_resource.compute-script1: Still creating... [4m30s elapsed]
null_resource.compute-script1: Still creating... [4m40s elapsed]
null_resource.compute-script1: Still creating... [4m50s elapsed]
null_resource.compute-script1: Still creating... [5m0s elapsed]
null_resource.compute-script1: Still creating... [5m10s elapsed]
null_resource.compute-script1: Still creating... [5m20s elapsed]
null_resource.compute-script1: Still creating... [5m30s elapsed]
null_resource.compute-script1: Still creating... [5m40s elapsed]
null_resource.compute-script1: Still creating... [5m50s elapsed]
null_resource.compute-script1: Still creating... [6m0s elapsed]
null_resource.compute-script1: Still creating... [6m10s elapsed]
null_resource.compute-script1: Still creating... [6m20s elapsed]
null_resource.compute-script1: Still creating... [6m30s elapsed]
null_resource.compute-script1: Still creating... [6m40s elapsed]
null_resource.compute-script1: Still creating... [6m50s elapsed]
null_resource.compute-script1: Still creating... [7m0s elapsed]
null_resource.compute-script1: Still creating... [7m10s elapsed]
null_resource.compute-script1: Still creating... [7m20s elapsed]
null_resource.compute-script1: Still creating... [7m30s elapsed]
null_resource.compute-script1: Still creating... [7m40s elapsed]
null_resource.compute-script1: Still creating... [7m50s elapsed]
null_resource.compute-script1: Still creating... [8m0s elapsed]
null_resource.compute-script1: Still creating... [8m10s elapsed]
null_resource.compute-script1: Still creating... [8m20s elapsed]
null_resource.compute-script1: Still creating... [8m30s elapsed]
null_resource.compute-script1: Still creating... [8m40s elapsed]
null_resource.compute-script1: Still creating... [8m50s elapsed]
null_resource.compute-script1: Still creating... [9m0s elapsed]
null_resource.compute-script1: Still creating... [9m10s elapsed]
null_resource.compute-script1: Still creating... [9m20s elapsed]
null_resource.compute-script1: Still creating... [9m30s elapsed]
null_resource.compute-script1: Still creating... [9m40s elapsed]
null_resource.compute-script1: Still creating... [9m50s elapsed]
null_resource.compute-script1: Still creating... [10m0s elapsed]
null_resource.compute-script1: Still creating... [10m10s elapsed]
null_resource.compute-script1: Still creating... [10m20s elapsed]
null_resource.compute-script1: Still creating... [10m30s elapsed]
null_resource.compute-script1: Still creating... [10m40s elapsed]
null_resource.compute-script1: Still creating... [10m50s elapsed]
null_resource.compute-script1: Still creating... [11m0s elapsed]
null_resource.compute-script1: Still creating... [11m10s elapsed]
null_resource.compute-script1: Still creating... [11m20s elapsed]
null_resource.compute-script1: Still creating... [11m30s elapsed]
null_resource.compute-script1: Still creating... [11m40s elapsed]

.... and this goes on until the job is canceled.

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.