You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by bu...@apache.org on 2017/03/31 18:24:43 UTC

asterixdb git commit: Support stopping and restarting for a AWS-based cluster instance.

Repository: asterixdb
Updated Branches:
  refs/heads/master 7f7eac067 -> 5914aa83d


Support stopping and restarting for a AWS-based cluster instance.

Change-Id: I77fff4a8a5f6e5d8ebee52eb66d86cc18f32cd12
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1643
Reviewed-by: Michael Blow <mb...@apache.org>
Sonar-Qube: Jenkins <je...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/5914aa83
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/5914aa83
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/5914aa83

Branch: refs/heads/master
Commit: 5914aa83d853c7c4755e82fa650d5db00aa6f05e
Parents: 7f7eac0
Author: Yingyi Bu <yi...@couchbase.com>
Authored: Fri Mar 31 09:53:19 2017 -0700
Committer: Yingyi Bu <bu...@gmail.com>
Committed: Fri Mar 31 11:24:30 2017 -0700

----------------------------------------------------------------------
 .../src/main/assembly/binary-assembly.xml       |  4 --
 .../src/main/opt/ansible/bin/stop.sh            |  2 +-
 .../src/main/opt/ansible/yaml/deploy_all.yml    | 11 ++++-
 .../main/opt/ansible/yaml/instance_start.yml    | 18 -------
 .../src/main/opt/aws/bin/deploy.sh              | 38 ++++++++++++++
 .../src/main/opt/aws/bin/start.sh               | 16 ++----
 .../asterix-server/src/main/opt/aws/bin/stop.sh | 10 ++--
 .../src/main/opt/aws/bin/terminate.sh           | 28 +++++++++++
 .../src/main/opt/aws/yaml/aws_stop.yml          | 37 --------------
 .../src/main/opt/aws/yaml/aws_terminate.yml     | 37 ++++++++++++++
 .../src/main/opt/aws/yaml/instance_init.yml     | 41 +++++++++++++++
 .../src/main/opt/aws/yaml/instance_start.yml    | 52 --------------------
 12 files changed, 166 insertions(+), 128 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/5914aa83/asterixdb/asterix-server/src/main/assembly/binary-assembly.xml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/assembly/binary-assembly.xml b/asterixdb/asterix-server/src/main/assembly/binary-assembly.xml
index d0bd88a..37f0e00 100644
--- a/asterixdb/asterix-server/src/main/assembly/binary-assembly.xml
+++ b/asterixdb/asterix-server/src/main/assembly/binary-assembly.xml
@@ -57,10 +57,6 @@
       <includes>
         <include>**/*.yml</include>
       </includes>
-      <excludes>
-        <exclude>**/instance_start.yml</exclude>
-        <exclude>**/gen_conf.yml</exclude>
-      </excludes>
       <filtered>true</filtered>
     </fileSet>
     <fileSet>

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/5914aa83/asterixdb/asterix-server/src/main/opt/ansible/bin/stop.sh
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/opt/ansible/bin/stop.sh b/asterixdb/asterix-server/src/main/opt/ansible/bin/stop.sh
index 200d6e6..247c32a 100755
--- a/asterixdb/asterix-server/src/main/opt/ansible/bin/stop.sh
+++ b/asterixdb/asterix-server/src/main/opt/ansible/bin/stop.sh
@@ -26,7 +26,7 @@ ANSB_PATH=`dirname "${SCRIPT_PATH}"`
 
 INVENTORY=$ANSB_PATH/conf/inventory
 
-# Starts the cluster
+# Stops the cluster
 export ANSIBLE_HOST_KEY_CHECKING=false
 ansible-playbook -i $INVENTORY $ANSB_PATH/yaml/instance_stop.yml
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/5914aa83/asterixdb/asterix-server/src/main/opt/ansible/yaml/deploy_all.yml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/opt/ansible/yaml/deploy_all.yml b/asterixdb/asterix-server/src/main/opt/ansible/yaml/deploy_all.yml
index 09ff365..663f371 100644
--- a/asterixdb/asterix-server/src/main/opt/ansible/yaml/deploy_all.yml
+++ b/asterixdb/asterix-server/src/main/opt/ansible/yaml/deploy_all.yml
@@ -17,8 +17,17 @@
 # under the License.
 # ------------------------------------------------------------
 
+- hosts: [localhost,]
+  vars:
+       temp_dir: "{{ playbook_dir }}/../conf/instance"
+       inventory: "{{ temp_dir }}/inventory"
+       ccconf: "{{ temp_dir }}/cc.conf"
+  tasks:
+    - include_vars: ../conf/instance_settings.yml
+    - include: gen_conf.yml
+
 - hosts: all
   tasks:
     - include_vars: ../conf/instance_settings.yml
+    - include: deploy.yml
 
-    - include: deploy.yml
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/5914aa83/asterixdb/asterix-server/src/main/opt/ansible/yaml/instance_start.yml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/opt/ansible/yaml/instance_start.yml b/asterixdb/asterix-server/src/main/opt/ansible/yaml/instance_start.yml
index d6661ca..80a6b65 100644
--- a/asterixdb/asterix-server/src/main/opt/ansible/yaml/instance_start.yml
+++ b/asterixdb/asterix-server/src/main/opt/ansible/yaml/instance_start.yml
@@ -18,26 +18,9 @@
 # ------------------------------------------------------------
 
 - hosts: [localhost,]
-  vars:
-       temp_dir: "{{ playbook_dir }}/../conf/instance"
-       inventory: "{{ temp_dir }}/inventory"
-       ccconf: "{{ temp_dir }}/cc.conf"
   tasks:
     - include: wait_ssh.yml
 
-    - include_vars: ../conf/instance_settings.yml
-
-    - include: gen_conf.yml
-
-- hosts: all
-  tasks:
-    - include_vars: ../conf/instance_settings.yml
-
-    - name: Ensure the log directory exists
-      file:
-        path: "{{ binarydir }}/logs"
-        state: directory
-
 - hosts: ncs
   tasks:
     - include_vars: ../conf/instance_settings.yml
@@ -49,4 +32,3 @@
     - include_vars: ../conf/instance_settings.yml
 
     - include: start_cc.yml
-

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/5914aa83/asterixdb/asterix-server/src/main/opt/aws/bin/deploy.sh
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/opt/aws/bin/deploy.sh b/asterixdb/asterix-server/src/main/opt/aws/bin/deploy.sh
new file mode 100755
index 0000000..d68ca87
--- /dev/null
+++ b/asterixdb/asterix-server/src/main/opt/aws/bin/deploy.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+# ------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ------------------------------------------------------------
+
+# Gets the absolute path so that the script can work no matter where it is invoked.
+pushd `dirname $0` > /dev/null
+SCRIPT_PATH=`pwd -P`
+popd > /dev/null
+AWS_PATH=`dirname "${SCRIPT_PATH}"`
+OPT_PATH=`dirname "${AWS_PATH}"`
+DIST_PATH=`dirname "${OPT_PATH}"`
+
+# Starts an AWS cluster.
+ansible-playbook -i "localhost," $AWS_PATH/yaml/aws_start.yml
+
+# Generates an Ansible inventory file and an AsterixDB configuration file.
+temp=$AWS_PATH/conf/instance
+inventory=$temp/inventory
+
+# Deploys asterixdb on all AWS instances.
+export ANSIBLE_HOST_KEY_CHECKING=false
+ansible-playbook -i $inventory $AWS_PATH/yaml/instance_init.yml

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/5914aa83/asterixdb/asterix-server/src/main/opt/aws/bin/start.sh
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/opt/aws/bin/start.sh b/asterixdb/asterix-server/src/main/opt/aws/bin/start.sh
index 8bffaa4..7c0609e 100755
--- a/asterixdb/asterix-server/src/main/opt/aws/bin/start.sh
+++ b/asterixdb/asterix-server/src/main/opt/aws/bin/start.sh
@@ -22,18 +22,10 @@
 pushd `dirname $0` > /dev/null
 SCRIPT_PATH=`pwd -P`
 popd > /dev/null
-AWS_PATH=`dirname "${SCRIPT_PATH}"`
-OPT_PATH=`dirname "${AWS_PATH}"`
-DIST_PATH=`dirname "${OPT_PATH}"`
+ANSB_PATH=`dirname "${SCRIPT_PATH}"`
 
-# Starts an AWS cluster.
-ansible-playbook -i "localhost," $AWS_PATH/yaml/aws_start.yml
+INVENTORY=$ANSB_PATH/conf/instance/inventory
 
-# Generates an Ansible inventory file and an AsterixDB configuration file.
-temp=$AWS_PATH/conf/instance
-inventory=$temp/inventory
-
-# Installs asterixdb on all AWS instances.
+# Starts the cluster
 export ANSIBLE_HOST_KEY_CHECKING=false
-ansible-playbook -i $inventory $AWS_PATH/yaml/instance_start.yml
-
+ansible-playbook -i $INVENTORY $ANSB_PATH/yaml/instance_start.yml

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/5914aa83/asterixdb/asterix-server/src/main/opt/aws/bin/stop.sh
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/opt/aws/bin/stop.sh b/asterixdb/asterix-server/src/main/opt/aws/bin/stop.sh
index 48f4ff7..ab9d342 100755
--- a/asterixdb/asterix-server/src/main/opt/aws/bin/stop.sh
+++ b/asterixdb/asterix-server/src/main/opt/aws/bin/stop.sh
@@ -22,7 +22,11 @@
 pushd `dirname $0` > /dev/null
 SCRIPT_PATH=`pwd -P`
 popd > /dev/null
-AWS_PATH=`dirname "${SCRIPT_PATH}"`
+ANSB_PATH=`dirname "${SCRIPT_PATH}"`
+
+INVENTORY=$ANSB_PATH/conf/instance/inventory
+
+# Stops the cluster
+export ANSIBLE_HOST_KEY_CHECKING=false
+ansible-playbook -i $INVENTORY $ANSB_PATH/yaml/instance_stop.yml
 
-# Terminates an AWS cluster.
-ansible-playbook -i "localhost," $AWS_PATH/yaml/aws_stop.yml

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/5914aa83/asterixdb/asterix-server/src/main/opt/aws/bin/terminate.sh
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/opt/aws/bin/terminate.sh b/asterixdb/asterix-server/src/main/opt/aws/bin/terminate.sh
new file mode 100755
index 0000000..58ff965
--- /dev/null
+++ b/asterixdb/asterix-server/src/main/opt/aws/bin/terminate.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+# ------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ------------------------------------------------------------
+
+# Gets the absolute path so that the script can work no matter where it is invoked.
+pushd `dirname $0` > /dev/null
+SCRIPT_PATH=`pwd -P`
+popd > /dev/null
+AWS_PATH=`dirname "${SCRIPT_PATH}"`
+
+# Terminates an AWS cluster.
+ansible-playbook -i "localhost," $AWS_PATH/yaml/aws_terminate.yml

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/5914aa83/asterixdb/asterix-server/src/main/opt/aws/yaml/aws_stop.yml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/opt/aws/yaml/aws_stop.yml b/asterixdb/asterix-server/src/main/opt/aws/yaml/aws_stop.yml
deleted file mode 100644
index b466ad4..0000000
--- a/asterixdb/asterix-server/src/main/opt/aws/yaml/aws_stop.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-# ------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ------------------------------------------------------------
-
-- name: Stop AWS cluster
-  hosts: localhost
-  gather_facts: false
-  tasks:
-    - include_vars: ../conf/aws_settings.yml
-    - name: Stop all instance
-      ec2:
-        key_name: "{{ keypair }}"
-        group: "{{ group }}"
-        instance_type: "{{ instance_type }}"
-        image: "{{ image }}"
-        wait: true
-        region: "{{ region }}"
-        aws_access_key: "{{ access_key_id }}"
-        aws_secret_key: "{{ secret_access_key }}"
-        exact_count: 0
-        count_tag:
-          Name: "{{ tag }}"

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/5914aa83/asterixdb/asterix-server/src/main/opt/aws/yaml/aws_terminate.yml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/opt/aws/yaml/aws_terminate.yml b/asterixdb/asterix-server/src/main/opt/aws/yaml/aws_terminate.yml
new file mode 100644
index 0000000..c4e3050
--- /dev/null
+++ b/asterixdb/asterix-server/src/main/opt/aws/yaml/aws_terminate.yml
@@ -0,0 +1,37 @@
+# ------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ------------------------------------------------------------
+
+- name: Terminate AWS cluster
+  hosts: localhost
+  gather_facts: false
+  tasks:
+    - include_vars: ../conf/aws_settings.yml
+    - name: Terminate all instances
+      ec2:
+        key_name: "{{ keypair }}"
+        group: "{{ group }}"
+        instance_type: "{{ instance_type }}"
+        image: "{{ image }}"
+        wait: true
+        region: "{{ region }}"
+        aws_access_key: "{{ access_key_id }}"
+        aws_secret_key: "{{ secret_access_key }}"
+        exact_count: 0
+        count_tag:
+          Name: "{{ tag }}"

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/5914aa83/asterixdb/asterix-server/src/main/opt/aws/yaml/instance_init.yml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/opt/aws/yaml/instance_init.yml b/asterixdb/asterix-server/src/main/opt/aws/yaml/instance_init.yml
new file mode 100644
index 0000000..8e68b80
--- /dev/null
+++ b/asterixdb/asterix-server/src/main/opt/aws/yaml/instance_init.yml
@@ -0,0 +1,41 @@
+# ------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ------------------------------------------------------------
+
+
+- hosts: [localhost,]
+  tasks:
+    - include: wait_ssh.yml
+
+- hosts: all
+  tasks:
+    - include_vars: ../conf/aws_settings.yml
+    - include_vars: ../conf/instance/volumes.yml
+
+    - name: Mount instance local stores
+      include: mount.yml
+
+- hosts: all
+  tasks:
+    - include: install_jdk.yml
+
+    - include_vars: ../conf/instance_settings.yml
+
+    - include: deploy.yml
+
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/5914aa83/asterixdb/asterix-server/src/main/opt/aws/yaml/instance_start.yml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/opt/aws/yaml/instance_start.yml b/asterixdb/asterix-server/src/main/opt/aws/yaml/instance_start.yml
deleted file mode 100644
index 3a9fd5a..0000000
--- a/asterixdb/asterix-server/src/main/opt/aws/yaml/instance_start.yml
+++ /dev/null
@@ -1,52 +0,0 @@
-# ------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ------------------------------------------------------------
-
-
-- hosts: [localhost,]
-  tasks:
-    - include: wait_ssh.yml
-
-- hosts: all
-  tasks:
-    - include_vars: ../conf/aws_settings.yml
-    - include_vars: ../conf/instance/volumes.yml
-
-    - name: Mount instance local stores
-      include: mount.yml
-
-- hosts: all
-  tasks:
-    - include: install_jdk.yml
-
-    - include_vars: ../conf/instance_settings.yml
-
-    - include: deploy.yml
-
-- hosts: ncs
-  tasks:
-    - include_vars: ../conf/instance_settings.yml
-
-    - include: start_ncservice.yml
-
-- hosts: cc
-  tasks:
-    - include_vars: ../conf/instance_settings.yml
-
-    - include: start_cc.yml
-