Yingyi Bu has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1549

Change subject: Fix local clsuter stop and erase scripts.
......................................................................

Fix local clsuter stop and erase scripts.

Change-Id: Ib62483bfbb08ebd6f3ed97d1b64645541ce19d35
---
M asterixdb/asterix-server/src/main/opt/ansible/bin/erase.sh
M asterixdb/asterix-server/src/main/opt/ansible/yaml/instance_stop.yml
2 files changed, 9 insertions(+), 4 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/49/1549/1

diff --git a/asterixdb/asterix-server/src/main/opt/ansible/bin/erase.sh 
b/asterixdb/asterix-server/src/main/opt/ansible/bin/erase.sh
index e7bf19d..c289996 100644
--- a/asterixdb/asterix-server/src/main/opt/ansible/bin/erase.sh
+++ b/asterixdb/asterix-server/src/main/opt/ansible/bin/erase.sh
@@ -26,6 +26,9 @@
 
 INVENTORY=$ANSB_PATH/conf/inventory
 
+# Stop the instance first.
+$ANSB_PATH/bin/stop.sh
+
 # Erase the installation binary on all nodes.
 # TODO(yingyi): erase all data/txn/log directories.
 export ANSIBLE_HOST_KEY_CHECKING=false
diff --git 
a/asterixdb/asterix-server/src/main/opt/ansible/yaml/instance_stop.yml 
b/asterixdb/asterix-server/src/main/opt/ansible/yaml/instance_stop.yml
index 7a942e9..654f3b4 100644
--- a/asterixdb/asterix-server/src/main/opt/ansible/yaml/instance_stop.yml
+++ b/asterixdb/asterix-server/src/main/opt/ansible/yaml/instance_stop.yml
@@ -20,14 +20,15 @@
 - hosts: all
   tasks:
     - name: Check CC and NC processes
-      shell: jps | egrep '(CDriver|NCService)' | awk '{print $1}'
+      shell: ps aux | grep java | egrep '(CDriver|NCService)'
       register: procs
 
     - set_fact:
         lines: "{{ procs.stdout_lines|length }}"
 
     - name: Stop the CC and NCs
-      shell: kill `jps | egrep '(CDriver|NCService)' | awk '{print $1}'`
+      shell: kill `ps aux | grep java | egrep '(CDriver|NCService)' | awk 
'{print $2}'`
+      failed_when: false
       when: lines != "0"
 
     - name: Wait two seconds
@@ -35,12 +36,13 @@
       when: lines != "0"
 
     - name: Check leftover CC and NC processes
-      shell: jps | egrep '(CDriver|NCService)' | awk '{print $1}'
+      shell: ps aux | grep java | egrep '(CDriver|NCService)'
       register: procs
 
     - set_fact:
         lines: "{{ procs.stdout_lines|length }}"
 
     - name: Force stopping leftover CC and NC processes
-      shell: kill -9 `jps | egrep '(CDriver|NCService)' | awk '{print $1}'`
+      shell: kill -9 `ps aux | grep java | egrep '(CDriver|NCService)' | awk 
'{print $2}'`
+      failed_when: false
       when: lines != "0"

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1549
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib62483bfbb08ebd6f3ed97d1b64645541ce19d35
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <buyin...@gmail.com>

Reply via email to