GHCND Big Data API Server

Operations and Maintenance

Data Correction and Regeneration

If an aggregated HDFS table is created with an incorrect schema or data (for example, due to pointing a Spark job at the wrong input directory), remove it and regenerate:

hdfs dfs -rm -r /ghcnd/agg_tables/yearly_aggregates
spark-submit scripts/agg_tables/agg_table_yearly_aggregates.py

Apply the same pattern for other tables under /ghcnd/agg_tables/ as needed.

Spark Temporary Directories

The API uses a long-lived SparkSession running under a systemd service. If /tmp is cleaned aggressively, Spark may experience missing block manager directories (errors mentioning /tmp/blockmgr-...).

In such cases, restart the service to create new temporary directories:

sudo systemctl restart ghcnd-api

Null Values in Responses

When no data is found for a requested combination of country_prefix, start_year, and end_year, some endpoints return null values rather than failing:

Client code should be written to handle null values explicitly.

Monitoring

Use standard systemd and journal commands:

sudo systemctl status ghcnd-api
journalctl -u ghcnd-api -f

Monitor:

Analysis and Spark Helper Scripts

The repository includes several additional shell and Python helpers:

Acknowledgements