Created
June 3, 2021 05:45
-
-
Save tingwei628/2342475b6e651fe2f37737016e9b471e to your computer and use it in GitHub Desktop.
gcp note
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su - // convert to root | |
ps auwx | grep nginx // check nginx run status | |
gcloud compute instances create gcelab2 --machine-type n1-standard-2 --zone us-central1-f | |
gcloud compute ssh gcelab2 --zone us-central1-f | |
gcloud compute instances get-serial-port-output instance-1 //check whether the server is ready for an RDP connection | |
gcloud compute reset-windows-password [instance] --zone us-central1-a --user [username] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// Network Load Balancer
//set the default zone
gcloud config set compute/zone us-central1-a
//Set the default region
gcloud config set compute/region us-central1
// install Apache on each instance and give each instance a unique home page.
//Create a firewall rule to allow external traffic to the VM instances
//Run the following to list your instances.
gcloud compute instances list
//Create a static external IP address for your load balancer
//Add a legacy HTTP health check resource
gcloud compute http-health-checks create basic-check
//Add a target pool in the same region as your instances.
//Add the instances to the pool
//Add a forwarding rule
//view the external IP address of the www-rule forwarding rule used by the load balancer
gcloud compute forwarding-rules describe www-rule --region us-central1
//Http Load Balancer
//create the load balancer template
//Create a managed instance group based on the template
//Create the fw-allow-health-check firewall rule. (This is an ingress rule that allows traffic from the Google Cloud health checking systems (130.211.0.0/22 and 35.191.0.0/16). This lab uses the target tag allow-health-check to identify the VMs.)
//set up a global static external IP address that your customers use to reach your load balancer
// the IPv4 address that was reserved
//Create a healthcheck for the load balancer
//Create a backend service
// Add your instance group as the backend to the backend service
//Create a URL map to route the incoming requests to the default backend service
//Create a target HTTP proxy to route requests to your URL map
//Create a global forwarding rule to route incoming requests to the proxy