conductor(checkpoint): Checkpoint end of Phase 2
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import consul_client
|
||||
import litefs_client
|
||||
import nomad_client
|
||||
|
||||
def get_cluster_status(consul_url):
|
||||
def get_cluster_status(consul_url, job_id="navidrome-litefs"):
|
||||
"""
|
||||
Aggregates cluster data from Consul and LiteFS.
|
||||
Aggregates cluster data from Consul, LiteFS, and Nomad.
|
||||
"""
|
||||
consul_nodes = consul_client.get_cluster_services(consul_url)
|
||||
aggregated_nodes = []
|
||||
@@ -21,11 +22,17 @@ def get_cluster_status(consul_url):
|
||||
"uptime": litefs_status.get("uptime", "N/A"),
|
||||
"advertise_url": litefs_status.get("advertise_url", ""),
|
||||
"replication_lag": litefs_status.get("replication_lag", "N/A"),
|
||||
"litefs_error": litefs_status.get("error", None)
|
||||
"litefs_error": litefs_status.get("error", None),
|
||||
"nomad_logs": None
|
||||
}
|
||||
|
||||
if node["status"] != "passing":
|
||||
is_healthy = False
|
||||
# Fetch Nomad logs for critical nodes
|
||||
alloc_id = nomad_client.get_allocation_id(node["node"], job_id)
|
||||
if alloc_id:
|
||||
node_data["alloc_id"] = alloc_id
|
||||
node_data["nomad_logs"] = nomad_client.get_allocation_logs(alloc_id)
|
||||
|
||||
if node_data["litefs_primary"]:
|
||||
primary_count += 1
|
||||
|
||||
Reference in New Issue
Block a user