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 2014/04/02 06:11:57 UTC

[17/50] [abbrv] git commit: Switched ssh commands to use hostname instead of ip address.

Switched ssh commands to use hostname instead of ip address.


Project: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/commit/73875c67
Tree: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/tree/73875c67
Diff: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/diff/73875c67

Branch: refs/heads/prestonc/hash_join
Commit: 73875c673ab03f8d3f75154aea4bb38806232f22
Parents: 75d6077
Author: Preston Carman <pr...@apache.org>
Authored: Thu Mar 13 23:07:34 2014 -0700
Committer: Preston Carman <pr...@apache.org>
Committed: Tue Apr 1 20:56:24 2014 -0700

----------------------------------------------------------------------
 .../main/resources/scripts/cluster_actions.py   | 26 ++++++++++----------
 1 file changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/73875c67/vxquery-server/src/main/resources/scripts/cluster_actions.py
----------------------------------------------------------------------
diff --git a/vxquery-server/src/main/resources/scripts/cluster_actions.py b/vxquery-server/src/main/resources/scripts/cluster_actions.py
index 066aa4f..cef5db1 100644
--- a/vxquery-server/src/main/resources/scripts/cluster_actions.py
+++ b/vxquery-server/src/main/resources/scripts/cluster_actions.py
@@ -87,52 +87,52 @@ class ClusterActions:
         # 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() + ":"
+        self.run_remote_command(machine.get_username(), machine.get_id(), remove_tar_command)
+        copy_command = "scp " + tar_file + " " + machine.get_username() + "@" + machine.get_id() + ":"
         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)
+        self.run_remote_command(machine.get_username(), machine.get_id(), remove_folder_command)
         unpack_command = "tar -zxf " + tar_file + ""
-        self.run_remote_command(machine.get_username(), machine.get_ip(), unpack_command)
+        self.run_remote_command(machine.get_username(), machine.get_id(), 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)
+        self.run_remote_command(machine.get_username(), machine.get_id(), 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)
+        self.run_remote_command(machine.get_username(), machine.get_id(), chmod_command)
         
         print "  - Server clean up."
-        self.run_remote_command(machine.get_username(), machine.get_ip(), remove_tar_command)
+        self.run_remote_command(machine.get_username(), machine.get_id(), 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)
+        self.run_remote_command(machine.get_username(), machine.get_id(), 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)
+        self.run_remote_command(machine.get_username(), machine.get_id(), 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)
+        self.run_remote_command(machine.get_username(), machine.get_id(), 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)
+        self.run_remote_command(machine.get_username(), machine.get_id(), command)
         
-    def run_remote_command(self, username, ip_address, command):
-        remote_command = "ssh -x " + username + "@" + ip_address + " '" + command + "' "
+    def run_remote_command(self, username, host, command):
+        remote_command = "ssh -x " + username + "@" + host + " '" + command + "' "
 #         print remote_command
         os.system(remote_command)