Merge lp:~yoshimov/appscale/recovery-tools into lp:appscale/trunk-tools

Proposed by NOMURA Yoshihide
Status: Rejected
Rejected by: Chris Bunch
Proposed branch: lp:~yoshimov/appscale/recovery-tools
Merge into: lp:appscale/trunk-tools
Diff against target: 86 lines (+15/-17)
3 files modified
bin/appscale-add-keypair (+10/-12)
bin/appscale-run-instances (+3/-3)
bin/appscale-terminate-instances (+2/-2)
To merge this branch: bzr merge lp:~yoshimov/appscale/recovery-tools
Reviewer Review Type Date Requested Status
Chris Bunch Pending
Review via email: mp+33597@code.launchpad.net

Description of the change

Changed to use shutdown option instead of stop for recovery.
Fixed key directory to use /etc/appscale.

To post a comment you must log in.

Unmerged revisions

178. By NOMURA Yoshihide

change to copy private key to db master for hypertable. (bug 586188)

177. By NOMURA Yoshihide

fix key location to use /etc/appscale.
change terminate command option.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/appscale-add-keypair'
2--- bin/appscale-add-keypair 2010-07-23 22:53:06 +0000
3+++ bin/appscale-add-keypair 2010-08-24 23:26:39 +0000
4@@ -47,19 +47,17 @@
5 end
6 FileUtils.chmod(0600, [path, pub_key])
7
8-ips = node_layout.nodes.collect { |node| node.id }
9-ips.each { |ip|
10+node_layout.nodes.each do |node|
11+ ip = node.id
12 puts CommonFunctions.shell("ssh-copy-id -i #{path} root@#{ip}")
13-# puts CommonFunctions.shell("scp -i #{path} #{path} root@#{ip}:.ssh/id_rsa")
14-# puts CommonFunctions.shell("scp -i #{path} #{path} root@#{ip}:.ssh/id_dsa")
15-# puts CommonFunctions.shell("scp -i #{path} #{pub_key} root@#{ip}:.ssh/id_rsa.pub")
16-}
17-
18-head_ip = node_layout.head_node.id
19-puts CommonFunctions.shell("scp -i #{path} #{path} root@#{head_ip}:.ssh/id_rsa")
20-# this is needed for EC2 integration.
21-puts CommonFunctions.shell("scp -i #{path} #{path} root@#{head_ip}:.ssh/id_dsa")
22-puts CommonFunctions.shell("scp -i #{path} #{pub_key} root@#{head_ip}:.ssh/id_rsa.pub")
23+ # Hypertable needs private key in db master.
24+ if node.is_shadow? || node.is_db_master?
25+ puts CommonFunctions.shell("scp -i #{path} #{path} root@#{ip}:.ssh/id_rsa")
26+ # this is needed for EC2 integration.
27+ puts CommonFunctions.shell("scp -i #{path} #{path} root@#{ip}:.ssh/id_dsa")
28+ puts CommonFunctions.shell("scp -i #{path} #{pub_key} root@#{ip}:.ssh/id_rsa.pub")
29+ end
30+end
31
32 FileUtils.cp(path, backup_key)
33 puts "A new ssh key has been generated for you and placed at #{path}. You can now use this key to log into any of the machines you specified without providing a password via the following command:\n\tssh root@XXX.XXX.XXX.XXX -i #{path}"
34
35=== modified file 'bin/appscale-run-instances'
36--- bin/appscale-run-instances 2010-08-19 00:53:40 +0000
37+++ bin/appscale-run-instances 2010-08-24 23:26:39 +0000
38@@ -290,7 +290,7 @@
39
40 puts "Copying over credentials for cloud #{cloud_num}"
41
42- cloud_key_dir = "/root/appscale/.appscale/keys/cloud#{cloud_num}"
43+ cloud_key_dir = "/etc/appscale/keys/cloud#{cloud_num}"
44 make_cloud_key_dir = "mkdir -p #{cloud_key_dir}"
45 CommonFunctions.run_remote_command(head_node_ip,
46 make_cloud_key_dir, true_key, @@verbose)
47@@ -306,7 +306,7 @@
48 elsif VALID_CLOUD_TYPES.include?(INFRASTRUCTURE)
49 puts "Copying over credentials for cloud"
50
51- cloud_key_dir = "/root/appscale/.appscale/keys/cloud1"
52+ cloud_key_dir = "/etc/appscale/keys/cloud1"
53 make_cloud_key_dir = "mkdir -p #{cloud_key_dir}"
54 CommonFunctions.run_remote_command(head_node_ip,
55 make_cloud_key_dir, true_key, @@verbose)
56@@ -317,7 +317,7 @@
57 CommonFunctions.scp_file(ec2_cert, "#{cloud_key_dir}/mycert.pem", head_node_ip, true_key)
58 CommonFunctions.scp_file(ec2_private_key, "#{cloud_key_dir}/mykey.pem", head_node_ip, true_key)
59 else
60- cloud_key_dir = "/root/appscale/.appscale/keys/cloud1"
61+ cloud_key_dir = "/etc/appscale/keys/cloud1"
62 make_cloud_key_dir = "mkdir -p #{cloud_key_dir}"
63 CommonFunctions.run_remote_command(head_node_ip,
64 make_cloud_key_dir, true_key, @@verbose)
65
66=== modified file 'bin/appscale-terminate-instances'
67--- bin/appscale-terminate-instances 2010-08-03 16:20:01 +0000
68+++ bin/appscale-terminate-instances 2010-08-24 23:26:39 +0000
69@@ -102,7 +102,7 @@
70 ssh_key_location = "~/.appscale/#{keyname}"
71 table = CommonFunctions.get_table(keyname)
72
73- command = "service appscale-controller stop"
74+ command = "service appscale-controller shutdown"
75
76 boxes_shut_down = 0
77 node_layout = NodeLayout.new(IPS, { :database => table }, skip_replication=true)
78@@ -125,7 +125,7 @@
79 STDOUT.flush
80 loop {
81 ps = `ssh root@#{ip} -o StrictHostkeyChecking=no -i #{ssh_key_location} 'ps x'`
82- processes_left = ps.scan(/appscale-controller stop/).length
83+ processes_left = ps.scan(/appscale-controller shutdown/).length
84 break if processes_left == 0
85 print '.'
86 STDOUT.flush

Subscribers

People subscribed via source and target branches