Welkom bij een Compute Engine-website met warme failover naar Cloud Storagep>

beheerde instantiegroepen herstellen en kunnen verkeer voor de volledige website verwerken ervaring. - Verifieer het domein die u wilt gebruiken met uw Cloud Storage-bucket. Maak een Cloud Storage-bucket die overeenkomt met de naam van het domein waarvan u de eigenaar bent en wil gebruiken: gsutil mb gsstatic-web.$DOMEIN De DOMAINvariabele gedefinieerd aan het begin van dit document wordt gebruikt, zoals . In dit voorbeeld worden de statische bestanden opgeslagen op voorbeeld.com statisch-web.voorbeeld.com. Maak een lokaal bestand dat u kopieert naar de Cloud Storage-bucket in de volgende stap: cat< index.html HA / DR example

Welcome to a test static web server with warm failover from Cloud Storagep>

HA / DR example

Welcome to a test static web server with warm failover from Cloud Storagep>

curlagain, or open your web browser, to access the IP address of the load balancer: curl $IP_ADDRESS It might take a few minutes for the load balancer to update the configuration and to correctly direct traffic back to your managed instance groups. If needed, wait a few minutes and try to access the website again. The main website from the managed instance groups is returned, as shown in the following example output: HA / DR example p>Welcome to a Compute Engine website with warm failover to Cloud Storagep> ## Clean up To avoid incurring charges to your Google Cloud account for the resources used in this tutorial, either delete the project that contains the resources, or keep the project and delete the individual resources. To delete the individual resources created in this document, complete the following steps: - Delete the Cloud Storage bucket: gsutil rm -r gsstatic-web.$DOMAIN Delete the load balancer configuration: gcloud compute forwarding-rules delete n http-content-rule-$NAME_SUFFIX --global --quiet gcloud compute target-http-proxies delete n http-lb-proxy-$NAME_SUFFIX --quiet gcloud compute url-maps delete web-map-http-$NAME_SUFFIX --quiet gcloud compute url-maps delete web-map-http-bucket-$NAME_SUFFIX --quiet gcloud compute backend-services delete n web-backend-service-$NAME_SUFFIX --global --quiet gcloud compute backend-buckets delete web-bucket-$NAME_SUFFIX --quiet Delete the managed instance groups and health check: gcloud compute instance-groups managed delete n instance-group-$NAME_SUFFIX-$REGION1 n --region=$REGION1 --quiet gcloud compute instance-groups managed delete n instance-group-$NAME_SUFFIX-$REGION2 n --region=$REGION2 --quiet gcloud compute health-checks delete http-basic-check-$NAME_SUFFIX --quiet Delete the instance templates, images, base VM, and persistent disks: gcloud compute instance-templates delete n template-$NAME_SUFFIX-$REGION1 --quiet gcloud compute instance-templates delete n template-$NAME_SUFFIX-$REGION2 --quiet gcloud compute images delete image-$NAME_SUFFIX --quiet gcloud compute images delete image-disk-$NAME_SUFFIX --quiet gcloud compute instances delete vm-base-$NAME_SUFFIX n --zone=$ZONE --quiet Delete the firewall rules. gcloud compute firewall-rules delete n allow-health-check-$NAME_SUFFIX --quiet gcloud compute firewall-rules delete n allow-ssh-$NAME_SUFFIX --quiet gcloud compute firewall-rules delete n allow-http-$NAME_SUFFIX --quiet Delete the subnet and VPC. gcloud compute networks subnets delete n subnet-$NAME_SUFFIX-$REGION1 --region=$REGION1 --quiet gcloud compute networks subnets delete n subnet-$NAME_SUFFIX-$REGION2 --region=$REGION2 --quiet gcloud compute networks delete network-$NAME_SUFFIX --quiet ## What's next - - For an alternative approach that uses Cloud DNS instead of external HTTP(S) Load Balancing to control the failover, see Deploy a warm recoverable web server using Cloud DNS with Compute Engine and Cloud Storage. This pattern is useful if you have, or want to use, Cloud DNS. - To learn how how to determine the best approach for your own applications and which recovery method to use, see the Disaster recovery planning guide. - To see other patterns for applications, such as cold and hot failover, see Disaster recovery scenarios for applications. - For more ways to handle scale and availability, see the Patterns for scalable and resilient apps. - Explore reference architectures, diagrams, tutorials, and best practices about Google Cloud. Take a look at our Cloud Architecture Center.