准备工作
- 实验会创建一个 Google Cloud 项目和一些资源,供您使用限定的一段时间
- 实验有时间限制,并且没有暂停功能。如果您中途结束实验,则必须重新开始。
- 在屏幕左上角,点击开始实验即可开始
Create a Compute Engine VM instance
/ 25
Install an Apache Web Server
/ 25
Configure the Ops Agent
/ 25
Generate traffic and view metrics
/ 25
In this lab you will create a compute engine VM and configure Ops Agent. You will generate traffic and view metrics on the predefined Apache dashboard.
In this lab, you learn how to perform the following tasks:
For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.
Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is the Lab Details panel with the following:
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details panel.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details panel.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
In this task, you create a Compute Engine VM instance, and then configure its machine type, boot disk, and firewall rules to allow HTTP and HTTPS traffic,
In the Google Cloud console, in the Navigation menu () click Compute Engine > VM instances.
To create a VM instance, click Create instance.
Fill in the fields for your instance as follows:
Click Machine configuration, and then specify the following values:
| Field | Value |
|---|---|
| Name | quickstart-vm |
| Region | |
| Zone | |
| Series | E2 |
| Machine Type | e2-small |
Click OS and storage
Click Networking
Click Observability
Leave the rest of the fields at their default values.
Click Check my progress to verify the objective.
In this task, you deploy an Apache Web Server on your Compute Engine VM instance.
To open a terminal to your instance, in the Connect column, click SSH. If prompted, click Authorize.
To update the package lists on your instance, run the following command:
Y.
http://EXTERNAL_IP, where EXTERNAL_IP is the external IP address of your VM. You can find this address in the External IP column of your VM instance.Click Check my progress to verify the objective.
In this task, you configure the Ops Agent on your VM instance to collect logs and metrics from the Apache Web Server.
To open a terminal to your VM instance, in the Connect column, click SSH.
To configure the Ops Agent, copy the following command, then paste it into the terminal:
The previous command creates the configuration to collect and ingest logs and metrics from the Apache Web Server. For more information about ingesting logs from the Apache Web Server, see Configure the Ops Agent for Apache Web Server.
Click Check my progress to verify the objective.
In this task, you generate metrics on your Apache Web Server and view metric data on the automatically created Apache Overview dashboard.
To generate metrics on your Apache Web Server, do the following:
In the Google Cloud console, in the Navigation menu () click Compute Engine > VM instances.
In the Connect column, click SSH to open a terminal to your VM instance. If prompted, click Authorize.
To generate traffic on your Apache Web Server, run the following command:
The previous command generates traffic by making a request to the Apache Web Server every four seconds.
To view the Apache Overview dashboard, do the following:
In the Google Cloud console, in the Navigation menu () click Monitoring > Dashboards.
In All Dashboards, select the Apache Overview dashboard. The dashboard opens.
In the dashboard, there are several charts that contain information about your Apache and Compute Engine integration:
Click Check my progress to verify the objective.
In this lab, you learned how to configure Ops Agent on a VM and viewed metrics on the predefined Apache dashboard.
When you have completed your lab, click End Lab. Google Skills removes the resources you’ve used and cleans the account for you.
You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.
The number of stars indicates the following:
You can close the dialog box if you don't want to provide feedback.
For feedback, suggestions, or corrections, please use the Support tab.
Copyright 2025 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
此内容目前不可用
一旦可用,我们会通过电子邮件告知您
太好了!
一旦可用,我们会通过电子邮件告知您
一次一个实验
确认结束所有现有实验并开始此实验