How do I set up Solr Cloud with two search engines?

Hi I am developing a rails project with sunspot solr and setting up Solr Cloud. My Wednesday: Rails 3.2.1, Ruby 2.1.2, Spot 2.1.0, Solr 4.1.6.

Why SolrCloud: I need a more stable system - often the search server continues to serve, and the web application stops working on production. So, I am thinking about how to make 2 identical search engines instead of one to make the system more stable: if one server is down, the others will continue to work.

I can't find any good Tutorials with simple, easy to understand and detailed Tutorials ... I'm trying to set up SolrCloud on two servers, but I don't quite understand how it works internally:

  • sync data between two servers (is this an automatic action?)
  • balances search requests between two servers
  • When one server suddenly stops working, the other should become master (is this an automatic action?)
  • Are there any SolrCloud features other than those listed?
+3


source to share


1 answer


Read more about SolrCloud here ..! https://wiki.apache.org/solr/SolrCloud

Several inputs from my experience.

If your application is just reading data from SOLR and not writing to SOLR (in real time, but you are indexing using ETL or so), you can simply go to the master slave hierarchy.

Define one master: - list all records here. If this wizard is disabled, you will no longer be able to index data

Create 2 (or more) slaves: - This is a function from SOLR and it will take care of syncing the data with the master based on the interval we specified (Say every 20 seconds)

Create a load balancer based on slaves and specify an application to read data from the load balancer.

Pros: With the above setup, you don't have high availability for the Master (Data write), but you will have high availability for data until the last slave goes down.

Cons: Suppose one slave fell and you bought him an hour later, this slave will be behind other slaves for one hour. Therefore, its manual task is to check the data consistency between other slaves before adding it back to the ELB.

How about SolrCloud?



  • There is no wizard here, so you can achieve high availability for Writes.
  • There is no need to worry about data inconsistencies as I described above, the SolrCloud architecture takes care of this.

What is right for you.

  • Define an external Zookeeper with three Quorom nodes
  • Define at least 2 SOLR north.
  • Divide your current index by 2 shards (by default, each shard will be one in each of the 2 solr nodes defined in step # 2
  • Define replica as 2 (this will create a replica for shards in each node)
  • Define LB to point to the overlying solr nodes.
  • Direct your entry to Solr as well as the app to point to this LB.

With the above setup, you can maintain failure for both nodes.

Let me know if you need more information on this.

Hello,

Aneesh N

- Let's study together.

+4


source







All Articles