Coder Social home page Coder Social logo

ftw.recipe.solr's Introduction

Introduction

This recipe installs a Solr server with buildout.

It's kept as simple as possible and contrary to collective.recipe.solrinstance it does not generate any Solr configuration files. Instead the user can provide a directory containing custom configuration files. A default set of configuration files for usage with Plone is provided.

You can use it by adding a part like this:

[buildout]
parts = solr

[solr]
recipe = ftw.recipe.solr
cores =
    core1

Supported options

The recipe supports the following options:

host
Name or IP address of the Solr server. Defaults to localhost.
port
Server port. Defaults to 8983.
cores
List of cores that should be created.
url
Url for Solr distribution download.
md5sum
MD5 checksum of Solr distribution.
jvm-opts
Can be used to configure JVM options. Defaults to -Xms512m -Xmx512m -Xss256k
extra-opts
Extra options to pass to the Solr command line (separated by space). Empty by default.
conf
Path to a directory containing Solr configuration files.
conf-egg
If provided, the path given in conf is prepended with the path of the given egg.
shards-whitelist
If specified, this list limits what nodes can be requested in the shards request parameter. See Configuring the ShardHandlerFactory
configoverlay
Provide a configoverlay as documented in https://lucene.apache.org/solr/guide/8_4/config-api.html. This will override the default config in solrconfig.xml

Links

Copyright

This package is copyright by 4teamwork.

ftw.recipe.solr is licensed under GNU General Public License, version 2.

ftw.recipe.solr's People

Contributors

buchi avatar bierik avatar lukasgraf avatar jone avatar siegy22 avatar deiferni avatar lvonlanthen avatar

Watchers

 avatar  avatar Mathias Leimgruber avatar Philippe Gross avatar 4teamwork Jenkins avatar James Cloos avatar Bernhard Bühlmann avatar Nicola Lorenz avatar  avatar Daniel Jowett avatar

ftw.recipe.solr's Issues

Solr unable to open index when restarted by Memmon

During a recent update, we had an issue where Solr was restartet by Memmon during an indexing operation, and was unable to reopen the index when it got restarted. Incoming writes were therefore rejected until we stopped solr again, manually removed the write.lock, and restarted it.

This is the excerpt from solr.log during the shutdown by Memmon and the subsequent restart:

2018-06-01 20:47:01.234 INFO  (Thread-0) [   ] o.a.s.c.CoreContainer Shutting down CoreContainer instance=550402284
2018-06-01 20:47:01.234 INFO  (Thread-0) [   ] o.a.s.m.SolrMetricManager Closing metric reporters for registry=solr.node, tag=null
2018-06-01 20:47:01.234 INFO  (Thread-0) [   ] o.a.s.m.SolrMetricManager Closing metric reporters for registry=solr.jvm, tag=null
2018-06-01 20:47:01.234 INFO  (Thread-0) [   ] o.a.s.m.SolrMetricManager Closing metric reporters for registry=solr.jetty, tag=null
2018-06-01 20:47:01.236 INFO  (coreCloseExecutor-12-thread-1) [   x:stasg] o.a.s.c.SolrCore [stasg]  CLOSING SolrCore org.apache.solr.core.SolrCore@4688bc0c
2018-06-01 20:47:01.236 INFO  (coreCloseExecutor-12-thread-1) [   x:stasg] o.a.s.m.SolrMetricManager Closing metric reporters for registry=solr.core.stasg, tag=1183366156
2018-06-01 20:47:01.650 INFO  (main) [   ] o.e.j.s.Server jetty-9.3.20.v20170531
2018-06-01 20:47:01.946 INFO  (main) [   ] o.a.s.s.SolrDispatchFilter  ___      _       Welcome to Apache Solr™ version 7.2.1
2018-06-01 20:47:01.946 INFO  (main) [   ] o.a.s.s.SolrDispatchFilter / __| ___| |_ _   Starting in standalone mode on port 10130
2018-06-01 20:47:01.946 INFO  (main) [   ] o.a.s.s.SolrDispatchFilter \__ \/ _ \ | '_|  Install dir: /home/zope/01-gever-stasg-prod/parts/solr
2018-06-01 20:47:01.961 INFO  (main) [   ] o.a.s.s.SolrDispatchFilter |___/\___/_|_|    Start time: 2018-06-01T18:47:01.947Z
2018-06-01 20:47:01.962 INFO  (main) [   ] o.a.s.u.StartupLoggingUtils Property solr.log.muteconsole given. Muting ConsoleAppender named CONSOLE
2018-06-01 20:47:01.975 INFO  (main) [   ] o.a.s.c.SolrResourceLoader Using system property solr.solr.home: /home/zope/01-gever-stasg-prod/var/solr
2018-06-01 20:47:01.980 INFO  (main) [   ] o.a.s.c.SolrXmlConfig Loading container configuration from /home/zope/01-gever-stasg-prod/var/solr/solr.xml
2018-06-01 20:47:02.483 INFO  (main) [   ] o.a.s.c.CorePropertiesLocator Found 1 core definitions underneath /home/zope/01-gever-stasg-prod/var/solr
2018-06-01 20:47:02.484 INFO  (main) [   ] o.a.s.c.CorePropertiesLocator Cores are: [stasg]
2018-06-01 20:47:02.488 INFO  (coreLoadExecutor-6-thread-1) [   ] o.a.s.c.TransientSolrCoreCacheDefault Allocating transient cache for 2147483647 transient cores
2018-06-01 20:47:02.528 INFO  (main) [   ] o.e.j.s.Server Started @1286ms
2018-06-01 20:47:02.528 INFO  (coreLoadExecutor-6-thread-1) [   x:stasg] o.a.s.c.SolrResourceLoader [stasg] Added 38 libs to classloader, from paths: [/home/zope/01-gever-stasg-prod/parts/solr/contrib/extract
ion/lib, /home/zope/01-gever-stasg-prod/parts/solr/dist]
2018-06-01 20:47:02.637 INFO  (coreLoadExecutor-6-thread-1) [   x:stasg] o.a.s.c.SolrConfig Using Lucene MatchVersion: 7.2.1
2018-06-01 20:47:02.733 INFO  (coreLoadExecutor-6-thread-1) [   x:stasg] o.a.s.s.IndexSchema [stasg] Schema name=default-config
2018-06-01 20:47:02.923 INFO  (coreLoadExecutor-6-thread-1) [   x:stasg] o.a.s.s.IndexSchema Loaded schema default-config/1.6 with uniqueid field UID
2018-06-01 20:47:02.944 INFO  (coreLoadExecutor-6-thread-1) [   x:stasg] o.a.s.c.CoreContainer Creating SolrCore 'stasg' using configuration from instancedir /home/zope/01-gever-stasg-prod/var/solr/stasg, tru
sted=true
2018-06-01 20:47:02.980 INFO  (coreLoadExecutor-6-thread-1) [   x:stasg] o.a.s.c.SolrCore solr.RecoveryStrategy.Builder
2018-06-01 20:47:02.985 INFO  (coreLoadExecutor-6-thread-1) [   x:stasg] o.a.s.c.SolrCore [[stasg] ] Opening new SolrCore at [/home/zope/01-gever-stasg-prod/var/solr/stasg], dataDir=[/home/zope/01-gever-stasg
-prod/var/solr/stasg/data/]
2018-06-01 20:47:03.011 ERROR (coreLoadExecutor-6-thread-1) [   x:stasg] o.a.s.c.SolrCore [stasg] Solr index directory '/home/zope/01-gever-stasg-prod/var/solr/stasg/data/index/' is locked (lockType=native).
 Throwing exception.
2018-06-01 20:47:03.012 INFO  (coreLoadExecutor-6-thread-1) [   x:stasg] o.a.s.c.SolrCore [stasg]  CLOSING SolrCore org.apache.solr.core.SolrCore@2c5d3f72
2018-06-01 20:47:03.012 INFO  (coreLoadExecutor-6-thread-1) [   x:stasg] o.a.s.m.SolrMetricManager Closing metric reporters for registry=solr.core.stasg, tag=744308594
2018-06-01 20:47:03.017 ERROR (coreContainerWorkExecutor-2-thread-1) [   ] o.a.s.c.CoreContainer Error waiting for SolrCore to be created
java.util.concurrent.ExecutionException: org.apache.solr.common.SolrException: Unable to create core [stasg]
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)
        at org.apache.solr.core.CoreContainer.lambda$load$14(CoreContainer.java:671)
        at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:188)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.solr.common.SolrException: Unable to create core [stasg]
        at org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:1053)
        at org.apache.solr.core.CoreContainer.lambda$load$13(CoreContainer.java:642)
        at com.codahale.metrics.InstrumentedExecutorService$InstrumentedCallable.call(InstrumentedExecutorService.java:197)
        ... 5 more
Caused by: org.apache.solr.common.SolrException: Index dir '/home/zope/01-gever-stasg-prod/var/solr/stasg/data/index/' of core 'stasg' is already locked. The most likely cause is another Solr server (or another solr core in this server) also configured to use this directory; other possible causes may be specific to lockType: native
        at org.apache.solr.core.SolrCore.<init>(SolrCore.java:1008)
        at org.apache.solr.core.SolrCore.<init>(SolrCore.java:863)
        at org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:1037)
        ... 7 more
Caused by: org.apache.lucene.store.LockObtainFailedException: Index dir '/home/zope/01-gever-stasg-prod/var/solr/stasg/data/index/' of core 'stasg' is already locked. The most likely cause is another Solr server (or another solr core in this server) also configured to use this directory; other possible causes may be specific to lockType: native
        at org.apache.solr.core.SolrCore.initIndex(SolrCore.java:745)
        at org.apache.solr.core.SolrCore.<init>(SolrCore.java:954)
        ... 9 more
2018-06-01 20:47:03.237 ERROR (qtp947679291-16) [   ] o.a.s.s.HttpSolrCall null:org.apache.solr.core.SolrCoreInitializationException: SolrCore 'stasg' is not available due to init failure: Index dir '/home/zope/01-gever-stasg-prod/var/solr/stasg/data/index/' of core 'stasg' is already locked. The most likely cause is another Solr server (or another solr core in this server) also configured to use this directory; other possible causes may be specific to lockType: native
        at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:1482)

This is the corresponding section from supervisord.log during that time:

2018-06-01 20:47:00,117 ERRO pool HttpOk1 event buffer overflowed, discarding event 126610
2018-06-01 20:47:00,117 ERRO pool HttpOk2 event buffer overflowed, discarding event 126610
2018-06-01 20:47:01,229 INFO waiting for solr to stop
2018-06-01 20:47:01,230 INFO stopped: solr (terminated by SIGTERM)
2018-06-01 20:47:01,233 INFO spawned: 'solr' with pid 82083
2018-06-01 20:47:06,968 INFO success: solr entered RUNNING state, process has stayed up for > than 5 seconds (startsecs)
2018-06-01 20:48:00,069 ERRO pool HttpOk1 event buffer overflowed, discarding event 126611
2018-06-01 20:48:00,069 ERRO pool HttpOk2 event buffer overflowed, discarding event 126611

Tika is missing jhighlight

When indexing a document that contains e.g. XHTML Solr fails with a java.lang.NoClassDefFoundError.

Traceback:

o.a.s.s.HttpSolrCall null:java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/uwyn/jhig
hlight/renderer/XhtmlRendererFactory
        at org.apache.solr.servlet.HttpSolrCall.sendError(HttpSolrCall.java:664)
        at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:532)
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:384)
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:330)
...

This is because jhighlight was removed from the Solr distribution but Tika is still using it: https://issues.apache.org/jira/browse/SOLR-7317
https://issues.apache.org/jira/browse/TIKA-1581

Workaround:
Download jhighlight-1.0.jar from https://mvnrepository.com/artifact/com.uwyn/jhighlight/1.0 to contrib/extraction/lib folder.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.