Reindexing networks after SOLR update - ndexbio/ndex-rest GitHub Wiki

Overview

When the Solr version is updated, it is necessary to reindex networks in NDEx.

Steps to Reindex Networks in NDEx

  1. Stop NDEx Tomcat and Solr Services (as root user: sudo -u root /bin/bash)

To prevent any access or modification issues during the reindexing process, first stop the NDEx Tomcat and Solr services:

systemctl stop ndex-tomcat
systemctl stop ndex-solr
  1. Remove all the existing indexes (directories) under /opt/ndex/solr/server/solr. Don’t remove the configsets directory, remove all other directory (all UUID directories, ndex-networks, ndex-groups and ndex-users)
find . -type d -name '????????-????-????-????-????????????' -exec rm -r {} +
rm -r ndex-networks
rm -r ndex-users
rm -r ndex-groups
  1. Adjust system settings (only once on a given machine)
  • Check the current max_map_count. If the result is something like 65530, increase it:

    sysctl vm.max_map_count
    sudo sysctl -w vm.max_map_count=262144
    
  • Ensure memory and process limits are set to unlimited:

    ulimit -v
    ulimit -m
    
  • If necessary, change them to unlimited:

    ulimit -v unlimited
    ulimit -m unlimited
    
  • Increase the number of open file descriptors: (as ndex user, sudo -u ndex /bin/bash)

    ulimit -n 65000
    
  • Optionally, stop unnecessary services (iquery services etc) to free up more system resources.

  1. Start NDEx Solr Service (as ndex user: sudo -u ndex /bin/bash)

After stopping the services, start the NDEx Solr service alone with specified heapsize.

/opt/ndex/solr/bin/solr start -m 60g
  1. Run the Solr Index Builder (as ndex user: sudo -u ndex /bin/bash

Navigate to the appropriate directory to set the configuration path. Then execute the SolrIndexBuilder command to start reindexing. This process will take a while, so it is recommended to use nohup.

cd /opt/ndex/tomcat/webapps/ndexbio-rest/WEB-INF/
export ndexConfigurationPath=/opt/ndex/conf/ndex.properties
nohup java -Xmx5g -classpath lib/*:../../../lib/* org.ndexbio.common.solr.SolrIndexBuilder  all  1>/tmp/ndexsolr.out 2>/tmp/ndexsolr.err &
  1. Restart solr and NDEx Tomcat Service (as root user: sudo -u root /bin/bash)

Once the reindexing is complete, restart the NDEx Tomcat service:

/opt/ndex/solr/bin/solr stop
systemctl start ndex-solr
systemctl start ndex-tomcat

Additional Notes

  • Monitor the log files (/tmp/ndexsolr.out and /tmp/ndexsolr.err) for any potential errors during the reindexing process.

The last line in /tmp/ndexsolr.out should be INFO org.ndexbio.common.solr.SolrIndexBuilder -- Index rebuild process finished., and /tmp/ndexsolr.err should have no error messages.