Logs
Enable Client Log
Each Aerospike Node.js client instance runs a background cluster tend thread that periodically polls all nodes for cluster status. This background thread generates log messages that reflect node additions/removal and any errors when retrieving node status, peers, partition maps, and racks. User applications must enable this log to receive these important messages.
See Enable Log.
Circuit Breaker
Employ a circuit breaker that activates when a maximum error count is reached for a node and rejects requests to that node until the specified error window expires. The following config
fields can create a circuit breaker:
max_error_rate
Maximum number of errors allowed per node per config.errorRateWindow
. Errors include connection errors, timeouts, and device overloads. If config.maxErrorRate
is reached, further requests to that node are retried to another node depending on the replica policy. If maxRetries
are exhausted, the back-off error code Aerospike.status.MAX_ERROR_RATE
is returned.
error_rate_window
The number of cluster tend iterations that define the window for config.maxErrorRate
. One tend iteration is defined as the config.tenderInterval
(default 1 second) plus the time to tend all nodes. At the end of the window, the error count is reset to zero and the back-off state is removed on all nodes.
The user application could optionally use a fallback cluster to handle traffic when the circuit breaker is employed.