Commit 02e365c 1 parent 8414fbc commit 02e365c Copy full SHA for 02e365c
File tree 3 files changed +86
-9
lines changed
3 files changed +86
-9
lines changed Original file line number Diff line number Diff line change 10
10
11
11
# Adjust based on the build of H2O you want to download.
12
12
h2oBranch=master
13
- curl -o latest https://h2o-release.s3.amazonaws.com/h2o/master/latest
13
+
14
+ echo " Fetching latest build number for branch ${h2oBranch} ..."
15
+ curl --silent -o latest https://h2o-release.s3.amazonaws.com/h2o/master/latest
14
16
h2oBuild=` cat latest`
15
- curl -o project_version https://h2o-release.s3.amazonaws.com/h2o/master/${h2oBuild} /project_version
17
+
18
+ echo " Fetching full version number for build ${h2oBuild} ..."
19
+ curl --silent -o project_version https://h2o-release.s3.amazonaws.com/h2o/master/${h2oBuild} /project_version
16
20
h2oVersion=` cat project_version`
17
21
22
+ echo " Downloading H2O version ${h2oVersion} to cluster..."
23
+
18
24
i=0
19
25
for publicDnsName in $( cat nodes-public)
20
26
do
21
27
i=$(( i+ 1 ))
22
28
echo " Downloading h2o.jar to node ${i} : ${publicDnsName} "
23
- ssh -o StrictHostKeyChecking=no -i ${AWS_SSH_PRIVATE_KEY_FILE} ec2-user@${publicDnsName} curl -o h2o-${h2oVersion} .zip https://s3.amazonaws.com/h2o-release/h2o/${h2oBranch} /${h2oBuild} /h2o-${h2oVersion} .zip
24
- ssh -o StrictHostKeyChecking=no -i ${AWS_SSH_PRIVATE_KEY_FILE} ec2-user@${publicDnsName} unzip -o h2o-${h2oVersion} .zip
25
- ssh -o StrictHostKeyChecking=no -i ${AWS_SSH_PRIVATE_KEY_FILE} ec2-user@${publicDnsName} cp -f h2o-${h2oVersion} /h2o.jar .
29
+ ssh -o StrictHostKeyChecking=no -i ${AWS_SSH_PRIVATE_KEY_FILE} ec2-user@${publicDnsName} curl --silent -o h2o-${h2oVersion} .zip https://s3.amazonaws.com/h2o-release/h2o/${h2oBranch} /${h2oBuild} /h2o-${h2oVersion} .zip &
30
+ done
31
+ wait
32
+
33
+ i=0
34
+ for publicDnsName in $( cat nodes-public)
35
+ do
36
+ i=$(( i+ 1 ))
37
+ echo " Unzipping h2o.jar within node ${i} : ${publicDnsName} "
38
+ ssh -o StrictHostKeyChecking=no -i ${AWS_SSH_PRIVATE_KEY_FILE} ec2-user@${publicDnsName} unzip -o h2o-${h2oVersion} .zip 1> /dev/null &
39
+ done
40
+ wait
41
+
42
+ i=0
43
+ for publicDnsName in $( cat nodes-public)
44
+ do
45
+ i=$(( i+ 1 ))
46
+ echo " Copying h2o.jar within node ${i} : ${publicDnsName} "
47
+ ssh -o StrictHostKeyChecking=no -i ${AWS_SSH_PRIVATE_KEY_FILE} ec2-user@${publicDnsName} cp -f h2o-${h2oVersion} /h2o.jar . &
26
48
done
49
+ wait
27
50
28
51
echo Success.
Original file line number Diff line number Diff line change 49
49
# --------------------------------------------------------
50
50
51
51
regionName = 'us-east-1'
52
- amiId = 'ami-17c18b7e '
53
- # amiId = 'ami-634f050a' # old stable
52
+ amiId = 'ami-0ff1a466 '
53
+
54
54
55
55
#--------------------------------------------------------------------------
56
56
# No need to change anything below here.
124
124
fpublic .close ()
125
125
fprivate .close ()
126
126
127
- print
128
- print 'Distributing flatfile...'
127
+ print 'Sleeping for 60 seconds for ssh to be available...'
128
+ time . sleep ( 60 )
129
129
130
130
d = os .path .dirname (os .path .realpath (__file__ ))
131
+
132
+ print 'Testing ssh access...'
133
+ cmd = d + '/' + 'h2o-cluster-test-ssh.sh'
134
+ rv = os .system (cmd )
135
+ if rv != 0 :
136
+ print 'Failed.'
137
+ sys .exit (1 )
138
+
139
+ print
140
+ print 'Distributing flatfile...'
131
141
cmd = d + '/' + 'h2o-cluster-distribute-flatfile.sh'
132
142
rv = os .system (cmd )
133
143
if rv != 0 :
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if [ -z ${AWS_SSH_PRIVATE_KEY_FILE} ]
4
+ then
5
+ echo " ERROR: You must set AWS_SSH_PRIVATE_KEY_FILE in the environment."
6
+ exit 1
7
+ fi
8
+
9
+ i=0
10
+ maxRetries=12
11
+ retries=0
12
+ for publicDnsName in $( cat nodes-public)
13
+ do
14
+ if [ ${retries} -ge ${maxRetries} ]
15
+ then
16
+ echo " ERROR: Too many ssh retries."
17
+ exit 1
18
+ fi
19
+
20
+ i=$(( i+ 1 ))
21
+ echo " Testing ssh to node ${i} : ${publicDnsName} "
22
+
23
+ while true
24
+ do
25
+ ssh -o StrictHostKeyChecking=no -i ${AWS_SSH_PRIVATE_KEY_FILE} ec2-user@${publicDnsName} hostname
26
+ if [ $? -eq 0 ]
27
+ then
28
+ break
29
+ else
30
+ retries=$(( retries+ 1 ))
31
+
32
+ if [ ${retries} -ge ${maxRetries} ]
33
+ then
34
+ echo " ERROR: Too many ssh retries."
35
+ exit 1
36
+ fi
37
+
38
+ echo " Sleeping 5 seconds before retrying..."
39
+ sleep 5
40
+ fi
41
+ done
42
+ done
43
+
44
+ echo Success.
You can’t perform that action at this time.
0 commit comments