Create / Delete Registry

Overview

Indices must be created in OpenSearch, before running the registry.

The indices used by the registry are:

  • registry - this index stores metadata extracted from PDS4 labels, one ES document per PDS label.

  • registry-dd - this index stores data dictionary - a list of searchable fields and its data types. When registry is created, the registry data dictionary is populated with PDS common and few discipline dictionaries. Harvest automatically loads new dictionaries from schema location specified in PDS4 labels. You can also add more fields and LDDs manually with Registry Manager tool.

  • registry-refs - this index stores product references extracted from collection inventory files. There could be 1 or more ES documents per inventory file.

The indices are created with Registry Manager command-line tool.

Prerequisites

  • OpenSearch server is running.

  • Registry Manager command-line tool is installed.

Create Registry

To create registry indices run Registry Manager’s “create-registry” command. You can pass the following optional parameters:

  • -es <url> - OpenSearch URL. Default value is http://localhost:9200

  • -index <name> - OpenSearch index name. Default value is “registry”.

  • -auth <file> - OpenSearch authentication configuration file. See example below.

  • -shards <number> - Number of shards (partitions) for registry index. Default value is 1.

  • -replicas <number> - Number of replicas (extra copies) of registry index. Default value is 0.

Note

Default number of shards and replicas is not recommended for production.

Examples

Create Registry indices in local OpenSearch (http://localhost:9200) with default number of shards and replicas.

registry-manager create-registry

Create Registry indices in remote OpenSearch with 3 shards and 1 replica.

registry-manager create-registry \
    -es https://my-host.my-domain:9999 \
    -auth /my/path/auth.cfg \
    -shards 3 \
    -replicas 1

If your OpenSearch server requires authentication, you have to create an authentication configuration file and provide following parameters:

# true - trust self-signed certificates; false - don't trust.
trust.self-signed = true
user = pds-user1
password = mypassword

Check that indices were created

To check that registry indices were created, call the following OpenSearch REST API: http://localhost:9200/_cat/indices?v

Update OpenSearch URL and pass user name and password if needed.

curl "http://localhost:9200/_cat/indices?v"

The response should look similar to this. Make sure that each index health is “green”.

health status index         uuid                   pri rep docs.count docs.deleted store.size pri.store.size
green  open   registry      PY6ObzELRlSx9gHOWbR8dw   1   0          0            0       208b           208b
green  open   registry-dd   CuJ-nqg1SbKI9hejHrISWA   1   0       2505            0      625kb          625kb
green  open   registry-refs 1cJLc-9cQj2D_MAYo7gOpw   1   0          0            0       208b           208b

Delete Registry

To delete registry indices, run Registry Manager’s “delete-registry” command. You can pass the following optional parameters:

  • -es <url> - OpenSearch URL. Default value is http://localhost:9200

  • -index <name> - OpenSearch index name. Default value is “registry”.

  • -auth <file> - OpenSearch authentication configuration file.

Examples

Delete registry indices from local OpenSearch (http://localhost:9200)

registry-manager delete-registry