On 10/28/2012 11:34 PM, maneesha wrote:
For creating the full index for my core every quarter from scratch:
- I create a new core e.g. "blahNov2012" using admin url with option
action=CREATE and I give it a new dataDir property e.g.
/home/blah/data/Nov2012.
- I do a full import on blahNov2012 to populate the new core "blah-Nov2012"
and test it.
- If all is good, I run the admin url with option action=SWAP to swap (blah
with blahNov2012).
- Since I have persistent="true" in the solr.xml, it updates the dataDir for
the core "blah" to point to the new directory /home/blah/data/Nov2012.
<snip>
My first question: is this the pattern most people use to create fresh index
(e.g. create a new tmp core, test, and swap).
My second question is if I need to make further unrelated changes the
solr.xml in next releases and I must update the solr.xml on the production
system, I need to manually change the "blah"'s data directory from
"/home/blah/data/defaultData" to "/home/blah/data/Nov2012". Is that what
needs to be done? Do people automate this step somehow in their production
releases..?
Here's my solr.xml:
<?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>
I do not worry about creating cores on the fly, and in normal operation
I never have to manually touch the solr.xml file. I have a live core
and a build core for every shard. When I have to completely rebuild an
index, I clear the build core and do the build there. When it's done, I
swap the build core and the live core, then go back and redo any updates
that were applied to the live core while the rebuild was happening. The
core names indicate live or build, but the directory names just have _0
or _1, so there's never any need to rename anything. At one time I did
have a test core per shard and directories ending in _2, but over the
course of a full year I never used it once, so I got rid of it.
Thanks,
Shawn