Create a script to ensure the Elasticsearch service (Es-Journals) on the Staging server remains operational and data integrity is maintained. This script should address the following issues:
Healthcheck Monitoring:
Continuously monitor the health of the Elasticsearch container.
Send an alert when the container is offline or encounters an error.
Service Restoration:
Attempt to automatically restore the Elasticsearch service when the container is detected as offline.
Log the actions taken to restore the service and notify the appropriate personnel.
Scheduler Integration:
Before executing the download scheduler, check the status of the Elasticsearch container.
If the service is offline, attempt to restore it before proceeding with any database operations.
Data Integrity:
Prevent the scheduler from downloading and overwriting previous databases if the Elasticsearch service is not operational.
Ensure that only the latest successfully downloaded database is indexed when the service is restored.
Implement a mechanism to collect and verify all files from a database checkpoint to the current date, ensuring all indexed data matches the latest collected data from medrxiv and biorxiv.
Problem Background:
The Elasticsearch service has been encountering issues where it exits with code 137, likely due to running out of memory. This results in the container crashing and the service becoming unavailable. Despite the service being down, the scheduler continues to download and overwrite previous databases, leading to incomplete reindexing when the service is restored.
Description:
Create a script to ensure the Elasticsearch service (Es-Journals) on the Staging server remains operational and data integrity is maintained. This script should address the following issues:
Healthcheck Monitoring:
Service Restoration:
Scheduler Integration:
Data Integrity:
Problem Background:
The Elasticsearch service has been encountering issues where it exits with code 137, likely due to running out of memory. This results in the container crashing and the service becoming unavailable. Despite the service being down, the scheduler continues to download and overwrite previous databases, leading to incomplete reindexing when the service is restored.
Logs:
Potential Cause:
Exit code 137 indicates the process was killed by SIGKILL, likely due to running out of memory .
Additional Information
Code of Conduct