问题
I have a zookeeper instance (Solr integrated version) with 3 collections. Each collection has a different schema.xml in it's conf directory. Zookeeper starts sucessfully - the goal is to do a distributed search across the different collections. My problem is that when I look at the schema of collection2 and collection3 via the admin tool they both appear to be using collection1 schema. So I cannot update collections 2 & 3 as they are missing their correct fields.
I have tried each of the following startup methods to no avail -
java -Dbootstrap_conf=true -DzkRun -DnumShards=1 -jar start.jar
and
java -DzkRun -DnumShards=1 -jar start.jar
and
java -Dbootstrap_confdir=solr/collection1/conf -Dcollection.configName=collection1 -DzkRun -DnumShards=1 -jar start.jar
Incase it helps my solr.xml file contains the following snippet -
<cores adminPath="/admin/cores" defaultCoreName="collection1" host="${host:}" hostPort="${jetty.port:8983}" hostContext="${hostContext:solr}" zkClientTimeout="${zkClientTimeout:15000}">
<core name="collection1" instanceDir="collection1" />
<core name="collection2" instanceDir="collection2" />
<core name="collection3" instanceDir="collection3" />
回答1:
Ooops I just found the answer to my problem.
java -Dbootstrap_conf=true -DzkRun -DnumShards=1 -jar start.jar
Basically the above command did not appear to work because zookeeper had already been bootstrapped (config files loaded) at a previous time using the following command
java -Dbootstrap_confdir=solr/collection1/conf -Dcollection.configName=collection1 -DzkRun -DnumShards=1 -jar start.jar
The command above means all collections will use the schema in collection1/conf. Subsequently starting zookeeper with the command -Dbootstrap_conf=true had no affect.
Solution - Remove solr/zoo_data directory and rerun the -Dbootstrap_conf=true command.
来源:https://stackoverflow.com/questions/23338324/zookeeper-multiple-collection-different-schema