Ticket #914 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

solr port issues

Reported by: kjdon Owned by: ak19
Priority: moderate Milestone: 3.09 Release
Component: Greenstone3 Ant Code Severity: minor
Keywords: Cc:

Description (last modified by kjdon) (diff)

Solr runs off the tomcat port. ext/solr/gs3-setup.sh is run when we source gs3-setup.sh in top level. This reads build.properties and sets SOLR_PORT and SOLR_HOST env vars based on values of tomcat.port and tomcat.host.

This is all fine until you want to change your tomcat port. gs3-setup.sh can never get re-run in the same terminal, so you can never reset SOLR_PORT variable.

* when port is changed in gs3 server settings, it needs to do something about SOLR_PORT. * maybe we can make an ant target 'configure' which is called when the top level configure is called? (this is called whenever we start the server). Then SOLR_PORT wil get checked everytime we start the server. * however, this won't set it in the terminal? cos its not doing a 'source'.

Can we find the solr url a different way, not using environmnet vars??

Change History

Changed 4 years ago by kjdon

  • description modified (diff)

Changed 3 years ago by ak19

  • owner changed from nobody to ak19

The problem appears when the tomcat port (which is the solr port when not using jetty) is changed in build.properties and we rebuild the solr-jdbm-demo collection: the building scripts are still using the old tomcat/solr port, so they can't communicate with the running solr servlet at the solr context localhost:8383/solr.

Dr Bainbridge came up with the following solution: the perl build code should communicate with a new ant target that returns the solr context URL, instead of getting solr host and solr port from the Env Vars. This will then mimic the building code getting the GS3 library URL from a dedicated ant target too.

The solution, along with bugfixes to SOLR building, activating and deactivating, as well as some tidying up of existing code, were implemented in the following changesets

1. The solution to building scripts not using evolving Solr Port and Solr Hosts. This fix also makes solr code and build.xml agnostic to http vs https.

http://trac.greenstone.org/changeset/31488 to http://trac.greenstone.org/changeset/31490, and


2. Bugfix surrounding activation and deactivation. Errors were due to using 2>&1 to redirect both stderr and stdout of wget command to GS3 and collection pings, which interspersed stderr output in stdout (HTML) output, resulting in regex-es against stdout output not matching:

http://trac.greenstone.org/changeset/31507, http://trac.greenstone.org/changeset/31513, http://trac.greenstone.org/changeset/31514

3. Tidy up surrounding largely duplicated functions servercontrol::get_library_url() and util::get_fullgreenstone_url_prefix(), also some changes to further related code that needed to be made agnostic to http vs https: http://trac.greenstone.org/changeset/31515 to http://trac.greenstone.org/changeset/31519

Changed 3 years ago by ak19

  • status changed from new to closed
  • resolution set to fixed

Tested on Windows and Linux after reproducing the bugs on both, and after discovering the deactivation/activation bug and fixing it.

Note: See TracTickets for help on using tickets.