-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from MyCATApache/1.6
update
- Loading branch information
Showing
115 changed files
with
5,118 additions
and
1,256 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
#update | ||
#Mon Oct 19 16:26:50 CST 2015 | ||
#Mon Apr 24 16:41:54 CST 2017 | ||
dh1=0 | ||
jdbchost=0 | ||
dataHost2=0 | ||
localhost1=0 | ||
localhost4=0 | ||
dataHost1=0 | ||
localhost3=0 | ||
localhost2=0 | ||
localhost1=0 | ||
jdbclhost=0 | ||
jdbchost=0 |
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 |
---|---|---|
@@ -1,19 +1,47 @@ | ||
#!/bin/bash | ||
|
||
echo "check JAVA_HOME & java" | ||
JAVA_CMD=$JAVA_HOME/bin/java | ||
MYCAT_HOME="$(dirname `readlink -f $0`)/.." | ||
MAIN_CLASS=io.mycat.config.loader.zkprocess.xmltozk.XmltoZkMain | ||
if [ ! -d "$JAVA_HOME" ]; then | ||
echo --------------------------------------------------- | ||
echo WARN: JAVA_HOME environment variable is not set. | ||
echo --------------------------------------------------- | ||
JAVA_CMD=java | ||
|
||
JAVA_CMD="" | ||
|
||
#function log_info <msg> | ||
#stdout: YYYY-mm-dd HH:MM:ss INFO msg | ||
function log_info() { date +o"%F %T INFO $1" ; } | ||
function log_error() { date +o"%F %T ERROR $1" ; } | ||
|
||
#01. Locate java(JRE) | ||
java_in_wrapper="`sed -nr \ | ||
-e 's/^wrapper.java.command=(.*)[[:blank:]]*$/\1/p' \ | ||
$MYCAT_HOME/conf/wrapper.conf`" | ||
|
||
# test java(JRE) in this order: | ||
# wrapper.conf's java -> $JAVA_HOME/bin/java -> $PATH/java | ||
for java_cmd in "$java_in_wrapper" "$JAVA_HOME/bin/java" "java" ; do | ||
if $java_cmd -Xmx1m -version &>/dev/null ; then | ||
JAVA_CMD=$java_cmd | ||
break | ||
fi | ||
done | ||
|
||
if [ "$JAVA_CMD" == "" ]; then | ||
cat <<EOF | ||
`date +'%F %T'` ERROR Not found usable java in following path: | ||
$java_in_wrapper, $JAVA_HOME/bin/java, \$PATH/java | ||
Operations would not going on. | ||
EOF | ||
exit 1 | ||
fi | ||
|
||
log_info "JAVA_CMD=$JAVA_CMD" | ||
|
||
#02. Initialize /mycat of ZooKeeper | ||
log_info "Start to initialize /mycat of ZooKeeper" | ||
|
||
if ! $JAVA_CMD -Xms256M -Xmx1G -DMYCAT_HOME=$MYCAT_HOME -cp "$MYCAT_HOME/conf:$MYCAT_HOME/lib/*" $MAIN_CLASS ; then | ||
log_error "Something wrong happened, please refer logs above" | ||
exit 1 | ||
fi | ||
|
||
echo "---------set HOME_DIR------------" | ||
CURR_DIR=`pwd` | ||
cd .. | ||
MYCAT_HOME=`pwd` | ||
cd $CURR_DIR | ||
$JAVA_CMD -Xms256M -Xmx1G -XX:MaxPermSize=64M -DMYCAT_HOME=$MYCAT_HOME -cp "$MYCAT_HOME/conf:$MYCAT_HOME/lib/*" $MAIN_CLASS | ||
echo "---------finished------------" | ||
log_info "Done" | ||
exit 0 |
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
Oops, something went wrong.