This document will explain the steps that are to be followed to optimize Solr Index in SCSB.
Steps:
Enable maintenance mode for SCSB
- Get in into server 3 and execute following commands
cd scripts
bash setmaintmode // this will ask confirmation. Enter 1 for yes.
After maintenance mode enabled, SCSB maintenance page will be shown for UI
Take all containers down
- Stop all containers on both prod servers.
Start SOLR optimization
- Start Solr Server on one server with non replication mode (We did change in jenkins job to set REPLICATION as ‘false’ and memory to 26GB)
- Launch Solr admin page and take count of records for verification purpose.
- Initiate optimize from solr admin page by pushing “optimize now” button.
Eg screen:
Once you initiate the process you will see log something like this “o.a.s.u.DirectUpdateHandler2 Starting optimize... Reading and rewriting the entire index! Use with care.”
It will take some time to finish it. If you finish you will see following screen
Now solr is optimized. Verify the records count before and after. Need to start replication on second server.
Replication
- Stop SOLR on both server
- Remove old scsb-zookeeper data directory from 3 prod servers.
- Run fresh zookeeper container on 3 prod servers.
- Start SOLR on prod server where optimization is done. Start with replication mode. (REPLICATION is true and memory is 6GB)
- Verify the Solr admin page.
- Now build fresh SOLR on second server with replication mode (remove/move old index from second server)
- Once solr server started, Zookeeper with start process to sync the data from Server 1 to Server 2. It will take about 10 mins to finish it.
- Once its done you can see both servers are in active in solr admin page (admin page → cloud)
- Verify records count between two servers.
Bring all containers
Start all containers on both servers.
Verify manually and make sure all good.
Reset Maintenance Mode:
Get in into server 3 and execute following commands
cd scripts
bash resetmaintmode // this will ask confirmation. Enter 1 for yes.
After maintenance mode disabled, SCSB UI show should displayed
Prod Solr Optimization Statistics - Sep 11 2017
S. No | Before/After Optimize | Total Count | Bib Count | Holdings Count | Items Count | Disk Size in GB | Deleted Docs |
---|---|---|---|---|---|---|---|
1 | Before | 30718785 | 8293444 | 8585168 | 13840173 | 22.41 | 8258838 |
2 | After | 30718785 | 8293444 | 8585168 | 13840173 | 17.29 | 0 |
Image Reference
Before
After