You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vxquery.apache.org by pr...@apache.org on 2013/12/12 06:51:32 UTC
svn commit: r1550353 - in /incubator/vxquery/trunk/vxquery/vxquery-server:
./ src/main/resources/ src/main/resources/conf/ src/main/resources/scripts/
Author: prestonc
Date: Thu Dec 12 05:51:31 2013
New Revision: 1550353
URL: http://svn.apache.org/r1550353
Log:
Added scripts to start and stop the vxquery cluster.
Added:
incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/
incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/conf/
incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/conf/cluster_example.xml (with props)
incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/conf/local.xml (with props)
incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/
incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_actions.py (with props)
incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_cli.py (with props)
incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_information.py (with props)
incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/startcc.sh (with props)
incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/startnc.sh (with props)
incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/stopcc.sh (with props)
incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/stopnc.sh (with props)
Modified:
incubator/vxquery/trunk/vxquery/vxquery-server/pom.xml
Modified: incubator/vxquery/trunk/vxquery/vxquery-server/pom.xml
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-server/pom.xml?rev=1550353&r1=1550352&r2=1550353&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-server/pom.xml (original)
+++ incubator/vxquery/trunk/vxquery/vxquery-server/pom.xml Thu Dec 12 05:51:31 2013
@@ -67,6 +67,28 @@
</executions>
</plugin>
<plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.5</version>
+ <executions>
+ <execution>
+ <id>copy-scripts</id>
+ <!-- here the phase you need -->
+ <phase>package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>target/appassembler/bin</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources/scripts</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<executions>
Added: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/conf/cluster_example.xml
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/conf/cluster_example.xml?rev=1550353&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/conf/cluster_example.xml (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/conf/cluster_example.xml Thu Dec 12 05:51:31 2013
@@ -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.
+-->
+<cluster xmlns="cluster">
+ <name>local</name>
+ <username>joe</username>
+ <master_node>
+ <id>master</id>
+ <client_ip>128.195.52.177</client_ip>
+ <cluster_ip>192.168.100.0</cluster_ip>
+ </master_node>
+ <node>
+ <id>nodeA</id>
+ <cluster_ip>192.168.100.1</cluster_ip>
+ </node>
+ <node>
+ <id>nodeB</id>
+ <cluster_ip>192.168.100.2</cluster_ip>
+ </node>
+ <node>
+ <id>nodeC</id>
+ <cluster_ip>192.168.100.3</cluster_ip>
+ </node>
+</cluster>
Propchange: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/conf/cluster_example.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/conf/local.xml
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/conf/local.xml?rev=1550353&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/conf/local.xml (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/conf/local.xml Thu Dec 12 05:51:31 2013
@@ -0,0 +1,28 @@
+<!--
+ 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.
+-->
+<cluster xmlns="cluster">
+ <name>local</name>
+ <master_node>
+ <id>master</id>
+ <client_ip>127.0.0.1</client_ip>
+ <cluster_ip>127.0.0.1</cluster_ip>
+ </master_node>
+ <node>
+ <id>node1</id>
+ <cluster_ip>127.0.0.1</cluster_ip>
+ </node>
+</cluster>
Propchange: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/conf/local.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_actions.py
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_actions.py?rev=1550353&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_actions.py (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_actions.py Thu Dec 12 05:51:31 2013
@@ -0,0 +1,138 @@
+#!/usr/bin/env python
+#
+# 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.
+import time
+import subprocess
+import os
+
+from cluster_information import *
+
+class ClusterActions:
+ def __init__(self, cluster_xml_file):
+ self.ci = ClusterInformation(cluster_xml_file)
+
+ def deploy_cluster(self, base_folder):
+ pass
+
+ def deploy(self, push_folder):
+ push_folder_path = os.path.dirname(push_folder)
+ push_folder_name = os.path.basename(push_folder)
+ tar_file = push_folder_name + ".tar.gz"
+
+ # Make sure zip does not already exist.
+ remove_command = "rm " + tar_file
+ subprocess.call(remove_command, shell=True)
+ time.sleep(2)
+
+ # TODO Consider using python command instead of os.system.
+ print "Creating a zip file to push out."
+ # Change to root directory so you do not copy the directory you are in.
+ tar_command = "cd /tmp; tar -zcf " + tar_file + " -C " + push_folder_path + " " + push_folder_name
+ subprocess.call(tar_command, shell=True)
+ move_command = "mv /tmp/" + tar_file + " ."
+ subprocess.call(move_command, shell=True)
+
+ # Cluster Controller
+ machine = self.ci.get_master_node_machine()
+ self.deploy_machine(machine, tar_file)
+ # Node Controllers
+ for machine in self.ci.get_node_machine_list():
+ self.deploy_machine(machine, tar_file)
+
+ print "Remove the push zip file."
+ remove_command = "rm " + tar_file
+ subprocess.call(remove_command, shell=True)
+
+ def start(self):
+ machine = self.ci.get_master_node_machine()
+ self.start_cc(machine)
+ time.sleep(5)
+ self.start_all_ncs()
+
+ def stop(self):
+ self.stop_all_ncs()
+ time.sleep(2)
+ machine = self.ci.get_master_node_machine()
+ self.stop_cc(machine)
+
+ def start_all_ncs(self):
+ cc = self.ci.get_master_node_machine()
+ for machine in self.ci.get_node_machine_list():
+ self.start_nc(machine, cc)
+
+ def stop_all_ncs(self):
+ for machine in self.ci.get_node_machine_list():
+ self.stop_nc(machine)
+
+ # --------------------------------------------------------------------------
+ # Machine Specific Functions
+ # --------------------------------------------------------------------------
+ def deploy_machine(self, machine, tar_file):
+ print "Deploy Controller."
+ print " " + machine.get_id() + " " + machine.get_ip()
+
+ # Push the information out to each server.
+ print " - Add new file."
+ remove_tar_command = "rm " + tar_file + ""
+ self.run_remote_command(machine.get_username(), machine.get_ip(), remove_tar_command)
+ copy_command = "scp " + tar_file + " " + machine.get_username() + "@" + machine.get_ip() + ":"
+ subprocess.call(copy_command, shell=True)
+
+ print " - Expand new file."
+ base_folder = tar_file.split('.')[0]
+ remove_folder_command = "rm -rf " + base_folder + ""
+ self.run_remote_command(machine.get_username(), machine.get_ip(), remove_folder_command)
+ unpack_command = "tar -zxf " + tar_file + ""
+ self.run_remote_command(machine.get_username(), machine.get_ip(), unpack_command)
+ # Make the bin files executable.
+ chmod_command = "chmod u+x " + base_folder + "/target/appassembler/bin/vxq*"
+ self.run_remote_command(machine.get_username(), machine.get_ip(), chmod_command)
+ chmod_command = "chmod u+x " + base_folder + "/target/appassembler/bin/*.sh"
+ self.run_remote_command(machine.get_username(), machine.get_ip(), chmod_command)
+
+ print " - Server clean up."
+ self.run_remote_command(machine.get_username(), machine.get_ip(), remove_tar_command)
+
+
+ def start_cc(self, machine):
+ print "Start Cluster Controller."
+ print " " + machine.get_id() + " " + machine.get_ip()
+ command = "./vxquery-server/target/appassembler/bin/startcc.sh " + machine.get_ip()
+ self.run_remote_command(machine.get_username(), machine.get_ip(), command)
+
+ def start_nc(self, machine, cc):
+ print "Start Node Controller."
+ print " " + machine.get_id() + " " + machine.get_ip()
+ command = "./vxquery-server/target/appassembler/bin/startnc.sh " + cc.get_ip() + " " + machine.get_ip() + " " + machine.get_id()
+ self.run_remote_command(machine.get_username(), machine.get_ip(), command)
+
+ def stop_cc(self, machine):
+ print "Stop Cluster Controller."
+ print " " + machine.get_id() + " " + machine.get_ip()
+ command = "./vxquery-server/target/appassembler/bin/stopcc.sh " + machine.get_username()
+ self.run_remote_command(machine.get_username(), machine.get_ip(), command)
+
+ def stop_nc(self, machine):
+ print "Stop Node Controller."
+ print " " + machine.get_id() + " " + machine.get_ip()
+ command = "./vxquery-server/target/appassembler/bin/stopnc.sh " + machine.get_username()
+ self.run_remote_command(machine.get_username(), machine.get_ip(), command)
+
+ def run_remote_command(self, username, ip_address, command):
+ remote_command = "ssh -x " + username + "@" + ip_address + " '" + command + "' "
+# print remote_command
+ os.system(remote_command)
+
Propchange: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_actions.py
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_cli.py
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_cli.py?rev=1550353&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_cli.py (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_cli.py Thu Dec 12 05:51:31 2013
@@ -0,0 +1,87 @@
+#!/usr/bin/env python
+#
+# 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.
+import sys, getopt, os
+
+# Custom modules.
+from cluster_actions import *
+
+def main(argv):
+ action = ""
+ cluster_file_name = ""
+ deploy_path = ""
+
+ try:
+ opts, args = getopt.getopt(argv, "a:c:d:h", ["action=", "deploy_path="])
+ except getopt.GetoptError:
+ print 'The file options for cluster_cli.py were not correctly specified.'
+ print 'To see a full list of options try:'
+ print ' $ python cluster_cli.py -h'
+ sys.exit(2)
+ for opt, arg in opts:
+ if opt == '-h':
+ print 'Options for pushing a benchmark:'
+ print ' -a (str) The action to perform (deploy, start, or stop).'
+ print ' -c The XML cluster configuration file.'
+ sys.exit()
+ elif opt in ('-a', "--action"):
+ # check if file exists.
+ if arg in ('deploy', 'start', 'stop'):
+ action = arg
+ else:
+ print 'Error: Argument must be a string ("deploy", "start", or "stop") for --action (-a).'
+ sys.exit()
+ elif opt in ('-c', "--cluster"):
+ # check if file exists.
+ if os.path.exists(arg):
+ cluster_file_name = arg
+ else:
+ print 'Error: Argument must be a file name for --cluster (-c).'
+ sys.exit()
+ elif opt in ('-d', "--deploy_folder"):
+ # check if file exists.
+ if os.path.exists(arg):
+ if os.path.basename(arg) == "":
+ deploy_path = os.path.dirname(arg)
+ else:
+ deploy_path = arg
+ else:
+ print 'Error: Argument must be a file name for --folder (-f).'
+ sys.exit()
+
+ # Required fields to run the script.
+ if cluster_file_name == "" or not os.path.exists(cluster_file_name):
+ print 'Error: The cluster XML file option must be supplied: --cluster (-c).'
+ sys.exit()
+
+ # The action to take on the cluster.
+ cluster = ClusterActions(cluster_file_name)
+ if action == 'start':
+ cluster.start()
+ elif action == 'stop':
+ cluster.stop()
+ elif action == 'deploy':
+ if deploy_path != "":
+ cluster.deploy(deploy_path)
+ else:
+ print 'Error: The cluster cli must have a deploy_folder option when doing the deploy action: --deploy_folder (-d).'
+ sys.exit()
+ else:
+ print 'Error: The cluster cli must have an action option must be supplied: --action (-a).'
+ sys.exit()
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
Propchange: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_cli.py
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_information.py
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_information.py?rev=1550353&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_information.py (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_information.py Thu Dec 12 05:51:31 2013
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+#
+# 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.
+from xml.dom.minidom import parse
+
+class ClusterInformation:
+ def __init__(self, cluster_xml_file):
+ self.cluster_xml_file = cluster_xml_file
+
+ self.config = parse(self.cluster_xml_file)
+
+ def get_username(self):
+ return self.get_text(self.config.getElementsByTagName("username")[0])
+
+ # Depricated
+ def get_master_node_ip(self):
+ master_node = self.config.getElementsByTagName("master_node")[0]
+ return self.get_cluster_ip(master_node)
+
+ # Depricated
+ def get_node_ip_list(self):
+ nodes = []
+ for node in self.config.getElementsByTagName("node"):
+ nodes.append(self.get_cluster_ip(node))
+ return nodes
+
+ def get_master_node_machine(self):
+ master_node = self.config.getElementsByTagName("master_node")[0]
+ id = self.get_cluster_id(master_node)
+ ip = self.get_cluster_ip(master_node)
+ username = self.get_username()
+ return Machine(id, ip, username)
+
+ def get_node_machine_list(self):
+ nodes = []
+ username = self.get_username()
+ for node in self.config.getElementsByTagName("node"):
+ id = self.get_cluster_id(node)
+ ip = self.get_cluster_ip(node)
+ nodes.append(Machine(id, ip, username))
+ return nodes
+
+ # --------------------------------------------------------------------------
+ # Node Specific Functions
+ # --------------------------------------------------------------------------
+ def get_cluster_ip(self, node):
+ return self.get_text(node.getElementsByTagName("cluster_ip")[0])
+
+ def get_cluster_id(self, node):
+ return self.get_text(node.getElementsByTagName("id")[0])
+
+ def get_text(self, xml_node):
+ rc = []
+ for node in xml_node.childNodes:
+ if node.nodeType == node.TEXT_NODE:
+ rc.append(node.data)
+ return ''.join(rc)
+
+class Machine:
+ log_path = ""
+
+ def __init__(self, id, ip, username):
+ self.id = id
+ self.ip = ip
+ self.username = username
+
+ def get_id(self):
+ return self.id
+
+ def get_ip(self):
+ return self.ip
+
+ def get_username(self):
+ return self.username
+
+ def get_log_path(self):
+ return self.log_path
+
+ def set_log_path(self, path):
+ self.log_path = path
\ No newline at end of file
Propchange: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/cluster_information.py
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/startcc.sh
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/startcc.sh?rev=1550353&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/startcc.sh (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/startcc.sh Thu Dec 12 05:51:31 2013
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+hostname
+
+CCHOST=$1
+
+#Export JAVA_HOME and JAVA_OPTS
+export JAVA_HOME=$JAVA_HOME
+export JAVA_OPTS=$CCJAVA_OPTS
+
+VXQUERY_HOME=`pwd`
+CCLOGS_DIR=${VXQUERY_HOME}/logs
+
+#Remove the logs dir
+rm -rf $CCLOGS_DIR
+mkdir $CCLOGS_DIR
+
+
+#Launch hyracks cc script without toplogy
+${VXQUERY_HOME}/vxquery-server/target/appassembler/bin/vxquerycc -client-net-ip-address $CCHOST -cluster-net-ip-address $CCHOST &> $CCLOGS_DIR/cc.log &
Propchange: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/startcc.sh
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/startnc.sh
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/startnc.sh?rev=1550353&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/startnc.sh (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/startnc.sh Thu Dec 12 05:51:31 2013
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+hostname
+
+CCHOST=$1
+IPADDR=$2
+NODEID=$3
+
+
+#Set JAVA_HOME
+export JAVA_HOME=$JAVA_HOME
+
+#Set JAVA_OPTS
+export JAVA_OPTS=$NCJAVA_OPTS
+
+VXQUERY_HOME=`pwd`
+NCLOGS_DIR=${VXQUERY_HOME}/logs
+
+#Remove the logs dir
+rm -rf $NCLOGS_DIR
+mkdir $NCLOGS_DIR
+
+
+#Launch hyracks nc
+${VXQUERY_HOME}/vxquery-server/target/appassembler/bin/vxquerync -cc-host $CCHOST -cluster-net-ip-address $IPADDR -data-ip-address $IPADDR -result-ip-address $IPADDR -node-id $NODEID &> $NCLOGS_DIR/nc.log &
Propchange: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/startnc.sh
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/stopcc.sh
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/stopcc.sh?rev=1550353&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/stopcc.sh (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/stopcc.sh Thu Dec 12 05:51:31 2013
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+hostname
+
+USER=$1
+
+#Kill process
+#Kill process
+PID=`ps -ef|grep ${USER}|grep java|grep 'Dapp.name=pregelixcc'|awk '{print $2}'`
+
+if [ "$PID" == "" ]; then
+ PID=`ps -ef|grep ${USER}|grep java|grep 'hyracks'|awk '{print $2}'`
+fi
+
+if [ "$PID" == "" ]; then
+ USERID=`id | sed 's/^uid=//;s/(.*$//'`
+ PID=`ps -ef|grep ${USERID}|grep java|grep 'Dapp.name=pregelixcc'|awk '{print $2}'`
+fi
+
+echo $PID
+kill -9 $PID
+
Propchange: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/stopcc.sh
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/stopnc.sh
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/stopnc.sh?rev=1550353&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/stopnc.sh (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/stopnc.sh Thu Dec 12 05:51:31 2013
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+hostname
+
+USER=$1
+
+#Kill process
+PID=`ps -ef|grep ${USER}|grep java|grep 'Dapp.name=vxquerync'|awk '{print $2}'`
+
+if [ "$PID" == "" ]; then
+ PID=`ps -ef|grep ${USER}|grep java|grep 'hyracks'|awk '{print $2}'`
+fi
+
+if [ "$PID" == "" ]; then
+ USERID=`id | sed 's/^uid=//;s/(.*$//'`
+ PID=`ps -ef|grep ${USERID}|grep java|grep 'Dapp.name=vxquerync'|awk '{print $2}'`
+fi
+
+echo $PID
+kill -9 $PID
Propchange: incubator/vxquery/trunk/vxquery/vxquery-server/src/main/resources/scripts/stopnc.sh
------------------------------------------------------------------------------
svn:eol-style = native