Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm currently working with a Magento Enterprise 1.12 installation running on a pair of clustered Apache web servers. Both of my web servers draw from their own databases on separate servers which are clustered in a Master-Master MySQL configuration.

My problem is that I'm attempting to introduce Solr 3.6.1 into the picture and I'm somewhat unsure of how to properly add it to my cluster. Should I be able to set up one instance of Solr(perhaps on a different server) and point both sites to it or do I need a stand alone instance of Solr for both servers? Do I need two instances of Solr configured together in some way? I apologize if I haven't provided enough information.

share|improve this question

migrated from stackoverflow.com Oct 18 '12 at 17:15

This question came from our site for professional and enthusiast programmers.

2 Answers 2

You should set up solr on one of your servers and in the Magento Admin configuration configure Solr Server Hostname as this servers address (if you don't have separate domain names, insert ip address there)- since you have Mysql replication, they both will use same config.

Just make sure that the hostname and port (like 8080) is accessible from within your second server.

share|improve this answer

Slayer gave the basic answer. Solr run is a java app and runs in a java web server like getty. Now assuming your apache runs on port 80 you should configure your network so both web servers can talk to that solr server (using the real ip address in your magento configuration and obviously not 127.0.0.1) but no one outside the network can.

Furthermore I would use THAT as your security and not httpauth authentication because we ran into issues where it did not work. Basically magento sends a ping during some operations without credentials and fails and thus will not send the real query WITH the creds.

OK. Another important point is "fulltext indexing".

I have a long answer on stack overflow here http://stackoverflow.com/questions/11667728/magento-1-12-and-solr-3-6-no-proper-results-and-no-spell-suggestions/12984270#12984270 but I will try to be brief.

If you run the fulltext indexer from the shell via php shell/indexer.php --reindex-all catalogsearch_fulltext it will not work properly. An event is not fired. So run it from the UI. However that is a problem because the operation will take 4+ hours depending on the number of products you have. Quick fix is to tweak php timeout around the fulltext indexer functionality. Because obviously your apache timeouts should be short. They can continue to be short but if the php timeout is long it should continue to run even though apache will show a dead page.

Also the newest magento wraps the fulltext indexer code in a transaction. As a result while it is running and searches on the site return a "wait lock timeout" on catalogsearch_query table. We removed the transaction wrapping it and we were fine.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.