2014-10-28 56 views
0

後相關的錯誤開始使用DSE Solr的節點,初始設置罰款,並能以此爲榜樣,沒有問題:Solr模式「已關閉」和基地DSE/Solr的節點設置

http://www.datastax.com/documentation/datastax_enterprise/4.5/datastax_enterprise/srch/srchTutStrt.html

我第一個測試用例是一些示例位置數據,修改了教程示例。我現在在哪裏,我可以創造我表個態,插入〜5K例如行,推動該架構得到下面的異常時:org.apache.lucene.store.AlreadyClosedException:

<?xml version="1.0" encoding="UTF-8"?> 
    <response> 
    <lst name="responseHeader"><int name="status">500</int><int name="QTime">245</int></lst><lst name="error"><str name="msg">Already closed</str><str name="trace">org.apache.solr.common.SolrException: Already closed 
    at org.apache.solr.core.SolrCore.&lt;init&gt;(SolrCore.java:851) 
    at com.datastax.bdp.search.solr.core.CassandraCoreContainer.doReload(CassandraCoreContainer.java:700) 
    at com.datastax.bdp.search.solr.core.CassandraCoreContainer.create(CassandraCoreContainer.java:224) 
    at com.datastax.bdp.search.solr.core.SolrCoreResourceManager.createCore(SolrCoreResourceManager.java:256) 
    at com.datastax.bdp.search.solr.handler.admin.CassandraCoreAdminHandler.handleCreateAction(CassandraCoreAdminHandler.java:117) 
    at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:152) 
    at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:137) 
    at org.apache.solr.servlet.SolrDispatchFilter.handleAdminRequest(SolrDispatchFilter.java:669) 
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:248) 
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:197) 
    at com.datastax.bdp.search.solr.servlet.CassandraDispatchFilter.doFilter(CassandraDispatchFilter.java:99) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
    at com.datastax.bdp.cassandra.audit.SolrHttpAuditLogFilter.doFilter(SolrHttpAuditLogFilter.java:218) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
    at com.datastax.bdp.search.solr.auth.CassandraAuthorizationFilter.doFilter(CassandraAuthorizationFilter.java:100) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
    at com.datastax.bdp.search.solr.auth.DseAuthenticationFilter.doFilter(DseAuthenticationFilter.java:102) 
    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.Http11NioProcessor.process(Http11NioProcessor.java:891) 
    at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:750) 
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2283) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
    at java.lang.Thread.run(Thread.java:745) 

所致已關閉 at org.apache.solr.core.CachingDirectoryFactory.get(CachingDirectoryFactory.java:340) at org.apache.solr.core.SolrCore.getNewIndexDir(SolrCore.java:262) at org.apache.solr.core .SolrCore.initIndex(SolrCore.java:480) at org.apache.solr.core.SolrCore。 <初始化>(SolrCore.java:772) ...... 33多個 500name = snet_data.location_test1 &行動=創建

以此爲我的表創建語句:

CREATE table location_test1 (
"id" TIMEUUID, 
"source_id" UUID, 
"name" VARCHAR, 
"address" VARCHAR, 
"address_extended" VARCHAR, 
"po_box" VARCHAR, 
"locality" VARCHAR, 
"region" VARCHAR, 
"post_town" VARCHAR, 
"admin_region" VARCHAR, 
"postcode" VARCHAR, 
"country" VARCHAR, 
"tel" VARCHAR, 
"latlon" VARCHAR, 
"neighborhood" SET<VARCHAR>, 
"website" VARCHAR, 
"email" VARCHAR, 
"category_ids" SET<VARCHAR>, 
"status" VARCHAR, 
"chain_name" VARCHAR, 
"chain_id" UUID, 
PRIMARY KEY ("id")); 

隨着Solr模式:

<schema name="location_test1" version="1.5"> 
<types> 
    <fieldType name="string" class="solr.StrField"/> 
    <fieldType name="text" class="solr.TextField"> 
    <analyzer> 
     <tokenizer class="solr.StandardTokenizerFactory"/> 
     <filter class="solr.LowerCaseFilterFactory"/> 
     </analyzer> 
    </fieldType> 
    <fieldType name="geo" class="solr.GeoHashField"/> 
    <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0" /> 
    <fieldType name="int" class="solr.TrieIntField"/> 
    <fieldType name="uuid" class="solr.UUIDField"/> 
</types> 
<fields> 
    <field name="id" type="uuid" indexed="true" stored="true" docValues="true"/> 
    <field name="name" type="string" indexed="true" stored="true"/> 
    <field name="latlon" type="geo" indexed="true" stored="true"/> 
</fields> 
<defaultSearchField>name</defaultSearchField> 
<uniqueKey>(id)</uniqueKey> 
</schema> 

被更新(10/29)後,新的測試

因此,看起來像這些錯誤正在導致B/C DSE Solr處於某種不良狀態,即使在刪除表和數據並重新開始之後,我決定將整個鍵空間作爲重新啓動點。現在得到不同的行爲..,與核心創建時的早期錯誤一致,它抱怨多值字段應該映射到List/Set類型。

<?xml version="1.0" encoding="UTF-8"?> 
<response> 
<lst name="responseHeader"><int name="status">500</int><int name="QTime">325</int></lst><lst name="error"><str name="msg">Unable to create core: snet_data.location_test1</str><str name="trace">org.apache.solr.common.SolrException: Unable to create core: snet_data.location_test1 
     at org.apache.solr.core.CoreContainer.recordAndThrow(CoreContainer.java:957) 
     at com.datastax.bdp.search.solr.core.CassandraCoreContainer.create(CassandraCoreContainer.java:266) 
     at com.datastax.bdp.search.solr.core.SolrCoreResourceManager.createCore(SolrCoreResourceManager.java:256) 
     at com.datastax.bdp.search.solr.handler.admin.CassandraCoreAdminHandler.handleCreateAction(CassandraCoreAdminHandler.java:117) 
     at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:152) 
     at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:137) 
     at org.apache.solr.servlet.SolrDispatchFilter.handleAdminRequest(SolrDispatchFilter.java:669) 
     at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:248) 
     at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:197) 
     at com.datastax.bdp.search.solr.servlet.CassandraDispatchFilter.doFilter(CassandraDispatchFilter.java:99) 
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
     at com.datastax.bdp.cassandra.audit.SolrHttpAuditLogFilter.doFilter(SolrHttpAuditLogFilter.java:218) 
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
     at com.datastax.bdp.search.solr.auth.CassandraAuthorizationFilter.doFilter(CassandraAuthorizationFilter.java:100) 
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
     at com.datastax.bdp.search.solr.auth.DseAuthenticationFilter.doFilter(DseAuthenticationFilter.java:102) 
     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.Http11NioProcessor.process(Http11NioProcessor.java:891) 
     at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:750) 
     at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2283) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
     at java.lang.Thread.run(Thread.java:745) 
Caused by: java.lang.IllegalStateException: Multi-valued field status should be mapped to either List or Set types, found: org.apache.cassandra.db.marshal.UTF8Type 
     at com.datastax.bdp.search.solr.core.Cql3CassandraSolrSchemaUpdater.update(Cql3CassandraSolrSchemaUpdater.java:115) 
     at com.datastax.bdp.search.solr.core.CassandraCoreContainer.create(CassandraCoreContainer.java:245) 
     ... 31 more 
</str><int name="code">500</int></lst><str name="params">name=snet_data.location_test1&amp;action=CREATE</str> 
</response> 

也跟其他領域的錯誤,狀態字段它在抱怨在表中定義爲varchar和架構中的一個字符串,所以不明白爲什麼它抱怨這些之前。

我現在所做的就是將模式簡化爲id,name,latlon。回到我沒有得到單值varchar/string字段的多值錯誤的地方..,回到原來的「已關閉」的錯誤

這裏是我的捲曲的語句,從例如從datastax Solr的教程上面提到的建立:

curl http://10.0.1.212:8983/solr/resource/snet_data.location_test1/solrconfig.xml --data-binary @solrconfig.xml -H 'Content-type:text/xml; charset=utf-8' 

curl http://10.0.1.212:8983/solr/resource/snet_data.location_test1/schema.xml --data-binary @schema.xml -H 'Content-type:text/xml; charset=utf-8' 

curl "http://10.0.1.212:8983/solr/admin/cores?action=CREATE&name=snet_data.location_test1" 

所採取的步驟在運行安裝程序測試:

登錄到定製列表外殼,並做以下

創建密鑰空間:

CREATE KEYSPACE snet_data WITH REPLICATION = 
     {'class':'NetworkTopologyStrategy', 'Solr':1}; 

創建表:

CREATE table location_test1 (
"id" TIMEUUID, 
"source_id" UUID, 
"name" VARCHAR, 
"address" VARCHAR, 
"address_extended" VARCHAR, 
"po_box" VARCHAR, 
"locality" VARCHAR, 
"region" VARCHAR, 
"post_town" VARCHAR, 
"admin_region" VARCHAR, 
"postcode" VARCHAR, 
"country" VARCHAR, 
"tel" VARCHAR, 
"latlon" VARCHAR, 
"neighborhood" SET<VARCHAR>, 
"website" VARCHAR, 
"email" VARCHAR, 
"category_ids" SET<VARCHAR>, 
"status" VARCHAR, 
"chain_name" VARCHAR, 
"chain_id" UUID, 
PRIMARY KEY ("id")); 

(試過的5K記錄像教程兩者導入測試,同時還運行solr的捲曲命令SANS插入初始數據)

運行solr的捲曲的命令來設置的配置,架構的核心:

curl http://10.0.1.212:8983/solr/resource/snet_data.location_test1/solrconfig.xml --data-binary @solrconfig.xml -H 'Content-type:text/xml; charset=utf-8' 

curl http://10.0.1.212:8983/solr/resource/snet_data.location_test1/schema.xml --data-binary @schema.xml -H 'Content-type:text/xml; charset=utf-8' 

curl "http://10.0.1.212:8983/solr/admin/cores?action=CREATE&name=snet_data.location_test1" 
+0

你能分享你的捲曲聲明嗎? – phact 2014-10-28 23:25:29

+0

請提供從DSE安裝到錯誤的逐步複製方案,並將Solr模式版本修復爲1.5。 – sbtourist 2014-10-29 09:36:00

+0

更新的模式爲1.5(爲什麼這是必需的方式?),更新後的步驟底部我一直在遵循 – kaiyzen 2014-10-29 22:23:19

回答

0

在使用模式並創建表語句之後,我可能會重現您的錯誤。在嘗試創建核心幾次崩潰後,服務器最終會出現該錯誤,可能是因爲它處於不一致的狀態。

如果您在您的模式中使用以下內容,我猜所有對您都可以。我需要知道確切的版本才能100%確定。

<?xml version="1.0" encoding="UTF-8" ?> 
<schema name="myTest" version="1.5"> 

爲了避免此問題,未來是我會建議你:

  • 尋找在演示文件夾中的「維基」的演示。
  • 將其用作模板。更改腳本的核心名稱,更改架構,改變solrconfig等
  • 這將是方便,因爲腳本做你的工作,你已經工作模式等,你可以修改,並確保他們的工作

希望它有幫助。

更新10/30:

我需要你確切的版本,但已經取得了進展爲在一個點上,確實也得到那個「狀態」多值字段錯誤。讓我們一步一步來:

  • 停止服務器並刪除東西。在我的情況:rm -rf /var/lib/cassandra/*
  • 啓動服務器:dse cassandra -s
  • 創建KS和表與cqlsh外殼:

    創建REPLICATION = { '類' KEYSPACE維基: 'SimpleStrategy', 'replication_factor': 1};

    USE wiki;

    CREATE表location_test1( 「ID」 TIMEUUID, 「SOURCE_ID」 UUID, 「名」 VARCHAR, 「地址」 VARCHAR, 「address_extended」 VARCHAR, 「po_box」 VARCHAR, 「局部性」 VARCHAR, 「區域」 VARCHAR, 「post_town」 VARCHAR, 「admin_region」 VARCHAR, 「郵政編碼」 VARCHAR, 「國家」 VARCHAR, 「電話」 VARCHAR, 「latlon」 VARCHAR, 「鄰里」 SET, 「網站「VARCHAR, 「email」VARCHAR, 「category_ids」SET, 「status」VARCHAR, 「chain_name」VARCHAR, 「chain_id」UUID, PRIMARY KEY(「id」));

  • 編輯schema.xml並複製你自己的。我複製了你的問題。我使用wiki演示中的solrconfig。

捲曲的http://:8983/solr的/資源/ wiki.location_test1/schema.xml中--data二進制@ schema.xml中-H「內容 - 類型:文本/ XML;字符集= UTF-8'

SUCCESS

curl http://<host>:8983/solr/resource/wiki.location_test1/solrconfig.xml --data-binary @solrconfig.xml -H 'Content-type:text/xml; charset=utf-8' 

SUCCESS 

curl "http://<host>:8983/solr/admin/cores?action=CREATE&name=wiki.location_test1" 

<?xml version="1.0" encoding="UTF-8"?> 
<response> 
<lst name="responseHeader"><int name="status">0</int><int name="QTime">1598</int></lst> 
</response> 

它應該工作。如果它不,我需要你的確切版本。抱歉的格式,我不能讓它顯示爲代碼...

+0

感謝您的回覆Bereng,我把它作爲我的頭文件在我的模式中:'<?xml version =「 1.0「encoding =」UTF-8「?>'我嘗試顛覆這個版本並且再次嘗試從頭開始,仍然是同樣的問題。嘗試從wiki示例開始,而不是從DSE Solr的nhanes_ks開始,看看這是否有所作爲 – kaiyzen 2014-10-29 19:42:37

+0

使用dse-demos文件夾中的維基百科示例獲取新錯誤:'uniqueKey字段(null)不能配置爲多值「看起來像維基百科示例和來自dse docs的nhandes_ks示例之間的真正區別是維基百科示例中的uniqueKey值示例是」id「,其中nhanes是」(id)「 – kaiyzen 2014-10-29 20:02:56

+0

另一個測試,具有相同的結果。我再次從零開始,使用只有id和name字段的精簡模式,作爲uniqueKey添加回「(id)」中,得到與前面相同的錯誤:'uniqueKey字段(null)不能配置爲多值化「似乎系統再次處於某種波動狀態,這是令人困惑的。 DSE文檔說DSE Solr是通過管理密鑰空間/表來管理的......,所以會假設當我放棄並重新創建從頭開始時,事情就會表現出來,如果不是這樣的話,人們如何通過重新設置表/索引來重新安裝? – kaiyzen 2014-10-29 20:16:38