This thread will serve as a reference on my config layout for at least
one other thread that I will be creating for discussion.
I have an existing infrastructure for Solr 3.5.0, using the included
Jetty6. I am working on a new infrastructure for Solr 4, using its
included Jetty8.
My solrconfig.xml started out from the 1.4.1 example. As much as
possible, when I upgrade Solr, I try to keep the config up to date with
the intentions, features, and defaults in the new example config, unless
they conflict with my requirements or I believe they are unnecessary
bloat. I also upgrade any dependent jars to the latest versions that
are compatible.
The old setup used a lot of absolute paths in symlinks and in solr
config files. I hope to make everything relative in the new
infrastructure, so more than one can coexist.I use xinclude extensively
in solrconfig.xml.
Here is a (trimmed) tree shown from /index/solr4, which is solr.home:
.
+-- config
| +-- broker
| +-- common
| +-- rss
| +-- shard
+-- cores
| +-- inc_0
| | +-- conf
| +-- inc_1
| | +-- conf
| +-- ncmain
| | +-- conf
| +-- ncrss
| | +-- conf
| +-- s0_0
| | +-- conf
| +-- s0_1
| | +-- conf
+-- data
| +-- inc_0
| | +-- index
| +-- inc_1
| | +-- index
| +-- ncmain
| | +-- index
| +-- ncrss
| | +-- index
| +-- s0_0
| | +-- index
| +-- s0_1
| | +-- index
+-- lib
Files like schema.xml and dih-config.xml live in config. The real
solrconfig.xml files and included files that are different in each
solrconfig live in config/{broker,rss,shard}. Included files that are
the same for all solrconfig live in config/common.
Everything in the cores directory (instanceDir for each core) is a
relative symlink into ../../../config. The xinclude directives are
relative to the location of the solrconfig.xml symlink under cores, not
the actual solrconfig.xml location under config.
Excerpt from one of the solrconfig.xml files:
<xi:include href="../../../config/common/luceneMatchVersion.xml" />
<xi:include href="../../../config/common/indexConfig.xml" />
<xi:include href="../../../config/common/updateHandler.xml" />
<xi:include href="../../../config/broker/query.xml" />
<xi:include href="../../../config/broker/selectRequestHandler.xml" />
<xi:include href="../../../config/broker/dismaxHandler.xml" />
Here is my entire solr.xml file. The "../../" is required because
dataDir is relative to instanceDir, which is itself relative to solr.home:
<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="true" sharedLib="lib">
<cores adminPath="/admin/cores">
<core instanceDir="cores/ncmain/" name="ncmain"
dataDir="../../data/ncmain"/>
<core instanceDir="cores/ncrss/" name="ncrss"
dataDir="../../data/ncrss"/>
<core instanceDir="cores/inc_0/" name="inclive"
dataDir="../../data/inc_0"/>
<core instanceDir="cores/inc_1/" name="incbuild"
dataDir="../../data/inc_1"/>
<core instanceDir="cores/s0_0/" name="s0live"
dataDir="../../data/s0_0"/>
<core instanceDir="cores/s0_1/" name="s0build"
dataDir="../../data/s0_1"/>
<core instanceDir="cores/s1_0/" name="s1live"
dataDir="../../data/s1_0"/>
<core instanceDir="cores/s1_1/" name="s1build"
dataDir="../../data/s1_1"/>
<core instanceDir="cores/s2_0/" name="s2live"
dataDir="../../data/s2_0"/>
<core instanceDir="cores/s2_1/" name="s2build"
dataDir="../../data/s2_1"/>
<core instanceDir="cores/s3_0/" name="s3live"
dataDir="../../data/s3_0"/>
<core instanceDir="cores/s3_1/" name="s3build"
dataDir="../../data/s3_1"/>
<core instanceDir="cores/s4_0/" name="s4live"
dataDir="../../data/s4_0"/>
<core instanceDir="cores/s4_1/" name="s4build"
dataDir="../../data/s4_1"/>
<core instanceDir="cores/s5_0/" name="s5live"
dataDir="../../data/s5_0"/>
<core instanceDir="cores/s5_1/" name="s5build"
dataDir="../../data/s5_1"/>
</cores>
</solr>
ls output showing how the symlinks under cores work:
[root@bigindy5 solr4]# ls -al /index/solr4/cores/ncmain/conf/
total 8
drwxr-xr-x 2 ncindex ncindex 4096 Oct 14 13:24 .
drwxr-xr-x 3 ncindex ncindex 4096 Oct 13 21:27 ..
lrwxrwxrwx 1 ncindex ncindex 30 Oct 12 21:59 dih-config.xml ->
../../../config/dih-config.xml
lrwxrwxrwx 1 ncindex ncindex 26 Oct 12 21:59 schema.xml ->
../../../config/schema.xml
lrwxrwxrwx 1 ncindex ncindex 37 Oct 12 21:59 solrconfig.xml ->
../../../config/broker/solrconfig.xml
lrwxrwxrwx 1 ncindex ncindex 31 Oct 12 21:59 wdftypes_mt.txt ->
../../../config/wdftypes_mt.txt