forked from h2oai/h2o-2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ami to not include any h2o by default. Add test ssh script.
- Loading branch information
1 parent
8414fbc
commit 02e365c
Showing
3 changed files
with
86 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
if [ -z ${AWS_SSH_PRIVATE_KEY_FILE} ] | ||
then | ||
echo "ERROR: You must set AWS_SSH_PRIVATE_KEY_FILE in the environment." | ||
exit 1 | ||
fi | ||
|
||
i=0 | ||
maxRetries=12 | ||
retries=0 | ||
for publicDnsName in $(cat nodes-public) | ||
do | ||
if [ ${retries} -ge ${maxRetries} ] | ||
then | ||
echo "ERROR: Too many ssh retries." | ||
exit 1 | ||
fi | ||
|
||
i=$((i+1)) | ||
echo "Testing ssh to node ${i}: ${publicDnsName}" | ||
|
||
while true | ||
do | ||
ssh -o StrictHostKeyChecking=no -i ${AWS_SSH_PRIVATE_KEY_FILE} ec2-user@${publicDnsName} hostname | ||
if [ $? -eq 0 ] | ||
then | ||
break | ||
else | ||
retries=$((retries+1)) | ||
|
||
if [ ${retries} -ge ${maxRetries} ] | ||
then | ||
echo "ERROR: Too many ssh retries." | ||
exit 1 | ||
fi | ||
|
||
echo "Sleeping 5 seconds before retrying..." | ||
sleep 5 | ||
fi | ||
done | ||
done | ||
|
||
echo Success. |