This topic shows you how to use Beats together with Alibaba Cloud Elasticseach to create a management dashboard in Kibana. In this example, Metricbeat is used to collect data from a computer that runs macOS.
Beats is a platform for single-purpose data shippers. They send data from thousands of machines and systems to Logstash or Elasticsearch.
Metricbeat is a lightweight shipper that collects metrics from your systems and services. System metrics include CPU and memory metrics. Service metrics include Redis and NGINX metrics.
- Complete preparations.
- Configure an Alibaba Cloud Elasticsearch cluster.
- Configure Metricbeat.
- View the dashboard in Kibana.
The following example includes the following IP addresses in the whitelist of the Elasticsearch cluster: 0.0.0.0/1,18.104.22.168/1. This configuration allows almost all public IP addresses to access the Elasticsearch cluster. We recommend that you evaluate the risks before you make the same configuration.
- Purchase an Alibaba Cloud Elasticsearch cluster.
Note If you want to use an internal endpoint to access your Alibaba Cloud Elasticsearch cluster, you must purchase an Alibaba Cloud ECS instance that resides in the same zone and VPC as your Elasticsearch cluster.
- Download Metricbeat.
Configure an Alibaba Cloud Elasticsearch cluster
- Log on to the Alibaba Cloud Elasticsearch console. In the top navigation bar, select the region where your Elasticsearch cluster resides. In the left-side navigation pane, click . Then, find your Elasticsearch cluster and click its ID. In the left-side navigation pane of the page that appears, click Security.
- Turn on the Public Network Access switch. After this switch turns green, click Update next to Public Network Whitelist and add the public IP address of your computer running macOS to the whitelist.
Notice If you are using a public network, add the IP address of the jump server that controls outbound traffic of the public network to the whitelist. If you cannot obtain this IP address, we recommend that you add 0.0.0.0/1,22.214.171.124/1 to the whitelist. This configuration allows almost all public IP addresses to access the Elasticsearch cluster. We recommend that you evaluate the risks before you make the same configuration.
- Go back to the Basic Information page and record the public endpoint of your Elasticsearch cluster.
- In the left-side navigation pane, click Cluster Configuration. On the page that appears, click Modify Configuration on the right side of YML Configuration. In the YML Configuration pane that appears, set Auto Indexing to Enable.
Notice This configuration only takes effect after your Elasticsearch cluster is restarted. To prevent impacts on your business, exercise caution when you change the setting of Auto Indexing.
- Select This operation will restart the cluster. Continue? and click OK.
During the restart, you can view the progress in the Tasks message. After your Elasticsearch cluster is restarted, the configuration of the cluster takes effect.
- Decompress the Metricbeat installation package you have downloaded during preparations, and go to the Metricbeat folder.
- Open the metricbeat.yml file and edit the
Elasticsearch outputsection in it. You must uncomment the involved content.
Parameter Description hosts The internal or public endpoint of your Alibaba Cloud Elasticsearch cluster. This section uses the public endpoint as an example. protocol Set this parameter to http. username The default value is elastic. password The password that you set when you purchase your Alibaba Cloud Elasticsearch cluster.
- Run the following command to start Metricbeat:
./metricbeat -e -c metricbeat.ymlAfter Metricbeat is started, it starts to ship data to your Alibaba Cloud Elasticsearch cluster.
View the dashboard in Kibana
- List of metrics
- CPU metrics
Note You can configure metrics to be refreshed at 5-second intervals. The system generates reports for the metrics based on the intervals. You can also connect to WebHook to configure alerts.