Configure Consistency Notifications for CloudWatch and
Amazon SQS

When CloudWatch metrics are enabled, a metric named
Inconsistency is pushed each time a
FileSystem API call fails due to Amazon S3 eventual consistency.

To view CloudWatch metrics for Amazon S3 eventual consistency issues

To view the Inconsistency metric in the CloudWatch console, select the
EMRFS metrics and then select a JobFlowId/Metric
Name pair. For example: j-162XXXXXXM2CU ListStatus,
j-162XXXXXXM2CU
GetFileStatus, and so on.

In the Job Flow Metrics pane, select one or more
JobFlowId/Metric Name pairs. A
graphical representation of the metrics appears in the window below.

Amazon SQS

When Amazon SQS notifications are enabled, an Amazon SQS queue with the name
EMRFS-Inconsistency-<jobFlowId> is created when EMRFS is
initialized. Amazon SQS messages are pushed into the queue when a
FileSystem API call fails due to Amazon S3 eventual consistency.
The message contains information such as JobFlowId, API, a list of
inconsistent paths, a stack trace, and so on. Messages can be read using the
Amazon SQS console or using the EMRFS read-sqs command.

Amazon SQS messages for Amazon S3 eventual consistency issues can be read using the
EMRFS CLI. To read messages from an EMRFS Amazon SQS queue, type the
read-sqs command and specify an output location on the
master node's local file system for the resulting output file.

You can also delete an EMRFS Amazon SQS queue using the delete-sqs
command.

To read messages from an Amazon SQS queue, type the following command.
Replace queuename with the name of the Amazon SQS
queue that you configured and replace
/path/filename with the path to the
output file:

Copy

emrfs read-sqs -queue-name queuename -output-file /path/filename

For example, to read and output Amazon SQS messages from the default queue,
type: