Authored by hugufei

Merge branch 'dev' into test

#!/bin/bash
#@Authro Lijian
#@Date 2007-05-24
BASE_BIN_DIR=`dirname $0`
. $BASE_BIN_DIR/functions.sh
export JAVA_HOME=/usr/local/java
export WEB_APP_HOME=/home/test/yoho-search-service/deploy
export SERVER_PORT=0
export PRODUCTION_MODE="TEST"
export SERVER_HOME=/usr/local/tomcat
export SERVER_TYPE=tomcat
export SERVER_NAMESPACE=yohosearch
export GW_URL=$Gateway_URL
export SERVER_BASE_DIR=" -Dcatalina.base=/home/test/yoho-search-service/deploy/.tomcat "
export NAMING_PORT=`expr 9000 + $SERVER_PORT`
export HTTP_SERVER_PORT=`expr 8080 + $SERVER_PORT`
export CHECK_SERVER_STARTUP_URL="http://127.0.0.1:$HTTP_SERVER_PORT/$SERVER_NAMESPACE/common/ok.jsp"
export STARTUP_SUCCESS_MSG="Server Online Resources ok"
export JAVA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true "
export JAVA_DEBUG_OPT=" -server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=,server=y,suspend=n "
export TIGER_JMX_OPT=" -Dcom.sun.management.config.file=$WEB_APP_HOME/conf/jmx/jmx_monitor_management.properties "
if [ ! -e $JAVA_HOME ]; then
failed "********************************************************************"
failed "**Error: JAVA_HOME $JAVA_HOME not exist"
failed "********************************************************************"
exit 1
fi
if [ ! -e $SERVER_HOME ]; then
failed "********************************************************************"
failed "**Error: SERVER_HOME $SERVER_HOME not exist."
failed "********************************************************************"
exit 1
fi
#========end enviroment var define
if [ $PRODUCTION_MODE = "PRODUCT" ]; then
#after the environment of online is all 64-bit,the below if and else judgement can be delete
str=`file $JAVA_HOME/bin/java | grep 64-bit`
if [ -n "$str" ]; then
let memTotal=`cat /proc/meminfo |grep MemTotal|awk '{printf "%d", $2/1024 }'`
if [ $memTotal -gt 10000 ];then
JAVA_MEM_OPTS=" -server -Xmx4000M -Xms4000M -Xmn600M -XX:PermSize=200M -XX:MaxPermSize=200M -Xss256K -XX:+DisableExplicitGC -XX:SurvivorRatio=1 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:+CMSClassUnloadingEnabled -XX:LargePageSizeInBytes=128M -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=80 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -Xloggc:$WEB_APP_HOME/logs/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$WEB_APP_HOME/logs/heapdump.hprof "
else
JAVA_MEM_OPTS=" -server -Xmx1g -Xms1g -Xmn256m -XX:PermSize=128m -Xss256k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=64m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 "
fi
else
JAVA_MEM_OPTS=" -server -Xms1024m -Xmx1024m -XX:PermSize=128m -XX:SurvivorRatio=2 -XX:+UseParallelGC "
fi
JAVA_OPTS=" $JAVA_OPTS $JAVA_MEM_OPTS "
elif [ $PRODUCTION_MODE = "TEST" ]; then
JAVA_MEM_OPTS=" -server -Xms1024m -Xmx1024m -XX:MaxPermSize=128m -XX:SurvivorRatio=2 -XX:+UseParallelGC "
JAVA_OPTS=" $JAVA_OPTS $JAVA_MEM_OPTS "
elif [ $PRODUCTION_MODE = "DEV" ]; then
#we shuold reduce resource usage on developing mode
JAVA_MEM_OPTS=" -server -Xms64m -Xmx1024m -XX:MaxPermSize=128m "
JAVA_OPTS=" $JAVA_OPTS $JAVA_MEM_OPTS $JAVA_DEBUG_OPT "
else
failed "********************************************************************"
failed "**Error: \$PRODUCTION_MODE should be only: run, test, dev"
failed "********************************************************************"
exit 1
fi
JAVA_OPTS=" $JAVA_OPTS $SERVER_BASE_DIR "
#!/bin/bash
#@Authro Lijian
#@Date 2007-05-24
BASE_BIN_DIR=`dirname $0`
. $BASE_BIN_DIR/functions.sh
export JAVA_HOME=/usr/local/java
export WEB_APP_HOME=/home/master/yoho-search-service/deploy
export SERVER_PORT=0
export PRODUCTION_MODE="PRODUCT"
export SERVER_HOME=/usr/local/tomcat
export SERVER_TYPE=tomcat
export SERVER_NAMESPACE=yohosearch
export GW_URL=$Gateway_URL
export SERVER_BASE_DIR=" -Dcatalina.base=/home/master/yoho-search-service/deploy/.tomcat "
export NAMING_PORT=`expr 9000 + $SERVER_PORT`
export HTTP_SERVER_PORT=`expr 8080 + $SERVER_PORT`
export CHECK_SERVER_STARTUP_URL="http://127.0.0.1:$HTTP_SERVER_PORT/$SERVER_NAMESPACE/common/ok.jsp"
export STARTUP_SUCCESS_MSG="Server Online Resources ok"
export JAVA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true "
export JAVA_DEBUG_OPT=" -server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=,server=y,suspend=n "
export TIGER_JMX_OPT=" -Dcom.sun.management.config.file=$WEB_APP_HOME/conf/jmx/jmx_monitor_management.properties "
if [ ! -e $JAVA_HOME ]; then
failed "********************************************************************"
failed "**Error: JAVA_HOME $JAVA_HOME not exist"
failed "********************************************************************"
exit 1
fi
if [ ! -e $SERVER_HOME ]; then
failed "********************************************************************"
failed "**Error: SERVER_HOME $SERVER_HOME not exist."
failed "********************************************************************"
exit 1
fi
#========end enviroment var define
if [ $PRODUCTION_MODE = "PRODUCT" ]; then
#after the environment of online is all 64-bit,the below if and else judgement can be delete
str=`file $JAVA_HOME/bin/java | grep 64-bit`
if [ -n "$str" ]; then
let memTotal=`cat /proc/meminfo |grep MemTotal|awk '{printf "%d", $2/1024 }'`
if [ $memTotal -gt 10000 ];then
JAVA_MEM_OPTS=" -server -Xmx4000M -Xms4000M -Xmn600M -XX:PermSize=200M -XX:MaxPermSize=200M -Xss256K -XX:+DisableExplicitGC -XX:SurvivorRatio=1 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:+CMSClassUnloadingEnabled -XX:LargePageSizeInBytes=128M -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=80 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -Xloggc:$WEB_APP_HOME/logs/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$WEB_APP_HOME/logs/heapdump.hprof "
else
JAVA_MEM_OPTS=" -server -Xmx1g -Xms1g -Xmn256m -XX:PermSize=128m -Xss256k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=64m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 "
fi
else
JAVA_MEM_OPTS=" -server -Xms1024m -Xmx1024m -XX:PermSize=128m -XX:SurvivorRatio=2 -XX:+UseParallelGC "
fi
JAVA_OPTS=" $JAVA_OPTS $JAVA_MEM_OPTS "
elif [ $PRODUCTION_MODE = "TEST" ]; then
JAVA_MEM_OPTS=" -server -Xms1024m -Xmx1024m -XX:MaxPermSize=128m -XX:SurvivorRatio=2 -XX:+UseParallelGC "
JAVA_OPTS=" $JAVA_OPTS $JAVA_MEM_OPTS "
elif [ $PRODUCTION_MODE = "DEV" ]; then
#we shuold reduce resource usage on developing mode
JAVA_MEM_OPTS=" -server -Xms64m -Xmx1024m -XX:MaxPermSize=128m "
JAVA_OPTS=" $JAVA_OPTS $JAVA_MEM_OPTS $JAVA_DEBUG_OPT "
else
failed "********************************************************************"
failed "**Error: \$PRODUCTION_MODE should be only: run, test, dev"
failed "********************************************************************"
exit 1
fi
JAVA_OPTS=" $JAVA_OPTS $SERVER_BASE_DIR "
... ...
# ******************** redis servers ********************
redis.proxy.address=192.168.102.216
redis.proxy.port = 6379
#redis
redis.proxy.address=192.168.50.69
redis.proxy.port=6379
redis.proxy.auth=
redis.readonly.proxy.address=192.168.102.216
redis.readonly.proxy.address=192.168.50.69
redis.readonly.proxy.port=6379
redis.readonly.proxy.auth=
redis.pool.maxTotal=100
redis.pool.maxIdle=100
redis.pool.maxWaitMillis=2000
redis.pool.minIdle=50
redis.pool.testOnBorrow=false
redis.pool.testWhileIdle=true
#mq
mq.server=192.168.102.208
mq.port=5672
mq.username=admin1
mq.password=123qwe
mq.exchange=yoho_search
#es
#search
search.es.cluster.name=yohosearch_test
search.es.servers=192.168.102.209:9300 192.168.102.208:9300
search.index.number_of_replicas=2
search.es.servers=192.168.102.209:9300 192.168.102.216:9300
search.index.number_of_replicas=1
search.index.refresh_interval=1
search.index.translog.flush_threshold_ops=5000
search.index.batch.limit=5000
... ... @@ -30,15 +17,12 @@ search.index.batch.limit.tbl=2000
search.index.batch.max.thread.size=10
search.minimum.should.match=75%
search.operator=and
search.default.field=productName_ansj^10,brandName^500,brandDomain^100,brandNameCn^100,brandNameEn^100,maxSort^300,middleSort^500,smallSort^1000,searchField_ansj,productSkn_ansj,brandNameCn_pinyin^100,maxSort_pinyin^300,middleSort_pinyin^500,smallSort_pinyin^1000,productKeyword^500,brandKeyword^500,searchField
search.default.field=productName_ansj^10,brandName^500,brandDomain^100,brandNameCn^100,brandNameEn^100,maxSort^300,middleSort^500,smallSort^1000,searchField_ansj,productSkn_ansj,brandNameCn_pinyin^100,maxSort_pinyin^300,middleSort_pinyin^500,smallSort_pinyin^1000,productKeyword^500,searchField
search.script.score=_score+doc['sortWeight'].value*0.003+(100-doc['breakingRate'].value)/100 * doc['salesWithDateDiff'].value/pow((now-doc['shelveTime'].value)/3600+2,1.8)
search.script.lang=groovy
tbl.product.private.key=a85bb0674e08986c6b115d5e3a4884fa
tbl.product.url=http://test.soa.global.yohobuy.com/product/api/v1/detail/
#zkAddress
zkAddress=192.168.102.205:2181
#web.context
#web.content
web.context=yohosearch
\ No newline at end of file
... ...