cgspace-notes/content/posts/2021-11.md

40 lines
1.8 KiB
Markdown
Raw Normal View History

2021-11-01 09:49:21 +01:00
---
title: "November, 2021"
2021-11-03 14:56:15 +01:00
date: 2021-11-02T22:27:07+02:00
2021-11-01 09:49:21 +01:00
author: "Alan Orth"
categories: ["Notes"]
---
2021-11-03 14:56:15 +01:00
## 2021-11-02
- I experimented with manually sharding the Solr statistics on DSpace Test
- First I exported all the 2019 stats from CGSpace:
```console
$ ./run.sh -s http://localhost:8081/solr/statistics -f 'time:2019-*' -a export -o statistics-2019.json -k uid
$ zstd statistics-2019.json
```
2021-11-01 09:49:21 +01:00
<!--more-->
2021-11-03 14:56:15 +01:00
- Then on DSpace Test I created a `statistics-2019` core with the same instance dir as the main `statistics` core (as [illustrated in the DSpace docs](https://wiki.lyrasis.org/display/DSDOC6x/Testing+Solr+Shards))
```console
$ mkdir -p /home/dspacetest.cgiar.org/solr/statistics-2019/data
# create core in Solr admin
$ curl -s "http://localhost:8081/solr/statistics/update?softCommit=true" -H "Content-Type: text/xml" --data-binary "<delete><query>time:2019-*</query></delete>"
$ ./run.sh -s http://localhost:8081/solr/statistics-2019 -a import -o statistics-2019.json -k uid
```
- The key thing above is that you create the core in the Solr admin UI, but the data directory must already exist so you have to do that first in the file system
- I restarted the server after the import was done to see if the cores would come back up OK
- I remember last time I tried this the manually created statistics cores didn't come back up after I rebooted, but this time they did
## 2021-11-03
- While inspecting the stats for the new statistics-2019 shard on DSpace Test I noticed that I can't find any stats via the DSpace Statistics API for an item that _should_ have some
- I checked on CGSpace's and I can't find them there either, but I see them in Solr when I query in the admin UI
- I need to debug that, but it doesn't seem to be related to the sharding...
2021-11-01 09:49:21 +01:00
<!-- vim: set sw=2 ts=2: -->