Gehel has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/278072

Change subject: Adding script to restart Elasticsearch cluster.
......................................................................

Adding script to restart Elasticsearch cluster.

Change-Id: I7d294389c82fd313ad5a6f2d9f01da0dd2ad0307
---
M maintenance/elasticsearch-scripts/restart-cluster.bash
1 file changed, 13 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/72/278072/1

diff --git a/maintenance/elasticsearch-scripts/restart-cluster.bash 
b/maintenance/elasticsearch-scripts/restart-cluster.bash
index bca4f8b..9ce4b57 100755
--- a/maintenance/elasticsearch-scripts/restart-cluster.bash
+++ b/maintenance/elasticsearch-scripts/restart-cluster.bash
@@ -1,10 +1,10 @@
 #!/usr/bin/env bash
 set -e
 
-es_server_prefix=elastic20
-es_server_suffix=.codfw.wmnet
-first_server_index=1
-nb_of_servers_in_cluster=24
+es_server_prefix=elastic10
+es_server_suffix=.eqiad.wmnet
+first_server_index=7
+nb_of_servers_in_cluster=31
 
 for i in $(seq -w ${first_server_index} ${nb_of_servers_in_cluster}); do
     server="${es_server_prefix}${i}${es_server_suffix}"
@@ -17,7 +17,10 @@
     read
 
     echo "disabling replication"
-    ssh ${server} es-tool stop-replication
+    until ssh ${server} es-tool stop-replication
+    do
+        echo "failed to stop replication, trying again"
+    done
     echo "flushing markers"
     ssh ${server} curl -s -XPOST '127.0.0.1:9200/_flush/synced?pretty'
 
@@ -39,9 +42,12 @@
     echo "elasticsearch is started"
 
     echo "enabling replication"
-    ssh ${server} es-tool start-replication
+    until ssh ${server} es-tool start-replication
+    do
+        echo "failed to start replication, trying again"
+    done
 
-    echo "waiting for server recovery"
+    echo "waiting for cluster recovery"
     ssh ${server} "until curl -s 127.0.0.1:9200/_cat/health | grep green; do 
echo -n .; sleep 10; done"
 
     echo "${server} upgraded, please test"

-- 
To view, visit https://gerrit.wikimedia.org/r/278072
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d294389c82fd313ad5a6f2d9f01da0dd2ad0307
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Gehel <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to