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.
Add start file that lives on the AMI.
- Loading branch information
1 parent
b25615d
commit 2a47733
Showing
2 changed files
with
25 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Files in this directory live in the ec2-user directory of the AMI, and | ||
may be called from scripts in the parent directory. |
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,23 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
d=`dirname $0` | ||
|
||
# Use 90% of RAM for H2O. | ||
memTotalKb=`cat /proc/meminfo | grep MemTotal | sed 's/MemTotal:[ \t]*//' | sed 's/ kB//'` | ||
memTotalMb=$[ $memTotalKb / 1024 ] | ||
tmp=$[ $memTotalMb * 90 ] | ||
xmxMb=$[ $tmp / 100 ] | ||
|
||
# First try running java. | ||
export JAVA_HOME=${d}/jdk1.7.0_40 | ||
echo JAVA_HOME is ${JAVA_HOME} | ||
${JAVA_HOME}/bin/java -version | ||
|
||
# Check that we can at least run H2O with the given java. | ||
${JAVA_HOME}/bin/java -jar h2o.jar -version | ||
|
||
# Start H2O disowned in the background. | ||
nohup ${JAVA_HOME}/bin/java -Xmx${xmxMb}m -jar h2o.jar -name H2ODemo -flatfile flatfile.txt -port 54321 -beta -ice_root ${d}/ice_root 1> h2o.out 2> h2o.err & | ||
|