Registry Manager Overview
Registry Manager is a command-line tool which can perform following tasks:
- Create and delete registry collection.
- Load Solr documents generated by Harvest tool into registry collection.
- Delete data from registry collection by lidvid, lid, package id.
- Export files from registry BLOB storage.
Registry Manager executable scripts for Windows (registry-manager.bat) and Linux / Mac (registry-manager) are located in bin sub-folder of the installation directory (e.g., /home/pds/registry/).
To see a list of Registry Manager commands and basic usage information (shown below), run registry-manager without any parameters.
Usage: registry-manager <command> <options> Commands: load-data Load data into registry collection delete-data Delete data from registry collection export-file Export a file from blob storage create-registry Create registry collection delete-registry Delete registry collection and all its data Options: -help Print help for a command Pass -help after any command to see command-specific usage information, for example, registry-manager load-data -help
To print command-specific usage information, pass -help parameter after any command. The basic usage information and options for delete-data command are shown below.
registry-manager delete-data -help
Usage: registry-manager delete-data <options> Delete data from registry collection Options: -lidvid <id> Delete data by lidvid -lid <id> Delete data by lid -packageId <id> Delete data by package id -all Delete all data -solrUrl <url> Solr URL. Default is http://localhost:8983/solr -zkHost <host> ZooKeeper connection string, <host:port>[,<host:port>][/path] For example, zk1:2181,zk2:2181,zk3:2181/solr
Solr or ZooKeeper Connection
To execute commands, Registry Manager has to connect to either ZooKeeper cluster or a Solr server node. By default it connects to:
- Embedded ZooKeeper bundled with Solr at localhost:9983 for create-registry and delete-registry commands,
- Solr node at http://localhost:8983/solr for other commands.
To customize this behavior use -solrUrl or -zkHost parameters.
Commands
Create or Delete Registry Collection
To create registry collection in Solr run create-registry command.
Usage: registry-manager create-registry <options> Create registry collection Optional parameters: -zkHost <host> ZooKeeper connection string, <host:port>[,<host:port>][/path] For example, zk1:2181,zk2:2181,zk3:2181/solr Default value is localhost:9983 -configDir <dir> Configuration directory with registry collection configuration files Default value is REGISTRY_MANAGER_HOME/solr/collections/registry -shards <number> Number of shards for registry collection. Default value is 1 -replicas <number> Number of replicas for registry collection. Default value is 1
To delete registry collection from Solr run delete-registry command.
Usage: registry-manager delete-registry <options> Delete registry collection and all its data Optional parameters: -zkHost <host> ZooKeeper connection string, <host:port>[,<host:port>][/path] For example, zk1:2181,zk2:2181,zk3:2181/solr Default value is localhost:9983
These commands are described in Registry Installation section.
Load Data
To load Solr documents generated by Harvest tool, use load-data command:
Usage: registry-manager load-data <options> Load data into registry collection Options: -filePath <path> An XML file or a directory to load. This is a required parameter. -solrUrl <url> Solr URL. Default is http://localhost:8983/solr -zkHost <host> ZooKeeper connection string, <host:port>[,<host:port>][/path] For example, zk1:2181,zk2:2181,zk3:2181/solr
For example, to load data from /home/pds/harvest/solr/solr-docs.xml file use the following command.
registry-manager load-data -filePath /home/pds/harvest/solr/solr-docs.xml
Delete Data
You can delete documents from Registry by lidvid, lid or package id (Harvest run id). You can also delete all documents.
Usage: registry-manager delete-data <options> Delete data from registry collection Options: -lidvid <id> Delete data by lidvid -lid <id> Delete data by lid -packageId <id> Delete data by package id -all Delete all data -solrUrl <url> Solr URL. Default is http://localhost:8983/solr -zkHost <host> ZooKeeper connection string, <host:port>[,<host:port>][/path] For example, zk1:2181,zk2:2181,zk3:2181/solr
Below are few examples.
registry-manager delete-data -lidvid urn:nasa:pds:context:target:asteroid.4_vesta::1.1 registry-manager delete-data -lid urn:nasa:pds:context:target:asteroid.4_vesta registry-manager delete-data -packageId 8d8ae96d-044e-473d-a278-62635b1c5977 registry-manager delete-data -all
Export File
To export a file from embedded BLOB storage by lidvid, run export-file command:
Usage: registry-manager export-file <options> Export a file from blob storage Required parameters: -lidvid <id> Lidvid of a file to export from blob storage. -filePath <path> A path to a file to write. Optional parameters: -solrUrl <url> Solr URL. Default is http://localhost:8983/solr -zkHost <host> ZooKeeper connection string, <host:port>[,<host:port>][/path] For example, zk1:2181,zk2:2181,zk3:2181/solr
This command will only work, if file BLOBs were generated by Harvest. An example is shown below.
registry-manager export-file -lidvid urn:nasa:pds:context:target:asteroid.4_vesta::1.1 -filePath /tmp/4_vesta.xml