mirror of
https://github.com/ansible/awx.git
synced 2026-02-23 22:16:00 -03:30
Implement cluster health checks
* Add a local node queue to execute targeted jobs * Add a setting for active cluster node id (per-node) * Base the heartbeat time on the `modified` time on the Instance table * Add periodic task that calls save() on the instance to update the heartbeat time if services are up * Purge/update any ha/instance management commands * Fix up CELERY_ROUTES settings data structure
This commit is contained in:
@@ -169,11 +169,12 @@ class ApiV1PingView(APIView):
|
||||
response = {
|
||||
'ha': is_ha_environment(),
|
||||
'version': get_awx_version(),
|
||||
'active_node': settings.CLUSTER_HOST_ID,
|
||||
}
|
||||
|
||||
response['instances'] = []
|
||||
for instance in Instance.objects.all():
|
||||
response['instances'].append(instance.hostname)
|
||||
response['instances'].append(dict(node=instance.hostname, heartbeat=instance.modified))
|
||||
response['instances'].sort()
|
||||
return Response(response)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user