lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Schrenk <oliver.schr...@gmail.com>
Subject Re: SolrCloud: How to replicate shard of another machine for failover?
Date Tue, 25 Feb 2014 15:42:55 GMT
I don’t actually run these commands. Everything is written down in either jetty.conf or solr.xml.
I basically copy-pasted the output from a `ps -ef | grep solr`.

Is the Collections API the only way to do so? At the moment this is a proof of concept, but
for going to production and I want to put this into puppet and I would feel more comfortable
using configuration files than making a call to a webservice.


On 25 Feb 2014, at 16:19, Greg Walters <greg.walters@answers.com> wrote:

> Oliver,
> 
> You'll probably have better luck not supplying CLI arguments and creating your collection
via the collections api (https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-CreateaCollection).
Try removing -DnumShards and setting the -Dcollection.configName to something abstract such
as "collection1" rather than "solrconfig.xml" as you'll actually end up creating a directory
in zookeeper called "solrconfig.xml" which can get confusing. Something like:
> 
> http://localhost:7071/solr/admin/collections?action=CREATE&name=collection1&numShards=2&replicationFactor=2&maxShardsPerNode=2&collection.configName=collection1
> 
> should fit what you're trying to accomplish.
> 
> Thanks,
> Greg
> 
> On Feb 25, 2014, at 9:09 AM, Oliver Schrenk <oliver.schrenk@gmail.com> wrote:
> 
>> Hi,
>> 
>> tldr: I have troubles configuring SolrCloud 4.3.1 to replicate the shard of 
>> another machine. Basically what it boils down is the question how to tell on 
>> solr instance to replicate the shard of another machine. I though that the 
>> system property `-Dshard=2` will do the trick but it doesn't do anything.
>> 
>> What to do?
>> 
>> 
>> ---
>> 
>> I want the following setup
>> 
>> 
>> 	                   leader.host_1:7070
>> 	                  /
>> 	            shard1
>> 	           /      \           
>> 	          /        replica.host_2:7071
>> 	collection 
>> 	          \        leader.host_2:7070
>> 	           \      /  
>> 	            shard2
>> 	                  \           
>> 	                   replica.host_1:7071
>> 
>> I want to run two logical instances (leader & replica) of Solr on each physical

>> machine (host_1 & host_2).
>> 
>> 
>> 
>> Everything is running but the shard is replicated on the same physical machine!
>> Which doesn't work as a failover mechanism. So at the moment the layout is as
>> follows:
>> 
>> 	                   leader.host_1:7070
>> 	                  /
>> 	            shard1
>> 	           /      \           
>> 	          /        replica.host_1:7071
>> 	collection 
>> 	          \        leader.host_2:7070
>> 	           \      /  
>> 	            shard2
>> 	                  \           
>> 	                   replica.host_2:7071
>> 
>> I basically run the following commands on each machine. First on host_1
>> 
>> 	host_1$ java -Djetty.home=/opt/solr -DnumShards=2 
>> 	-Dcollection.configName=solrconfig.xml 
>> 	-DzkHost=localhost:2181 -Djetty.port=7070 
>> 	-Dsolr.solr.home=/opt/solr -Dbootstrap_confdir=conf -cp <classpath>
>> 
>> 	host_1$ java -Djetty.home=/opt/solr-replica-1 -DnumShards=2 
>> 	-Dshard=shard2 -Dcollection.configName=solrconfig.xml 
>> 	-DzkHost=localhost:2181 -Djetty.port=7071 
>> 	-Dsolr.solr.home=/opt/solr-replica-1 -Dbootstrap_confdir=conf -cp <classpath>
>> 
>> Then on host_2
>> 
>> 	host_2$ java -Djetty.home=/opt/solr -DnumShards=2 
>> 	-Dcollection.configName=solrconfig.xml 
>> 	-DzkHost=localhost:2181 -Djetty.port=7070 
>> 	-Dsolr.solr.home=/opt/solr -Dbootstrap_confdir=conf -cp <classpath>
>> 
>> 	host_2$ java -Djetty.home=/opt/solr-replica-1 -DnumShards=2 
>> 	-Dshard=shard1 -Dcollection.configName=solrconfig.xml 
>> 	-DzkHost=localhost:2181 -Djetty.port=7071 
>> 	-Dsolr.solr.home=/opt/solr-replica-1 -Dbootstrap_confdir=conf -cp <classpath>
>> 
>> 
>> 
>> Am I using the wrong configuration parameter? Is this behaviour possible 
>> (with Solr 4.3)?
>> 
>> 
>> Best regards
>> Oliver
>> 
> 


Mime
View raw message