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 Parvin Gasimzade <pa...@gmail.com> on 2012/01/25 09:28:14 UTC

solr replication

Hi all,

I try to setup solr replication by following
http://wiki.apache.org/solr/SolrReplication tutorial.Everything is working
ok.

My question is, should i define two SolrServer in Solrj (one for master and
one for slave) in order to redirect indexes into master and queries into
slave?

In the future if i want to add new slave then should i change code?

What is the recommended way?

Thanks in advance.

Regards

Re: solr replication

Posted by Parvin Gasimzade <pa...@gmail.com>.
Hi Anderson,

Thank you for your effort.I will try this.
Hope it will solve my problem.

Regards

On Wed, Jan 25, 2012 at 2:27 PM, Anderson vasconcelos <
anderson.vass@gmail.com> wrote:

> Hi Parvin
>
> I did something that may help you. I set up apache (with mod_proxy and mode
> balance) like a front-end and use this to distruted the request of my
> aplication. Request for /update or /optmize, i'm redirect to master (or
> masters) server and requests /search i redirect to slaves. Example:
>
> <Proxy balancer://solrclusterindex>
> BalancerMember http://127.0.0.1:8080/apache-solr-1.4.1/ disablereuse=On
> route=jvm1
> </Proxy>
>
> <Proxy balancer://solrclustersearch>
> BalancerMember http://127.0.0.1:8080/apache-solr-1.4.1/ disablereuse=On
> route=jvm1
> BalancerMember http://10.16.129.61:8080/apache-solr-1.4.1/ disablereuse=On
> route=jvm2
> </Proxy>
>
> ProxyPassMatch /solrcluster(.*)/update(.*)$
> balancer://solrclusterindex$1/update$2
> ProxyPassMatch /solrcluster(.*)/select(.*)$
> balancer://solrclustersearch$1/select$2
>
> I hope it helps you
>

Re: solr replication

Posted by Anderson vasconcelos <an...@gmail.com>.
Hi Parvin

I did something that may help you. I set up apache (with mod_proxy and mode
balance) like a front-end and use this to distruted the request of my
aplication. Request for /update or /optmize, i'm redirect to master (or
masters) server and requests /search i redirect to slaves. Example:

<Proxy balancer://solrclusterindex>
BalancerMember http://127.0.0.1:8080/apache-solr-1.4.1/ disablereuse=On
route=jvm1
</Proxy>

<Proxy balancer://solrclustersearch>
BalancerMember http://127.0.0.1:8080/apache-solr-1.4.1/ disablereuse=On
route=jvm1
BalancerMember http://10.16.129.61:8080/apache-solr-1.4.1/ disablereuse=On
route=jvm2
</Proxy>

ProxyPassMatch /solrcluster(.*)/update(.*)$
balancer://solrclusterindex$1/update$2
ProxyPassMatch /solrcluster(.*)/select(.*)$
balancer://solrclustersearch$1/select$2

I hope it helps you

Re: solr replication

Posted by Parvin Gasimzade <pa...@gmail.com>.
Ok thank you for your response.

On Wed, Jan 25, 2012 at 12:24 PM, darul <da...@gmail.com> wrote:

> I mean by grid the list of your instances :
>
> String masterUrl = "http://masterUrl/core/..."
> String[] slaveUrls = {"http://slaveUrl/core/...",
> "http://slaveUrl/core/..."}
>
> Then use your business logic to use the correct one with Http solrJ facade.
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/solr-replication-tp3687106p3687314.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: solr replication

Posted by darul <da...@gmail.com>.
I mean by grid the list of your instances :

String masterUrl = "http://masterUrl/core/..."
String[] slaveUrls = {"http://slaveUrl/core/...",
"http://slaveUrl/core/..."}

Then use your business logic to use the correct one with Http solrJ facade.

--
View this message in context: http://lucene.472066.n3.nabble.com/solr-replication-tp3687106p3687314.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: solr replication

Posted by Parvin Gasimzade <pa...@gmail.com>.
Thank you for your response.
What you mean by Grid? Can you please send me any example or any link?


On Wed, Jan 25, 2012 at 11:30 AM, darul <da...@gmail.com> wrote:

> You may define your specific configuration as a Grid with all your solr
> instances and then using SolrJ and CommonsHttpSolrServer choose the right
> url depending on indexation or search task.
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/solr-replication-tp3687106p3687208.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: solr replication

Posted by darul <da...@gmail.com>.
You may define your specific configuration as a Grid with all your solr
instances and then using SolrJ and CommonsHttpSolrServer choose the right
url depending on indexation or search task.

--
View this message in context: http://lucene.472066.n3.nabble.com/solr-replication-tp3687106p3687208.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: solr replication

Posted by Parvin Gasimzade <pa...@gmail.com>.
Then as you say , shouldn't i define three SolrServer() using SolrJ?
For indexing call solrMasterServer, and for querying call solrSlaveServer1
or solrSlaveServer2?

On Wed, Jan 25, 2012 at 11:09 AM, darul <da...@gmail.com> wrote:

> Here is the way I see it (and implemented it), while using SolrJ api you
> have
> to fire :
>
> - Indexation commands to your /indexation solr instance/ (master) example :
> http://myMaster:80/myCore/
> - Query commands to your /search solr instance/ (slave). You may have
> several slaves, and also find alternative as broker to make load balancing
> betweeen each....
> http://mySlave1:80/myCore/
> http://mySlave2:80/myCore/
> ...
>
> You do not need any changes in code normally, replication is made
> automatically and defined in your solrconfig.xml configuration file.
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/solr-replication-tp3687106p3687168.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: solr replication

Posted by darul <da...@gmail.com>.
Here is the way I see it (and implemented it), while using SolrJ api you have
to fire :

- Indexation commands to your /indexation solr instance/ (master) example :
http://myMaster:80/myCore/
- Query commands to your /search solr instance/ (slave). You may have
several slaves, and also find alternative as broker to make load balancing
betweeen each....
http://mySlave1:80/myCore/
http://mySlave2:80/myCore/
...

You do not need any changes in code normally, replication is made
automatically and defined in your solrconfig.xml configuration file.

--
View this message in context: http://lucene.472066.n3.nabble.com/solr-replication-tp3687106p3687168.html
Sent from the Solr - User mailing list archive at Nabble.com.