Closed ess-acppo-djd closed 4 years ago
NOTE: this is related/overlapping with issue: #13
The first/simple implementation:
sudo su tomcat7 -s/bin/bash
):
echo \
'<Context path="/version/" docBase="/var/lib/tomcat7/webapps-sit-ag-bie.oztaxa.com/version/" />' \
> /var/lib/tomcat7/conf/Catalina/sit-ag-bie.oztaxa.com/version.xml
mkdir -p /var/lib/tomcat7/webapps-sit-ag-bie.oztaxa.com/version
sudo systemctl restart tomcat7.service
/var/lib/tomcat7/webapps-sit-ag-bie.oztaxa.com/version
, for example (info.json); NOTE: This is the JSON file that will be automatically re-generated/written every time we run the SOLR combine taxas (jenkins job-s / script-s):
{
"env": "SIT",
"ag-bie": "0.4",
"input": {
"generated": "2018-08-21 16:35",
"NAQS": {
"tblBiota": "tblBiota_20180821.csv"
},
"BNTi-icn": {
"nsl_dawr_bieexport": "https://dev56-icn.oztaxa.com/nxl/services/export/namesCsv"
}
},
"comment": "THIS IS ONLY AN EXAMPLE!"
}
mbohun@linux-cr70:~> curl -s https://sit-ag-bie.oztaxa.com/version/info.json | jq '.'
{
"env": "SIT",
"ag-bie": "0.4",
"input": {
"generated": "2018-08-21 16:35",
"NAQS": {
"tblBiota": "tblBiota_20180821.csv"
},
"BNTi-icn": {
"nsl_dawr_bieexport": "https://dev56-icn.oztaxa.com/nxl/services/export/namesCsv"
}
},
"comment": "THIS IS ONLY AN EXAMPLE!"
}
Although it is possible to read/report the time from /data/solr/bie/data/tlog
//data/solr/bie/data-offline/tlog
you will need some mechanism to find out which one is the most "recent one":
ubuntu@ip-172-31-16-30:~$ ls -lahF /data/solr/bie/data-offline/tlog/
total 3.8M
drwxr-xr-x 2 tomcat7 tomcat7 4.0K Aug 22 00:20 ./
drwxr-xr-x 4 tomcat7 tomcat7 4.0K Jul 25 11:18 ../
-rw-r--r-- 1 tomcat7 tomcat7 3.8M Aug 22 00:20 tlog.0000000000000000188
ubuntu@ip-172-31-16-30:~$ ls -lahF /data/solr/bie/data/tlog/
total 1.4M
drwxr-xr-x 2 tomcat7 tomcat7 4.0K Aug 21 00:21 ./
drwxr-xr-x 4 tomcat7 tomcat7 4.0K Jul 25 11:18 ../
-rw-r--r-- 1 tomcat7 tomcat7 1.4M Aug 21 00:21 tlog.0000000000000000172
Possible solutions/alternatives:
one could query the /data/solr/solr.xml
file for the dataDir
value of the <core name="bie" />
<solr>
<cores>
<core name="bie" instanceDir="bie" dataDir="data-offline"/>
</cores>
</solr>
solr_bie_dir=$(cat /data/solr/solr.xml | xmllint --xpath "string(//*[local-name()='solr'] //cores/core[@name='bie']/@dataDir)" - )
ls -lahF "/data/solr/bie/${solr_bie_dir}/tlog"
total 3.8M
drwxr-xr-x 2 tomcat7 tomcat7 4.0K Aug 22 00:20 ./
drwxr-xr-x 4 tomcat7 tomcat7 4.0K Jul 25 11:18 ../
-rw-r--r-- 1 tomcat7 tomcat7 3.8M Aug 22 00:20 tlog.0000000000000000188
This is not needed based on the business requirements at this stage
Somewhere on the homepage provide the date and time the index was last processed. This should be the date and time the "tlog" file is created in the directory /data/solr/bie/data/tlog.
Note that processing alternates between the directory
and the directory