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 SolrCloud: How to replicate shard of another machine for failover?
Date Tue, 25 Feb 2014 15:09:43 GMT
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