01 Run list-domain-names command (OSX/Linux/UNIX) to list the name of each Amazon OpenSearch domain available in the selected AWS region:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
aws es list-domain-names
--region us-east-1
--query 'DomainNames[*].DomainName'
02 The command output should return the identifier (name) of each OpenSearch domain provisioned in the selected region:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
[
"trendmicro",
"cloudconformity"
]
03 Run describe-elasticsearch-domain command (OSX/Linux/UNIX) using the name of the Amazon OpenSearch cluster that you want to examine as the identifier parameter and custom query filters to get information about the cluster data nodes and their allocated storage:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
aws es describe-elasticsearch-domain
--region us-east-1
--domain-name trendmicro
--query 'DomainStatus.[{"NodeCount":ElasticsearchClusterConfig.InstanceCount,"VolumeSize":EBSOptions.VolumeSize}]'
04 The command output should return the information required to compute the amount of storage space, in GiB, allocated for the selected OpenSearch cluster:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
[
{
"NodeCount": 2,
"VolumeSize": 15
}
]
05 Run get-metric-statistics command (OSX/Linux/UNIX) to obtain the statistics recorded by Amazon CloudWatch for the FreeStorageSpace metric, representing the total amount of free storage space across all data nodes within the cluster. Change the--start-time (start recording date) and --end-time (stop recording date) parameters value to choose your own time frame for recording the FreeStorageSpace metric usage. Set the --period parameter value to define the granularity (in seconds) of the returned datapoints, based on your requirements. A period can be as short as 1 minute (60 seconds) or as long as 1 day (86400 seconds). The following command example returns the total amount of free storage space available for an OpenSearch domain named "trendmicro", usage data captured over a time period of 24 hours, using 1-hour period as the granularity for the returned datapoints:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
aws cloudwatch get-metric-statistics
--region us-east-1
--metric-name FreeStorageSpace
--start-time 2018-02-01T12:21:05
--end-time 2018-02-02T12:21:05
--period 3600
--namespace AWS/ES
--statistics Sum
--dimensions Name=DomainName,Value=trendmicro
06 The command output should return the storage space details requested (in Megabytes):
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
{
"Datapoints": [
{
"Timestamp": "2018-02-01T12:21:05Z",
"Sum": 1,410.4770,
"Unit": "Megabytes"
},
{
"Timestamp": "2018-02-01T13:21:05Z",
"Sum": 1,410.4765,
"Unit": "Megabytes"
},
{
"Timestamp": "2018-02-01T14:21:05Z",
"Sum": 1,410.4760,
"Unit": "Megabytes"
},
...
{
"Timestamp": "2018-02-02T10:21:05Z",
"Sum": 1,410.4700,
"Unit": "Megabytes"
},
{
"Timestamp": "2018-02-02T11:21:05Z",
"Sum": 1,410.4695,
"Unit": "Megabytes"
},
{
"Timestamp": "2018-02-02T12:21:05Z",
"Sum": 1,410.4690,
"Unit": "Megabytes"
}
],
"Label": "FreeStorageSpace"
}
07 Based on storage information gathered at steps no. 4 and 6, if the amount of free storage space is less than 10%, the selected Amazon OpenSearch cluster has insufficient disk space to perform optimally, therefore adding EBS-based storage to the existing data nodes is strongly recommended.
08 Repeat steps no. 3 – 7 for each Amazon OpenSearch cluster available in the selected AWS region.
09 Change the AWS cloud region by updating the --region command parameter value and repeat the Audit process for other regions.