Solr架构"已经关闭"基本DSE / Solr节点设置后的相关错误

时间:2014-10-28 23:11:06

标签: datastax

DSE Solr节点入门,初始设置正常,并且能够毫无问题地遵循此示例:

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

我的第一个测试用例是一些示例位置数据,修改了教程示例。我现在处于一个状态,我可以创建我的表,插入~5K示例行,并在推送模式时获得以下异常:

<?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)

引起:org.apache.lucene.store.AlreadyClosedException:已经关闭         在org.apache.solr.core.CachingDirectoryFactory.get(CachingDirectoryFactory.java:340)         在org.apache.solr.core.SolrCore.getNewIndexDir(SolrCore.java:262)         在org.apache.solr.core.SolrCore.initIndex(SolrCore.java:480)         在org.apache.solr.core.SolrCore。&lt; init&gt;(SolrCore.java:772)         ......还有33个     500name = snet_data.location_test1&安培;行动= CREATE     

将此作为我的表创建语句:

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字段的多值错误..,回到原来的“已经关闭”错误

以下是我的curl语句,它是根据上面从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"

运行设置测试时采取的步骤:

登录cql shell并执行以下操作

创建密钥空间:

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 curl命令,无插入初始数据)

运行solr curl命令以设置config,schema,core:

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"

1 个答案:

答案 0 :(得分:0)

我可以在使用您的架构和创建表语句后重现您的错误。在尝试创建核心几次崩溃之后,服务器最终会发出错误,可能是因为它处于不一致状态。

如果您在架构中使用以下内容,我想一切都会好的。我需要知道确切的版本是100%肯定的。

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

为了避免将来出现问题,我建议你这样做:

  • 寻找&#39; wiki&#39;演示文件夹中的演示。
  • 将其用作模板。更改脚本&#39;核心名称,更改架构,更改solrconfig等。
  • 这将很方便,因为脚本为您完成工作,您已经有工作模式等,您可以修改并确保它们正常工作

希望它有所帮助。

更新10月30日:

我需要您的确切版本,但您已取得进展,因为我也确实获得了这种状态&#39;多值字段错误。让我们一步一步走:

  • 停止服务器并删除内容。就我而言:rm -rf /var/lib/cassandra/*
  • 启动服务器:dse cassandra -s
  • 使用cqlsh shell创建ks和表:

    创建KEYSPACE wiki WITH REPLICATION = {&#39; class&#39; :&#39; SimpleStrategy&#39;,&#39; replication_factor&#39; :1};

    使用维基;

    CREATE table location_test1( &#34; ID&#34; TIMEUUID, &#34; SOURCE_ID&#34; UUID, &#34;名称&#34; VARCHAR, &#34;地址&#34; VARCHAR, &#34; address_extended&#34; VARCHAR, &#34; po_box&#34; VARCHAR, &#34;局部性&#34; VARCHAR, &#34;区域&#34; VARCHAR, &#34; post_town&#34; VARCHAR, &#34; admin_region&#34; VARCHAR, &#34;邮编&#34; VARCHAR, &#34;国家&#34; VARCHAR, &#34;电话&#34; VARCHAR, &#34; latlon&#34; VARCHAR, &#34;附近&#34;组, &#34;网站&#34; VARCHAR, &#34;电子邮件&#34; VARCHAR, &#34; category_ids&#34;组, &#34;状态&#34; VARCHAR, &#34; chain_name&#34; VARCHAR, &#34; chain_id&#34; UUID, PRIMARY KEY(&#34; id&#34;));

  • 编辑schema.xml并复制自己的。我在你的问题中复制了一个。我使用wiki演示中的solrconfig。

curl http://:8983 / solr / resource / wiki.location_test1 / schema.xml --data-binary @ schema.xml -H&#39; Content-type:text / xml;字符集= UTF-8&#39;

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>

它应该工作。如果它不是我需要你的确切版本。抱歉格式化,我无法将其显示为代码...