You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by sling <sl...@gmail.com> on 2013/04/19 12:12:43 UTC

in solrcoud, how to assign a schemaConf to a collection ?

hi all, help~~~
how to specify a schema to a collection in solrcloud?

i have a solrcloud with 3 collections, and each configfile is uploaded to zk
like this:
args="-Xmn3000m -Xms5000m -Xmx5000m -XX:MaxPermSize=384m
-Dbootstrap_confdir=/workspace/solr/solrhome/doc/conf
-Dcollection.configName=docconf -DzkHost=zk1:2181,zk2:2181,zk3:2181
-DnumShards=3 -Dname=docCollection"

the solr.xml is like this
  <cores ...........>
        <core name="doc" instanceDir="doc/" loadOnStartup="true"
transient="false" collection="docCollection" />
        <core name="video" instanceDir="video/" loadOnStartup="true"
transient="false" collection="videoCollection" />
        <core name="pic" instanceDir="pic/" loadOnStartup="true"
transient="false" collection="picCollection"  />
  </cores>

then, when all nodes startup, i find the schema of 2 collection(doc and
video) are the same , while the schema of pic is wrong too......

are there some propeties in <core>, which can specify a its own schma??? 

thands for any help.......







--
View this message in context: http://lucene.472066.n3.nabble.com/in-solrcoud-how-to-assign-a-schemaConf-to-a-collection-tp4057238.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: in solrcoud, how to assign a schemaConf to a collection ?

Posted by sling <sl...@gmail.com>.
i copy the 3 schema.xml and solrconfig.xml to $solrhome/conf/xxxx.xml, and
upload this filedir to zk like this:
args="-Xmn1000m -Xms2000m -Xmx2000m -XX:MaxPermSize=384m
-Dbootstrap_confdir=/home/app/workspace/solrcloud/solr/solrhome/conf
-Dcollection.configName=conf -DzkHost=zk1:2181,zk2:2181,zk3:2181
-DnumShards=2 -Dname=docCollection"

then in solr.xml , it changes to:
 <core name="doc" instanceDir="doc/" loadOnStartup="true" transient="false"
collection="docCollection"  schema="s1.xml" config="sc1.xml" />

in this way , the schema.xml is seprated.

it seems the schema and config properties   has a relative path
/configs/conf,
and this is what i uploaded from local,
$solrhome/conf  is equals to /configs/conf.





--
View this message in context: http://lucene.472066.n3.nabble.com/in-solrcoud-how-to-assign-a-schemaConf-to-a-collection-tp4057238p4057254.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: in solrcoud, how to assign a schemaConf to a collection ?

Posted by sling <sl...@gmail.com>.
when i add a schema property to <core>
<core name="pic" instanceDir="pic/" loadOnStartup="true" transient="false"
collection="picCollection"  
config="solrconfig.xml" schema="../picconf/schema.xml"/>
it seems there a default path to schema ,that is /configs/docconf/
the exception is:
[18:59:09.211] java.lang.IllegalArgumentException: Invalid path string
"/configs/docconf/../picconf/schema.xml" caused by relative paths not
allowed @18
[18:59:09.211]  at
org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:99)
[18:59:09.211]  at
org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1133)
[18:59:09.211]  at
org.apache.solr.common.cloud.SolrZkClient$7.execute(SolrZkClient.java:253)
[18:59:09.211]  at
org.apache.solr.common.cloud.SolrZkClient$7.execute(SolrZkClient.java:250)
[18:59:09.211]  at
org.apache.solr.common.cloud.ZkCmdExecutor.retryOperation(ZkCmdExecutor.java:65)
[18:59:09.211]  at
org.apache.solr.common.cloud.SolrZkClient.getData(SolrZkClient.java:250)
[18:59:09.211]  at
org.apache.solr.cloud.ZkController.getConfigFileData(ZkController.java:388)
[18:59:09.211]  at
org.apache.solr.core.CoreContainer.getSchemaFromZk(CoreContainer.java:1659)
[18:59:09.211]  at
org.apache.solr.core.CoreContainer.createFromZk(CoreContainer.java:948)
[18:59:09.211]  at
org.apache.solr.core.CoreContainer.create(CoreContainer.java:1031)
[18:59:09.211]  at
org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:629)
[18:59:09.211]  at
org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:624)
[18:59:09.211]  at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
[18:59:09.211]  at java.util.concurrent.FutureTask.run(FutureTask.java:138)
[18:59:09.211]  at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
[18:59:09.211]  at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
[18:59:09.211]  at java.util.concurrent.FutureTask.run(FutureTask.java:138)
[18:59:09.211]  at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[18:59:09.211]  at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[18:59:09.211]  at java.lang.Thread.run(Thread.java:619)



--
View this message in context: http://lucene.472066.n3.nabble.com/in-solrcoud-how-to-assign-a-schemaConf-to-a-collection-tp4057238p4057250.html
Sent from the Solr - User mailing list archive at Nabble.com.