Authored by jijing

Merge branch 'dev'

# Conflicts:
#	deploy/src/main/META-INF/autoconf/auto-config.xml
#	deploy/src/main/bin/env.bat
#	deploy/src/main/bin/env.sh
#	web/src/main/webapp/META-INF/autoconf/auto-config.xml
#	web/src/main/webapp/META-INF/autoconf/databases.yml
Showing 24 changed files with 204 additions and 78 deletions
@@ -5,3 +5,5 @@ classes/ @@ -5,3 +5,5 @@ classes/
5 .idea 5 .idea
6 *.iml 6 *.iml
7 *.classpath 7 *.classpath
  8 +service/search-service.eml
  9 +web/.settings/
@@ -3,9 +3,15 @@ @@ -3,9 +3,15 @@
3 <config> 3 <config>
4 <group> 4 <group>
5 <!--yoho-search-autoconfig--> 5 <!--yoho-search-autoconfig-->
  6 +<<<<<<< HEAD
6 <property name="yoho.searchservice.env.webapphome" defaultValue="/home/test/yoho-search-service/deploy" description="应用根目录"/> 7 <property name="yoho.searchservice.env.webapphome" defaultValue="/home/test/yoho-search-service/deploy" description="应用根目录"/>
7 <property name="yoho.searchservice.env.serverport" defaultValue="7" description="应用端口"/> 8 <property name="yoho.searchservice.env.serverport" defaultValue="7" description="应用端口"/>
8 <property name="yoho.searchservice.env.namespace" defaultValue="search-service" description="应用命名空间"/> 9 <property name="yoho.searchservice.env.namespace" defaultValue="search-service" description="应用命名空间"/>
  10 +=======
  11 + <property name="yoho.search.service.env.webapphome" defaultValue="/home/test/yoho-search-service/deploy" description="应用根目录"/>
  12 + <property name="yoho.search.service.env.serverport" defaultValue="7" description="应用端口"/>
  13 + <property name="yoho.search.service.env.namespace" defaultValue="search-service" description="应用命名空间"/>
  14 +>>>>>>> dev
9 <property name="yoho.env.javahome" defaultValue="/usr/local/java" description="" /> 15 <property name="yoho.env.javahome" defaultValue="/usr/local/java" description="" />
10 <property name="yoho.env.productmode" defaultValue="TEST" description="" /> 16 <property name="yoho.env.productmode" defaultValue="TEST" description="" />
11 <property name="yoho.env.serverhome" defaultValue="/usr/local/tomcat" description="" /> 17 <property name="yoho.env.serverhome" defaultValue="/usr/local/tomcat" description="" />
1 set JAVA_MEM_OPT= -Xms1024m -Xmx1024m -XX:MaxPermSize=128m -Djava.net.preferIPv4Stack=true 1 set JAVA_MEM_OPT= -Xms1024m -Xmx1024m -XX:MaxPermSize=128m -Djava.net.preferIPv4Stack=true
2 set JAVA_HOME=${yoho.env.javahome} 2 set JAVA_HOME=${yoho.env.javahome}
3 -set WEB_APP_HOME=${yoho.search.env.webapphome} 3 +set WEB_APP_HOME=${yoho.search.service.env.webapphome}
4 4
5 #if("${yoho.env.servertype}"=="jboss") 5 #if("${yoho.env.servertype}"=="jboss")
6 set JBOSS_HOME=${yoho.env.serverhome} 6 set JBOSS_HOME=${yoho.env.serverhome}
7 -set JBOSS_BASE_DIR=${yoho.search.env.webapphome}/jboss_server 7 +set JBOSS_BASE_DIR=${yoho.search.service.env.webapphome}/jboss_server
8 set JBOSS_SERVER_BASE_DIR= -Djboss.server.base.dir=%JBOSS_BASE_DIR% 8 set JBOSS_SERVER_BASE_DIR= -Djboss.server.base.dir=%JBOSS_BASE_DIR%
9 #end 9 #end
10 10
11 #if("${yoho.env.servertype}"=="tomcat") 11 #if("${yoho.env.servertype}"=="tomcat")
12 set CATALINA_HOME=${yoho.env.serverhome} 12 set CATALINA_HOME=${yoho.env.serverhome}
13 -set CATALINA_BASE=${yoho.search.env.webapphome}/tomcat_server 13 +set CATALINA_BASE=${yoho.search.service.env.webapphome}/tomcat_server
14 #end 14 #end
15 15
16 16
@@ -8,20 +8,20 @@ BASE_BIN_DIR=`dirname $0` @@ -8,20 +8,20 @@ BASE_BIN_DIR=`dirname $0`
8 . $BASE_BIN_DIR/functions.sh 8 . $BASE_BIN_DIR/functions.sh
9 9
10 export JAVA_HOME=${yoho.env.javahome} 10 export JAVA_HOME=${yoho.env.javahome}
11 -export WEB_APP_HOME=${yoho.searchservice.env.webapphome}  
12 -export SERVER_PORT=${yoho.searchservice.env.serverport} 11 +export WEB_APP_HOME=${yoho.search.service.env.webapphome}
  12 +export SERVER_PORT=${yoho.search.service.env.serverport}
13 export PRODUCTION_MODE="${yoho.env.productmode}" 13 export PRODUCTION_MODE="${yoho.env.productmode}"
14 export SERVER_HOME=${yoho.env.serverhome} 14 export SERVER_HOME=${yoho.env.serverhome}
15 export SERVER_TYPE=${yoho.env.servertype} 15 export SERVER_TYPE=${yoho.env.servertype}
16 -export SERVER_NAMESPACE=${yoho.searchservice.env.namespace} 16 +export SERVER_NAMESPACE=${yoho.search.service.env.namespace}
17 export GW_URL=${Gateway_URL} 17 export GW_URL=${Gateway_URL}
18 18
19 #if("${yoho.env.servertype}"=="jboss") 19 #if("${yoho.env.servertype}"=="jboss")
20 - export SERVER_BASE_DIR=" -Djboss.server.base.dir=${yoho.searchservice.env.webapphome}/.jboss/default " 20 + export SERVER_BASE_DIR=" -Djboss.server.base.dir=${yoho.search.service.env.webapphome}/.jboss/default "
21 #end 21 #end
22 22
23 #if("${yoho.env.servertype}"=="tomcat") 23 #if("${yoho.env.servertype}"=="tomcat")
24 - export SERVER_BASE_DIR=" -Dcatalina.base=${yoho.searchservice.env.webapphome}/.tomcat " 24 + export SERVER_BASE_DIR=" -Dcatalina.base=${yoho.search.service.env.webapphome}/.tomcat "
25 #end 25 #end
26 26
27 export NAMING_PORT=`expr 9000 + $SERVER_PORT` 27 export NAMING_PORT=`expr 9000 + $SERVER_PORT`
1 <?xml version="1.0" encoding="GB2312"?> 1 <?xml version="1.0" encoding="GB2312"?>
2 2
3 <application> 3 <application>
4 - <display-name>yoho-search</display-name>  
5 - <description>yoho-search</description> 4 + <display-name>yoho-search-service</display-name>
  5 + <description>yoho-search-service</description>
6 <module> 6 <module>
7 <web> 7 <web>
8 - <web-uri>yoho-search.war</web-uri>  
9 - <context-root>${yoho.search.env.namespace}</context-root> 8 + <web-uri>yoho-search-service.war</web-uri>
  9 + <context-root>${yoho.search.service.env.namespace}</context-root>
10 </web> 10 </web>
11 </module> 11 </module>
12 </application> 12 </application>
1 set JAVA_MEM_OPT= -Xms1024m -Xmx1024m -XX:MaxPermSize=128m -Djava.net.preferIPv4Stack=true 1 set JAVA_MEM_OPT= -Xms1024m -Xmx1024m -XX:MaxPermSize=128m -Djava.net.preferIPv4Stack=true
2 set JAVA_HOME=/usr/local/java 2 set JAVA_HOME=/usr/local/java
  3 +<<<<<<< HEAD
3 set WEB_APP_HOME=/home/master/yoho-search-service/deploy 4 set WEB_APP_HOME=/home/master/yoho-search-service/deploy
4 5
5 6
6 set CATALINA_HOME=/usr/local/tomcat 7 set CATALINA_HOME=/usr/local/tomcat
7 set CATALINA_BASE=/home/master/yoho-search/deploy/tomcat_server 8 set CATALINA_BASE=/home/master/yoho-search/deploy/tomcat_server
  9 +=======
  10 +set WEB_APP_HOME=/home/dev/yoho-search-service/deploy
  11 +
  12 +
  13 +set CATALINA_HOME=/usr/local/tomcat
  14 +set CATALINA_BASE=/home/dev/yoho-search-service/deploy/tomcat_server
  15 +>>>>>>> dev
8 16
9 17
10 rem set JAVA_DEBUG_OPT= -server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8082,server=y,suspend=n 18 rem set JAVA_DEBUG_OPT= -server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8082,server=y,suspend=n
  1 +<<<<<<< HEAD
1 #!/bin/bash 2 #!/bin/bash
2 #@Authro Lijian 3 #@Authro Lijian
3 #@Date 2007-05-24 4 #@Date 2007-05-24
@@ -75,3 +76,82 @@ fi @@ -75,3 +76,82 @@ fi
75 76
76 77
77 JAVA_OPTS=" $JAVA_OPTS $SERVER_BASE_DIR " 78 JAVA_OPTS=" $JAVA_OPTS $SERVER_BASE_DIR "
  79 +=======
  80 +#!/bin/bash
  81 +#@Authro Lijian
  82 +#@Date 2007-05-24
  83 +
  84 +BASE_BIN_DIR=`dirname $0`
  85 +. $BASE_BIN_DIR/functions.sh
  86 +
  87 +export JAVA_HOME=/usr/local/java
  88 +export WEB_APP_HOME=/home/dev/yoho-search-service/deploy
  89 +export SERVER_PORT=8
  90 +export PRODUCTION_MODE="TEST"
  91 +export SERVER_HOME=/usr/local/tomcat
  92 +export SERVER_TYPE=tomcat
  93 +export SERVER_NAMESPACE=search-service
  94 +export GW_URL=$Gateway_URL
  95 +
  96 +
  97 + export SERVER_BASE_DIR=" -Dcatalina.base=/home/dev/yoho-search-service/deploy/.tomcat "
  98 +
  99 +export NAMING_PORT=`expr 9000 + $SERVER_PORT`
  100 +export HTTP_SERVER_PORT=`expr 8080 + $SERVER_PORT`
  101 +
  102 +export CHECK_SERVER_STARTUP_URL="http://127.0.0.1:$HTTP_SERVER_PORT/$SERVER_NAMESPACE/common/ok.jsp"
  103 +export STARTUP_SUCCESS_MSG="Server Online Resources ok"
  104 +export JAVA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true "
  105 +export JAVA_DEBUG_OPT=" -server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=,server=y,suspend=n "
  106 +export TIGER_JMX_OPT=" -Dcom.sun.management.config.file=$WEB_APP_HOME/conf/jmx/jmx_monitor_management.properties "
  107 +
  108 +
  109 +if [ ! -e $JAVA_HOME ]; then
  110 + failed "********************************************************************"
  111 + failed "**Error: JAVA_HOME $JAVA_HOME not exist"
  112 + failed "********************************************************************"
  113 + exit 1
  114 +fi
  115 +
  116 +if [ ! -e $SERVER_HOME ]; then
  117 + failed "********************************************************************"
  118 + failed "**Error: SERVER_HOME $SERVER_HOME not exist."
  119 + failed "********************************************************************"
  120 + exit 1
  121 +fi
  122 +#========end enviroment var define
  123 +
  124 +
  125 +if [ $PRODUCTION_MODE = "PRODUCT" ]; then
  126 + #after the environment of online is all 64-bit,the below if and else judgement can be delete
  127 + str=`file $JAVA_HOME/bin/java | grep 64-bit`
  128 + if [ -n "$str" ]; then
  129 + let memTotal=`cat /proc/meminfo |grep MemTotal|awk '{printf "%d", $2/1024 }'`
  130 + if [ $memTotal -gt 10000 ];then
  131 + 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 "
  132 + else
  133 + 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 "
  134 + fi
  135 + else
  136 + JAVA_MEM_OPTS=" -server -Xms1024m -Xmx1024m -XX:PermSize=128m -XX:SurvivorRatio=2 -XX:+UseParallelGC "
  137 + fi
  138 +
  139 + JAVA_OPTS=" $JAVA_OPTS $JAVA_MEM_OPTS "
  140 +
  141 +elif [ $PRODUCTION_MODE = "TEST" ]; then
  142 + JAVA_MEM_OPTS=" -server -Xms1024m -Xmx1024m -XX:MaxPermSize=128m -XX:SurvivorRatio=2 -XX:+UseParallelGC "
  143 + JAVA_OPTS=" $JAVA_OPTS $JAVA_MEM_OPTS "
  144 +elif [ $PRODUCTION_MODE = "DEV" ]; then
  145 + #we shuold reduce resource usage on developing mode
  146 + JAVA_MEM_OPTS=" -server -Xms64m -Xmx1024m -XX:MaxPermSize=128m "
  147 + JAVA_OPTS=" $JAVA_OPTS $JAVA_MEM_OPTS $JAVA_DEBUG_OPT "
  148 +else
  149 + failed "********************************************************************"
  150 + failed "**Error: \$PRODUCTION_MODE should be only: run, test, dev"
  151 + failed "********************************************************************"
  152 + exit 1
  153 +fi
  154 +
  155 +
  156 +JAVA_OPTS=" $JAVA_OPTS $SERVER_BASE_DIR "
  157 +>>>>>>> dev
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 <dependencies> 23 <dependencies>
24 <dependency> 24 <dependency>
25 <groupId>com.yoho.search</groupId> 25 <groupId>com.yoho.search</groupId>
26 - <artifactId>services</artifactId> 26 + <artifactId>search-service</artifactId>
27 <version>${project.version}</version> 27 <version>${project.version}</version>
28 </dependency> 28 </dependency>
29 <dependency> 29 <dependency>
@@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
59 </dependencies> 59 </dependencies>
60 60
61 <modules> 61 <modules>
62 - <module>services</module> 62 + <module>service</module>
63 <module>web</module> 63 <module>web</module>
64 <module>deploy</module> 64 <module>deploy</module>
65 </modules> 65 </modules>
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 <artifactId>yoho-search-service</artifactId> 8 <artifactId>yoho-search-service</artifactId>
9 <version>1.0.0-SNAPSHOT</version> 9 <version>1.0.0-SNAPSHOT</version>
10 </parent> 10 </parent>
11 - <artifactId>services</artifactId> 11 + <artifactId>search-service</artifactId>
12 12
13 <dependencies> 13 <dependencies>
14 <dependency> 14 <dependency>
@@ -188,12 +188,12 @@ public class SearchController { @@ -188,12 +188,12 @@ public class SearchController {
188 * 将HttpServletRequest中被锁定的ParameterMap转化为普通的HashMap 188 * 将HttpServletRequest中被锁定的ParameterMap转化为普通的HashMap
189 * */ 189 * */
190 public static Map<String, String> transParamType(Map<String, Object> paramMap){ 190 public static Map<String, String> transParamType(Map<String, Object> paramMap){
191 - Map<String, String> rtnMap = new HashMap<String, String>();  
192 - Iterator<String> itKeys = paramMap.keySet().iterator();  
193 - while(itKeys.hasNext()){  
194 - String key = itKeys.next();  
195 - String val = ((String[])paramMap.get(key))[0];  
196 - rtnMap.put(key, val); 191 + Map<String, String> rtnMap = new HashMap<String, String>();
  192 + Iterator<String> itKeys = paramMap.keySet().iterator();
  193 + while(itKeys.hasNext()){
  194 + String key = itKeys.next();
  195 + String val = ((String[])paramMap.get(key))[0];
  196 + rtnMap.put(key, val);
197 } 197 }
198 return rtnMap; 198 return rtnMap;
199 } 199 }
@@ -1601,6 +1601,12 @@ public class SearchService { @@ -1601,6 +1601,12 @@ public class SearchService {
1601 int[] brandids = ConvertUtils.stringToIntArray(paramMap.get(ISearchConstans.PARAM_SEARCH_BRAND), ","); 1601 int[] brandids = ConvertUtils.stringToIntArray(paramMap.get(ISearchConstans.PARAM_SEARCH_BRAND), ",");
1602 boolFilter.must(FilterBuilders.termsFilter("brandId", brandids)); 1602 boolFilter.must(FilterBuilders.termsFilter("brandId", brandids));
1603 } 1603 }
  1604 + //店铺
  1605 + if (paramMap.containsKey(ISearchConstans.PARAM_SEARCH_SHOP) && StringUtils.isNotBlank(paramMap.get(ISearchConstans.PARAM_SEARCH_SHOP)) && !ISearchConstans.PARAM_SEARCH_SHOP.equals(filterParamName)) {
  1606 + int[] shopids = ConvertUtils.stringToIntArray(paramMap.get(ISearchConstans.PARAM_SEARCH_SHOP), ",");
  1607 + boolFilter.must(FilterBuilders.termsFilter("shopId", shopids));
  1608 + }
  1609 +
1604 if (paramMap.containsKey(ISearchConstans.PARAM_SEARCH_MAXSORT) && StringUtils.isNotBlank(paramMap.get(ISearchConstans.PARAM_SEARCH_MAXSORT)) && !ISearchConstans.PARAM_SEARCH_MAXSORT.equals(filterParamName)) { 1610 if (paramMap.containsKey(ISearchConstans.PARAM_SEARCH_MAXSORT) && StringUtils.isNotBlank(paramMap.get(ISearchConstans.PARAM_SEARCH_MAXSORT)) && !ISearchConstans.PARAM_SEARCH_MAXSORT.equals(filterParamName)) {
1605 int[] maxsortids = ConvertUtils.stringToIntArray(paramMap.get(ISearchConstans.PARAM_SEARCH_MAXSORT), ","); 1611 int[] maxsortids = ConvertUtils.stringToIntArray(paramMap.get(ISearchConstans.PARAM_SEARCH_MAXSORT), ",");
1606 boolFilter.must(FilterBuilders.termsFilter("maxSortId", maxsortids)); 1612 boolFilter.must(FilterBuilders.termsFilter("maxSortId", maxsortids));
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 </dependency> 18 </dependency>
19 <dependency> 19 <dependency>
20 <groupId>com.yoho.search</groupId> 20 <groupId>com.yoho.search</groupId>
21 - <artifactId>services</artifactId> 21 + <artifactId>search-service</artifactId>
22 </dependency> 22 </dependency>
23 <dependency> 23 <dependency>
24 <groupId>com.yoho.search</groupId> 24 <groupId>com.yoho.search</groupId>
@@ -78,23 +78,6 @@ @@ -78,23 +78,6 @@
78 <aop:advisor pointcut-ref="serviceMethodPoint" advice-ref="serviceMethodInterceptor"/> 78 <aop:advisor pointcut-ref="serviceMethodPoint" advice-ref="serviceMethodInterceptor"/>
79 </aop:config> 79 </aop:config>
80 80
81 - <!-- Redis 配置 start -->  
82 - <bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">  
83 - <property name="maxTotal" value="300" />  
84 - <property name="maxIdle" value="10" />  
85 - <property name="maxWaitMillis" value="1000" />  
86 - <property name="testOnBorrow" value="true" />  
87 - </bean>  
88 - <bean id="jedisPool" class="redis.clients.jedis.JedisPool">  
89 - <constructor-arg index="0" ref="jedisPoolConfig" />  
90 - <constructor-arg index="1" value="${redis.server}" />  
91 - <constructor-arg index="2" value="${redis.port}" />  
92 - </bean>  
93 - <!-- 包装类 -->  
94 - <bean id="redisUtil" class="com.yoho.search.utils.RedisUtil">  
95 - <property name="jedisPool" ref="jedisPool" />  
96 - </bean>  
97 -  
98 <bean id="applicationContextUtil" class="com.yoho.search.utils.ApplicationContextUtil"> 81 <bean id="applicationContextUtil" class="com.yoho.search.utils.ApplicationContextUtil">
99 </bean> 82 </bean>
100 <!-- Redis 配置 end --> 83 <!-- Redis 配置 end -->
1 -search.es.cluster.name=yohosearch  
2 -search.es.servers=192.168.10.63:9300 192.168.10.64:9300 192.168.10.65:9300 1 +search.es.cluster.name=yohosearch_test
  2 +search.es.servers=192.168.102.209:9300
3 #search.es.cluster.name=yohosearch_online 3 #search.es.cluster.name=yohosearch_online
4 #search.es.servers=123.57.172.205:9300 123.57.172.107:9300 123.57.172.201:9300 4 #search.es.servers=123.57.172.205:9300 123.57.172.107:9300 123.57.172.201:9300
5 search.index.number_of_replicas=2 5 search.index.number_of_replicas=2
@@ -9,10 +9,6 @@ search.index.batch.limit=5000 @@ -9,10 +9,6 @@ search.index.batch.limit=5000
9 search.index.batch.limit.tbl=2000 9 search.index.batch.limit.tbl=2000
10 search.index.batch.max.thread.size=10 10 search.index.batch.max.thread.size=10
11 11
12 -redis.server=192.168.50.69  
13 -redis.port=6379  
14 -  
15 -  
16 redis.pool.maxTotal=100 12 redis.pool.maxTotal=100
17 redis.pool.maxIdle=100 13 redis.pool.maxIdle=100
18 redis.pool.maxWaitMillis=2000 14 redis.pool.maxWaitMillis=2000
@@ -25,16 +21,16 @@ redis.pool.testWhileIdle=true @@ -25,16 +21,16 @@ redis.pool.testWhileIdle=true
25 redis.proxy.address=192.168.50.69 21 redis.proxy.address=192.168.50.69
26 redis.proxy.port=6379 22 redis.proxy.port=6379
27 #password, can be empty 23 #password, can be empty
28 -redis.proxy.auth=123456 24 +redis.proxy.auth=
29 25
30 redis.readonly.proxy.address=192.168.102.205 26 redis.readonly.proxy.address=192.168.102.205
31 redis.readonly.proxy.port=6379 27 redis.readonly.proxy.port=6379
32 -redis.readonly.proxy.auth=123456 28 +redis.readonly.proxy.auth=
33 29
34 mq.server=192.168.10.109 30 mq.server=192.168.10.109
35 mq.port=5672 31 mq.port=5672
36 -mq.username=admin  
37 -mq.password=123456 32 +mq.username=admin1
  33 +mq.password=123qwe
38 #mq.server=192.168.50.69 34 #mq.server=192.168.50.69
39 #mq.port=9646 35 #mq.port=9646
40 #mq.username=yhb_mq 36 #mq.username=yhb_mq
@@ -48,4 +44,4 @@ tbl.product.private.key=a85bb0674e08986c6b115d5e3a4884fa @@ -48,4 +44,4 @@ tbl.product.private.key=a85bb0674e08986c6b115d5e3a4884fa
48 tbl.product.url=http://test.soa.global.yohobuy.com/product/api/v1/detail/ 44 tbl.product.url=http://test.soa.global.yohobuy.com/product/api/v1/detail/
49 search.minimum.should.match=75% 45 search.minimum.should.match=75%
50 search.operator=and 46 search.operator=and
51 -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,searchField  
  47 +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
1 datasources: 1 datasources:
2 yhb_search_2016: 2 yhb_search_2016:
3 servers: 3 servers:
4 - - 192.168.50.69:9980  
5 - - 192.168.50.69:9980  
6 - username: yh_test  
7 - password: 9nm0icOwt6bMHjMusIfMLw== 4 + - 192.168.102.209:3306
  5 + - 192.168.102.209:3306
  6 + username: dev
  7 + password: dev
8 8
9 readOnlyInSlave: true 9 readOnlyInSlave: true
@@ -2,13 +2,18 @@ @@ -2,13 +2,18 @@
2 2
3 <config> 3 <config>
4 <group> 4 <group>
5 - <property name="yoho.searchservice.env.namespace" defaultValue="yohosearchservice" description="namespace"/>  
6 - <property name="yoho.searchservice.env.serverport" defaultValue="8" description="port"/>  
7 - <property name="yoho.searchservice.env.webapphome" defaultValue="/home/dev/yoho-search-service/deploy" description="install path"/> 5 + <property name="yoho.search.service.env.namespace" defaultValue="yohosearch" description="namespace"/>
  6 + <property name="yoho.search.service.env.serverport" defaultValue="7" description="port"/>
  7 + <property name="yoho.search.service.env.webapphome" defaultValue="/home/dev/yoho-search-service/deploy" description="install path"/>
8 8
9 <property name="java.logs.home" defaultValue="/Data/logs" description="日志打印路径"/> 9 <property name="java.logs.home" defaultValue="/Data/logs" description="日志打印路径"/>
  10 +<<<<<<< HEAD
10 <property name="search.es.cluster.name" defaultValue="yohosearch" description="" /> 11 <property name="search.es.cluster.name" defaultValue="yohosearch" description="" />
11 <property name="search.es.servers" defaultValue="172.16.6.95:9300 " description="" /> 12 <property name="search.es.servers" defaultValue="172.16.6.95:9300 " description="" />
  13 +=======
  14 + <property name="search.es.cluster.name" defaultValue="yohosearch_test" description="" />
  15 + <property name="search.es.servers" defaultValue="192.168.102.209:9300" description="" />
  16 +>>>>>>> dev
12 <property name="search.index.number_of_replicas" defaultValue="2" description="" /> 17 <property name="search.index.number_of_replicas" defaultValue="2" description="" />
13 <property name="search.index.refresh_interval" defaultValue="1" description="" /> 18 <property name="search.index.refresh_interval" defaultValue="1" description="" />
14 <property name="search.index.translog.flush_threshold_ops" defaultValue="5000" description="" /> 19 <property name="search.index.translog.flush_threshold_ops" defaultValue="5000" description="" />
@@ -17,7 +22,7 @@ @@ -17,7 +22,7 @@
17 <property name="search.index.batch.max.thread.size" defaultValue="10" description="" /> 22 <property name="search.index.batch.max.thread.size" defaultValue="10" description="" />
18 <property name="search.minimum.should.match" defaultValue="75%" description="" /> 23 <property name="search.minimum.should.match" defaultValue="75%" description="" />
19 <property name="search.operator" defaultValue="and" description="" /> 24 <property name="search.operator" defaultValue="and" description="" />
20 - <property name="search.default.field" defaultValue="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,searchField" description="" /> 25 + <property name="search.default.field" defaultValue="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" description="" />
21 <property name="search.script.score" defaultValue="_score+doc['sortWeight'].value*0.003+(100-doc['breakingRate'].value)/100 * doc['salesWithDateDiff'].value/pow((now-doc['shelveTime'].value)/3600+2,1.8)" description="" /> 26 <property name="search.script.score" defaultValue="_score+doc['sortWeight'].value*0.003+(100-doc['breakingRate'].value)/100 * doc['salesWithDateDiff'].value/pow((now-doc['shelveTime'].value)/3600+2,1.8)" description="" />
22 <property name="search.script.lang" defaultValue="groovy" description="" /> 27 <property name="search.script.lang" defaultValue="groovy" description="" />
23 28
@@ -35,26 +40,31 @@ @@ -35,26 +40,31 @@
35 <property name="redis.proxy.address" defaultValue="192.168.102.216" description="" /> 40 <property name="redis.proxy.address" defaultValue="192.168.102.216" description="" />
36 <property name="redis.proxy.port" defaultValue="6379" description="" /> 41 <property name="redis.proxy.port" defaultValue="6379" description="" />
37 42
  43 + <property name="redis.readonly.proxy.address" defaultValue="192.168.102.216" description="" />
  44 + <property name="redis.readonly.proxy.port" defaultValue="6379" description="" />
  45 +
  46 + <property name="redis.pool.maxTotal" defaultValue="100" description="" />
  47 + <property name="redis.pool.maxIdle" defaultValue="100" description="" />
  48 + <property name="redis.pool.maxWaitMillis" defaultValue="2000" description="" />
  49 + <property name="redis.pool.minIdle" defaultValue="50" description="" />
  50 + <property name="redis.pool.testOnBorrow" defaultValue="false" description="" />
  51 + <property name="redis.pool.testWhileIdle" defaultValue="true" description="" />
  52 +
38 <property name="rabbit.mq.prefix" defaultValue="no_" description="" /> 53 <property name="rabbit.mq.prefix" defaultValue="no_" description="" />
39 <property name="tbl.product.private.key" defaultValue="a85bb0674e08986c6b115d5e3a4884fa" description="" /> 54 <property name="tbl.product.private.key" defaultValue="a85bb0674e08986c6b115d5e3a4884fa" description="" />
40 <property name="tbl.product.url" defaultValue="http://test.soa.global.yohobuy.com/product/api/v1/detail/" description="" /> 55 <property name="tbl.product.url" defaultValue="http://test.soa.global.yohobuy.com/product/api/v1/detail/" description="" />
41 <property name="keyword.user.choice.file" defaultValue="/Users/ming/source/logs/fake.csv" description="" /> 56 <property name="keyword.user.choice.file" defaultValue="/Users/ming/source/logs/fake.csv" description="" />
42 57
43 - <property name="yoho.logs.basedir" defaultValue="/Users/ming/source/logs/" description="" />  
44 - <property name="yoho.logs.maxFileSize" defaultValue="10MB" description="" />  
45 - <property name="yoho.logs.maxHistory" defaultValue="7" description="" />  
46 - <property name="yoho.logs.level" defaultValue="DEBUG" description="" />  
47 -  
48 - <property name="jdbc.mysql.yhbsearch.master" defaultValue="192.168.50.69:9980" description="" />  
49 - <property name="jdbc.mysql.yhbsearch.slave" defaultValue="192.168.102.219:3306" description="" /> 58 + <property name="jdbc.mysql.yhbsearch.master" defaultValue="192.168.102.209:3306" description="" />
  59 + <property name="jdbc.mysql.yhbsearch.slave" defaultValue="192.168.102.209:3306" description="" />
50 <property name="jdbc.mysql.yhbsearch.username" defaultValue="yh_test" description="" /> 60 <property name="jdbc.mysql.yhbsearch.username" defaultValue="yh_test" description="" />
51 <property name="jdbc.mysql.yhbsearch.password" defaultValue="9nm0icOwt6bMHjMusIfMLw==" description="" /> 61 <property name="jdbc.mysql.yhbsearch.password" defaultValue="9nm0icOwt6bMHjMusIfMLw==" description="" />
  62 + <property name="jdbc.mysql.yhbsearch.datasources" defaultValue="yhb_search_2016" description="" />
52 63
53 </group> 64 </group>
54 <script> 65 <script>
55 <generate template="META-INF/autoconf/databases.yml" destfile="WEB-INF/classes/databases.yml"/> 66 <generate template="META-INF/autoconf/databases.yml" destfile="WEB-INF/classes/databases.yml"/>
56 <generate template="META-INF/autoconf/logback.xml" destfile="WEB-INF/classes/logback.xml"/> 67 <generate template="META-INF/autoconf/logback.xml" destfile="WEB-INF/classes/logback.xml"/>
57 <generate template="META-INF/autoconf/config.properties" destfile="WEB-INF/classes/config.properties"/> 68 <generate template="META-INF/autoconf/config.properties" destfile="WEB-INF/classes/config.properties"/>
58 -  
59 </script> 69 </script>
60 </config> 70 </config>
@@ -9,6 +9,9 @@ redis.proxy.address=${redis.proxy.address} @@ -9,6 +9,9 @@ redis.proxy.address=${redis.proxy.address}
9 redis.proxy.auth=${redis.proxy.auth} 9 redis.proxy.auth=${redis.proxy.auth}
10 redis.proxy.port = ${redis.proxy.port} 10 redis.proxy.port = ${redis.proxy.port}
11 11
  12 +redis.readonly.proxy.address=${redis.readonly.proxy.address}
  13 +redis.readonly.proxy.port=${redis.readonly.proxy.port}
  14 +redis.readonly.proxy.auth=${redis.readonly.proxy.auth}
12 15
13 coupon.send.time.interval.sendOrderConfirmCoupon=604800 16 coupon.send.time.interval.sendOrderConfirmCoupon=604800
14 order.task.host=${order.task.host} 17 order.task.host=${order.task.host}
@@ -18,10 +21,15 @@ web.context=search @@ -18,10 +21,15 @@ web.context=search
18 redis.server=${redis.server} 21 redis.server=${redis.server}
19 redis.port=${redis.port} 22 redis.port=${redis.port}
20 23
21 -driver=${jdbc.driver.name}  
22 -url=${jdbc.url}  
23 -username=${jdbc.username}  
24 -password=${jdbc.password} 24 +redis.pool.maxTotal=${redis.pool.maxTotal}
  25 +redis.pool.maxIdle=${redis.pool.maxIdle}
  26 +redis.pool.maxWaitMillis=${redis.pool.maxWaitMillis}
  27 +redis.pool.minIdle=${redis.pool.minIdle}
  28 +redis.pool.testOnBorrow=${redis.pool.testOnBorrow}
  29 +redis.pool.testWhileIdle=${redis.pool.testWhileIdle}
  30 +
  31 +# ******************** redis servers ********************
  32 +#redis.proxy.address=192.168.102.205
25 33
26 mq.server=${mq.server} 34 mq.server=${mq.server}
27 mq.port=${mq.port} 35 mq.port=${mq.port}
1 datasources: 1 datasources:
  2 +<<<<<<< HEAD
2 yhb_search_2016: 3 yhb_search_2016:
  4 +=======
  5 + ${jdbc.mysql.yhbsearch.datasources}:
  6 +>>>>>>> dev
3 servers: 7 servers:
4 - ${jdbc.mysql.yhbsearch.master} 8 - ${jdbc.mysql.yhbsearch.master}
5 - ${jdbc.mysql.yhbsearch.slave} 9 - ${jdbc.mysql.yhbsearch.slave}
@@ -10,15 +10,37 @@ @@ -10,15 +10,37 @@
10 <configuration scan="true" scanPeriod="60 seconds" debug="false"> 10 <configuration scan="true" scanPeriod="60 seconds" debug="false">
11 11
12 <!-- WARN、ERROR级别日志 appender --> 12 <!-- WARN、ERROR级别日志 appender -->
  13 + <appender name="DEBUG_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
  14 + <file>${yoho.logs.basedir}/${yoho.search.service.env.namespace}/debug.log</file>
  15 + <!-- 过滤器,过滤掉 TRACE 和 DEBUG 和 INFO 级别的日志 -->
  16 + <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
  17 + <level>WARN</level>
  18 + </filter>
  19 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  20 + <!-- daily rollover -->
  21 + <fileNamePattern>${yoho.logs.basedir}/${yoho.search.service.env.namespace}/archived/debug.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  22 + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  23 + <!-- or whenever the file size reaches 100MB -->
  24 + <maxFileSize>${yoho.logs.maxFileSize}</maxFileSize>
  25 + </timeBasedFileNamingAndTriggeringPolicy>
  26 + <!-- keep 30 days' worth of history -->
  27 + <maxHistory>${yoho.logs.maxHistory}</maxHistory>
  28 + </rollingPolicy>
  29 + <encoder>
  30 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger:%line - %msg%n</pattern>
  31 + </encoder>
  32 + </appender>
  33 +
  34 + <!-- WARN、ERROR级别日志 appender -->
13 <appender name="WARN_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender"> 35 <appender name="WARN_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
14 - <file>${yoho.logs.basedir}/${yoho.search.env.namespace}/warn-log.log</file> 36 + <file>${yoho.logs.basedir}/${yoho.search.service.env.namespace}/warn.log</file>
15 <!-- 过滤器,过滤掉 TRACE 和 DEBUG 和 INFO 级别的日志 --> 37 <!-- 过滤器,过滤掉 TRACE 和 DEBUG 和 INFO 级别的日志 -->
16 <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> 38 <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
17 <level>WARN</level> 39 <level>WARN</level>
18 </filter> 40 </filter>
19 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> 41 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
20 <!-- daily rollover --> 42 <!-- daily rollover -->
21 - <fileNamePattern>${yoho.logs.basedir}/${yoho.search.env.namespace}/archived/warn.%d{yyyy-MM-dd}.%i.log</fileNamePattern> 43 + <fileNamePattern>${yoho.logs.basedir}/${yoho.search.service.env.namespace}/archived/warn.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
22 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> 44 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
23 <!-- or whenever the file size reaches 100MB --> 45 <!-- or whenever the file size reaches 100MB -->
24 <maxFileSize>${yoho.logs.maxFileSize}</maxFileSize> 46 <maxFileSize>${yoho.logs.maxFileSize}</maxFileSize>
@@ -34,10 +56,10 @@ @@ -34,10 +56,10 @@
34 56
35 <!-- HTTP请求超时 appender --> 57 <!-- HTTP请求超时 appender -->
36 <appender name="REQUEST_TIMEOUT" class="ch.qos.logback.core.rolling.RollingFileAppender"> 58 <appender name="REQUEST_TIMEOUT" class="ch.qos.logback.core.rolling.RollingFileAppender">
37 - <file>${yoho.logs.basedir}/${yoho.search.env.namespace}/request-timeout.log</file> 59 + <file>${yoho.logs.basedir}/${yoho.search.service.env.namespace}/request-timeout.log</file>
38 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> 60 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
39 <!-- daily rollover --> 61 <!-- daily rollover -->
40 - <fileNamePattern>${yoho.logs.basedir}/${yoho.search.env.namespace}/archived/request-timeout.%d{yyyy-MM-dd}.%i.log</fileNamePattern> 62 + <fileNamePattern>${yoho.logs.basedir}/${yoho.search.service.env.namespace}/archived/request-timeout.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
41 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> 63 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
42 <!-- or whenever the file size reaches 100MB --> 64 <!-- or whenever the file size reaches 100MB -->
43 <maxFileSize>${yoho.logs.maxFileSize}</maxFileSize> 65 <maxFileSize>${yoho.logs.maxFileSize}</maxFileSize>
@@ -52,10 +74,10 @@ @@ -52,10 +74,10 @@
52 74
53 <!-- 数据库超时日志 appender --> 75 <!-- 数据库超时日志 appender -->
54 <appender name="DATABASE_TIMEOUT" class="ch.qos.logback.core.rolling.RollingFileAppender"> 76 <appender name="DATABASE_TIMEOUT" class="ch.qos.logback.core.rolling.RollingFileAppender">
55 - <file>${yoho.logs.basedir}/${yoho.search.env.namespace}/database-timeout.log</file> 77 + <file>${yoho.logs.basedir}/${yoho.search.service.env.namespace}/database-timeout.log</file>
56 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> 78 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
57 <!-- daily rollover --> 79 <!-- daily rollover -->
58 - <fileNamePattern>${yoho.logs.basedir}/${yoho.search.env.namespace}/archived/database-timeout.%d{yyyy-MM-dd}.%i.log</fileNamePattern> 80 + <fileNamePattern>${yoho.logs.basedir}/${yoho.search.service.env.namespace}/archived/database-timeout.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
59 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> 81 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
60 <!-- or whenever the file size reaches 100MB --> 82 <!-- or whenever the file size reaches 100MB -->
61 <maxFileSize>${yoho.logs.maxFileSize}</maxFileSize> 83 <maxFileSize>${yoho.logs.maxFileSize}</maxFileSize>
@@ -70,10 +92,10 @@ @@ -70,10 +92,10 @@
70 92
71 <!-- 服务请求统计 appender --> 93 <!-- 服务请求统计 appender -->
72 <appender name="REQUEST_STAT" class="ch.qos.logback.core.rolling.RollingFileAppender"> 94 <appender name="REQUEST_STAT" class="ch.qos.logback.core.rolling.RollingFileAppender">
73 - <file>${yoho.logs.basedir}/${yoho.search.env.namespace}/request-stat.log</file> 95 + <file>${yoho.logs.basedir}/${yoho.search.service.env.namespace}/request-stat.log</file>
74 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> 96 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
75 <!-- daily rollover --> 97 <!-- daily rollover -->
76 - <fileNamePattern>${yoho.logs.basedir}/${yoho.search.env.namespace}/archived/request-stat.%d{yyyy-MM-dd}.%i.log</fileNamePattern> 98 + <fileNamePattern>${yoho.logs.basedir}/${yoho.search.service.env.namespace}/archived/request-stat.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
77 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> 99 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
78 <!-- or whenever the file size reaches 100MB --> 100 <!-- or whenever the file size reaches 100MB -->
79 <maxFileSize>${yoho.logs.maxFileSize}</maxFileSize> 101 <maxFileSize>${yoho.logs.maxFileSize}</maxFileSize>
@@ -99,6 +121,7 @@ @@ -99,6 +121,7 @@
99 <!-- root级别 DEBUG --> 121 <!-- root级别 DEBUG -->
100 <root level="${yoho.logs.level}"> 122 <root level="${yoho.logs.level}">
101 <!-- 文件输出 --> 123 <!-- 文件输出 -->
  124 + <appender-ref ref="DEBUG_LOG" />
102 <appender-ref ref="WARN_LOG" /> 125 <appender-ref ref="WARN_LOG" />
103 </root> 126 </root>
104 127