Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
cloudappliance/solrreplication [2020_03_10 14:08] – [Disclaimer] jimcloudappliance/solrreplication [2020_11_16 11:38] dan
Line 1: Line 1:
 ===== Solr Replication for Highly Available EFF Content Search ===== ===== Solr Replication for Highly Available EFF Content Search =====
-== last updated March 06, 2020 ==+== last updated November 26, 2020 ==
  
 ==== Disclaimer ==== ==== Disclaimer ====
Line 58: Line 58:
 === Configuring the Solr === === Configuring the Solr ===
  
-You must perform these steps to create a specialized solr server from the standard SME appliance distribution. +You must perform these steps to create a specialized Solr server from the standard SME appliance distribution. 
  
 === Restrict external access  === === Restrict external access  ===
-The solr server does not serve web pages and does not need to be accessible from outside WAN. The only traffic you need to allow is TCP port 7070 from all web frontend servers.+The Solr server does not serve web pages and does not need to be accessible from outside WAN. The only traffic you need to allow is TCP port 7070 from all web frontend servers.
  
  
Line 88: Line 88:
  
  
-Then restart solr for this change to take effect+Then restart Solr for this change to take effect
  
 <code> <code>
Line 98: Line 98:
 == Update Configuration to enable ReplicationHandler == == Update Configuration to enable ReplicationHandler ==
  
-We will edit the following file in order to turn on the Replication Handler within solr, which will handle all solr index replication. +We will edit the following file in order to turn on the Replication Handler within Solr, which will handle all Solr index replication. 
  
 Add the following into this file: /smedata/sme_solr/sme/conf/solrconfig.xml Add the following into this file: /smedata/sme_solr/sme/conf/solrconfig.xml
Line 162: Line 162:
  
 == Define Master and Slaves == == Define Master and Slaves ==
-Each solr instance is configured to be able to act as either a master or a slave. In order to define the state of each we will use core properties. +Each Solr instance is configured to be able to act as either a master or a slave. In order to define the state of each we will use core properties. 
  
 On smesql01 to make it master add the following two lines at the bottom of /smedata/sme_solr/sme/core.properties On smesql01 to make it master add the following two lines at the bottom of /smedata/sme_solr/sme/core.properties
Line 178: Line 178:
 </code> </code>
  
-Finally, we will restart solr on both hosts in order to have those changes take effect:+Finally, we will restart Solr on both hosts in order to have those changes take effect:
  
 <code> <code>
Line 388: Line 388:
 == Restart Keepalived == == Restart Keepalived ==
 We will now restart keepalived to apply the new configuration. We will now restart keepalived to apply the new configuration.
-If this is a running production enviornment, please take care to shutdown keepalived on the slave, restart the master and then start the slave, otherwise there will be a relection and failover of mysql and memcache during this restart+If this is a running production environment, please take care to shutdown keepalived on the slave, restart the master and then start the slave, otherwise there will be a re-election and failover of mysql and memcache during this restart
  
 <code> <code>
Line 437: Line 437:
 Settings > Search Integrations Settings > Search Integrations
  
-Replace the solr uri as follows:+Replace the Solr uri as follows:
 <code> <code>
 http://smesearch:7070/sme/ http://smesearch:7070/sme/
Line 448: Line 448:
 === Failover and Recovery === === Failover and Recovery ===
  
-In the case of an outage of the solr service, or the smesql01 service, keepalived will fail over traffic to the solr instance running on smesql02. +In the case of an outage of the Solr service, or the smesql01 service, keepalived will fail over traffic to the Solr instance running on smesql02. 
  
-This process is all automatic. All new solr read and writes will now occur on the smesql02 server without any intervention. +This process is all automatic. All new Solr read and writes will now occur on the smesql02 server without any intervention. 
  
-However, when smesq01 server/solr service is available again, we will not fail traffic back over in the other direction, as the smesql01 database will NOT contain any of the new indexes created during the outage. Solr replication is setup to run in only one direction at a time, so unlike the mysql setup, the smesql01 solr service will not automatically copy back any changes. +However, when smesq01 server/solr service is available again, we will not fail traffic back over in the other direction, as the smesql01 database will NOT contain any of the new indexes created during the outage. Solr replication is setup to run in only one direction at a time, so unlike the mysql setup, the smesql01 Solr service will not automatically copy back any changes. 
  
 In order to get the master up to date you will need to change the master/slave status of each host.  In order to get the master up to date you will need to change the master/slave status of each host. 
Line 470: Line 470:
 </code> </code>
  
-Finally, we will restart solr on both hosts in order to have those changes take effect:+Finally, we will restart Solr on both hosts in order to have those changes take effect:
  
 <code> <code>
Line 478: Line 478:
 This will switch the status and start replicating data from smesql02 (the new master) over to smesql01 (new slave).  This will switch the status and start replicating data from smesql02 (the new master) over to smesql01 (new slave). 
  
-We can check replicatin status on the hosts via this webpage: +We can check replication status on the hosts via this webpage: 
-http://<smesql01/smesql02>:7070/#/sme/replication+``` 
 +http://<smesql01_or_smesql02>:7070/#/sme/replication 
 +```
  
 Once both have the same Version/Gen number they are in sync.  Once both have the same Version/Gen number they are in sync.