Skip to content

Commit e787dbb

Browse files
authored
Remove stale nodes from cluster (#1009)
Remove stale nodes from cluster before version 8.10
1 parent e2206f2 commit e787dbb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# coding=utf-8
2+
from atlassian import Jira
3+
"""Remove stale nodes from cluster before version 8.10
4+
See https://confluence.atlassian.com/jirakb/remove-abandoned-or-offline-nodes-in-jira-data-center-946616137.html
5+
"""
6+
jira = Jira(url="http://localhost:8080", username="admin", password="admin")
7+
stale_node_ids = [_ ["nodeId"] for _ in jira.get_cluster_all_nodes() if not _["alive"] and _["state"] == "OFFLINE"]
8+
for _ in stale_node_ids: jira.delete_cluster_node(_)

0 commit comments

Comments
 (0)