2015년 11월 26일 목요일

Apache SOLR 업그레이드시 solr.xml 변경방법..

기존 solr 4.3 --> 4.9로 변경 해 보는중..

한글처리가 기본으로 들어가 있다고 해서리...

기존꺼 복사해 넣었더니 오류가 떠서 찾아봄..

절라 많이 바뀜.. 괜히 업그레이드 시작했다...

결론 먼저 얘기하자면.. 코어의 디렉토리로 가서.. core.properties 를 생성하고..

안의 내용을

 #Written by CorePropertiesLocator
#Tue Jul 15 15:31:13 KST 2014
name=코어명
config=solrconfig.xml
schema=schema.xml
dataDir=코어 data 경로

를 적어주고 컨테이너를 올리면 된다.

conf는 별 다른 변경사항이 없는듯..



Moving to the New solr.xml Format


Migration from old-style solr.xml to core discovery is very straightforward. First, modify the solr.xml file from the legacy format to the discovery format.
In general there is a direct analog from the legacy format to the new format except there is no  element nor are there any  elements in discovery-based Solr.

Startup

In Solr 4.4 and on, the presence of a  child element of the  element in the solr.xml file signals a legacy version of solr.xml, and cores are expected to be defined as they have been historically. Depending on whether a element is discovered, solr.xml is parsed as either a legacy or discovery file and errors are thrown in the log if legacy and discovery modes are mixed in solr.xml.

definitions." style="margin: 2em 0px 0.5em; font-size: 22.1px; font-weight: normal; line-height: 1.5; color: rgb(51, 51, 51); border-bottom-color: rgb(107, 124, 165); padding-bottom: 2px; border-bottom-width: 2px; border-bottom-style: solid; font-family: 'Trebuchet MS', Tahoma, Arial, sans-serif; background-color: rgb(255, 255, 255);">Moving  definitions.

To migrate to discovery-based solr.xml, remove all of the  elements and the enclosing  element from solr.xml. See the pages linked above for examples of migrating other attributes. Then, in the instanceDir for each core create a core.properties file. This file can be empty if all defaults are acceptable. In particular, the instanceDir is assumed to be the directory in which the core.properties file is discovered. The data directory will be in a directory called "data" directly below. If the file is completely empty, the name of the core is assumed to be the name of the folder in which the core.properties file was discovered.
As mentioned elsewhere, the tree structure that the cores are in is arbitrary, with the exception that the directories containing the core.properties files must share a common root, but that root may be many levels up the tree. Note that supporting a root for the cores that is not a child of SOLR_HOME is supported through properties in solr.xml. However, only one root is possible, there is no provision presently for specifying multiple roots.
The only restriction on the tree structure is that cores may not be children of other cores; enumeration stops descending down the tree when the first core.properties file is discovered. Siblings of the directory in which thecore.properties file is discovered are still walked, only stopping recursing down the sibling when a core.properties file is found.

Example

Here's an example of what a legacy solr.xml file might look like and the equivalent discovery-based solr.xml and core.properties files:
<solr persistent="${solr.xml.persist:false}">
  <cores adminPath="/admin/cores" defaultCoreName="collection1" host="127.0.0.1" hostPort="${hostPort:8983}"
         hostContext="${hostContext:solr}" zkClientTimeout="${solr.zkclienttimeout:30000}" shareSchema="${shareSchema:false}"
         genericCoreNodeNames="${genericCoreNodeNames:true}">
    <core name="core1" instanceDir="core1" shard="${shard:}" collection="${collection:core1}" config="${solrconfig:solrconfig.xml}" schema="${schema:schema.xml}" coreNodeName="${coreNodeName:}"/>
    <core name="core2" instanceDir="core2" />
    <shardHandlerFactory name="shardHandlerFactory" class="HttpShardHandlerFactory">
      <int name="socketTimeout">${socketTimeout:120000}</int>
      <int name="connTimeout">${connTimeout:15000}</int>
    </shardHandlerFactory>
  </cores>
</solr>
The new-style solr.xml might look like what is below. Note that adminPath, defaultCoreName are not supported in discovery-based solr.xml.
<solr>
  <solrcloud>
    <str name="host">127.0.0.1</str>
    <int name="hostPort">${hostPort:8983}</int>
    <str name="hostContext">${hostContext:solr}</str>
    <int name="zkClientTimeout">${solr.zkclienttimeout:30000}</int>
    <str name="shareSchema">${shareSchema:false}</str>
    <bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool>
  </solrcloud>
 
  <shardHandlerFactory name="shardHandlerFactory" class="HttpShardHandlerFactory">
    <int name="socketTimeout">${socketTimeout:120000}</int>
    <int name="connTimeout">${connTimeout:15000}</int>
  </shardHandlerFactory>
</solr>
In each of "core1" and "core2" directories, there would be a core.properties file that might look like these. Note that note that instanceDir is not supported, it is assumed to be the directory in which core.properties is found.
core1:
name=core1
shard=${shard:}
collection=${collection:core1}
config=${solrconfig:solrconfig.xml}
schema=${schema:schema.xml}
coreNodeName=${coreNodeName:}
core2:
name=core2
In fact, the core2 core.properties file could even be empty and the name would default to the directory in which the core.properties file was found.

댓글 없음:

댓글 쓰기

BE Band (비밴드) - 2024년 03월 02일 잠실새내 락앤롤욱스 공연

나의 10~20대를 보낸 잠실에서의 공연.. 오랜만에 가보니.. 여기가.. 마눌님과 자주 가던 영화관이었는데... 여긴 뭐가 있었는데... 란 추억도 떠올리며 기분좋게 감.​ 공연장은 좀 협소한 편이었고, 인천의 쥐똥나무 보다는 약간 크고... 인천 ...