2013-09-28 123 views
2

Solr 4.4.0給出這個錯誤 任何人都可以幫助我?Solr 4.4.0給出錯誤代碼500

HTTP Status 500 - {msg=SolrCore 'collection1' is not available due to init failure: Unable to use updateLog: _version_field must exist in schema, using indexed="true" stored="true" and multiValued="false" (_version_ does not exist),trace=org.apache.solr.common.SolrException: SolrCore 'collection1' is not available due to init failure: Unable to use updateLog: _version_field must exist in schema, using indexed="true" stored="true" and multiValued="false" (_version_ does not exist) 
at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:860) 
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:251) 
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:158) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) 
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) 
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) 
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) 
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) 
at java.lang.Thread.run(Thread.java:724) Caused by: org.apache.solr.common.SolrException: Unable to use updateLog: _version_field must exist in schema, using indexed="true" stored="true" and multiValued="false" (_version_ does not exist) 
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:835) 
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:629) 
at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:622) 
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:657) 
at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:364) 
at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:356) 
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 
at java.util.concurrent.FutureTask.run(FutureTask.java:166) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 
at java.util.concurrent.FutureTask.run(FutureTask.java:166) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ... 1 more Caused by: org.apache.solr.common.SolrException: Unable to use updateLog: _version_field must exist in schema, using indexed="true" stored="true" and multiValued="false" (_version_ does not exist) 
at org.apache.solr.update.UpdateLog.init(UpdateLog.java:267) 
at org.apache.solr.update.UpdateHandler.<init>(UpdateHandler.java:134) 
at org.apache.solr.update.UpdateHandler.<init>(UpdateHandler.java:94) 
at org.apache.solr.update.DirectUpdateHandler2.<init>(DirectUpdateHandler2.java:96) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) 
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:537) 
at org.apache.solr.core.SolrCore.createUpdateHandler(SolrCore.java:607) 
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:819) ... 13 more Caused by: org.apache.solr.common.SolrException: _version_field must exist in schema, using indexed="true" stored="true" and multiValued="false" (_version_ does not exist) 
at org.apache.solr.update.VersionInfo.getAndCheckVersionField(VersionInfo.java:56) 
at org.apache.solr.update.VersionInfo.<init>(VersionInfo.java:82) 
at org.apache.solr.update.UpdateLog.init(UpdateLog.java:264) ... 23 more ,code=500} 

回答

3

Solr 4.x提供了一個實時獲取功能。爲此,它寫入一個更新日誌,它需要定義一個_version字段。

<fields> tag in schema.xml

<field name="_version_" type="long" indexed="true" stored="true"/> 

添加這或者從您的solrconfig.xml中

<requestHandler name="/get" class="solr.RealTimeGetHandler"> 
    <lst name="defaults"> 
     <str name="omitHeader">true</str> 
     <str name="wt">json</str> 
     <str name="indent">true</str> 
    </lst> 
    </requestHandler> 

註釋掉該記住,如果你註釋掉/ get請求處理,你不會得到實時獲取也錯過了樂觀併發(在這裏解釋 - http://yonik.com/solr/optimistic-concurrency/

+0

不知道這是否特定使用太陽黑子,但[字段定義](https://github.com/sunspot/sunspot/blob/master/sunspot_solr/solr/solr/conf/schema.xml#L241)在使用它時有點不同:'

0

正確的行註釋掉,以解決這個問題是: <updateLog> <str name="dir">${solr.ulog.dir:}</str> </updateLog>

P.S. 我知道這是舊的,但仍然進入谷歌搜索的前10名。