Opened 7 years ago

Closed 7 years ago

#914 closed defect (fixed)

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)

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

This is all fine until you want to change your tomcat port. 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 (3)

comment:1 by kjdon, 7 years ago

Description: modified (diff)

comment:2 by ak19, 7 years ago

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 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. to, and

  1. 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:,,

  1. 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: to

comment:3 by ak19, 7 years ago

Resolution: fixed
Status: newclosed

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.