Managing Elasticsearch index host nodes outside of the Search landing page
The search features for Pega® 7 Platform rely on index files that are stored, or hosted, on nodes in the Pega 7 Platform cluster. Nodes in the Pega cluster can be added or removed as index host nodes outside of the Pega 7 Platform and the Search landing page. Adding and removing nodes outside of Pega 7 Platform eliminates the need for manual configuration on the Search landing page and ensures that search index files are always available.
For more information about search index host nodes, see Configuring index host nodes.
Adding or modifying an index host node
You can configure Elasticsearch index nodes with a command-line setting during JVM startup instead of using the Search landing page. Specify the following setting during JVM startup:
The directory location can reference either persistent storage or local, non-persistent storage.
- If non-local storage is used, the appropriate volume must be mounted when an index host node is started, and no more than one index host node should point to the same directory location.
- If local storage is used, the system administrator must ensure that at least one index host node is running at all times to avoid having to rebuild the index files. If only one index host node is running, a second index host node must be started to allow time for index replication to take place before shutting down the original index host node.
You can view changes made using this setting on the Search landing page. The following table details the changes that are made to the index host node configuration on the Search landing page during startup, based on the current status of the node and the value of the index.directory setting.
|Current node status||index.directory setting||Result|
|Any||The specified directory is inaccessible (does not exist or is locked).||An error is printed in the log file and the node is started. No change is made to the index host node configuration if the current node is not the first node started after installation.|
|Any||No directory is specified.||The node is started. No change is made to the index host node configuration.|
|Node is not already identified as an index host node||An accessible directory is specified.||The node is started. The index host node configuration is updated to include the node and directory.|
|Node is already identified as an index host node||An accessible directory is specified that matches the directory that is currently used by the node.||The node is started. No change is made to the index host node configuration.|
|Node is already identified as an index host node||An accessible directory is specified that is different from the directory that is currently used by the node.||The node is started. The index host node configuration is updated to use the specified directory for that node.|
Specifying that a node is always or never an index host node
You can specify that a node is either always an index host node or that it never becomes an index host node even if it is the first node that is started after installation. Use the following JVM setting at startup:
- Specify the directory to use to always make this node an index host node:
- Leave this setting blank to never make this node an index host node:
As a best practice, configure this setting on all non-index nodes.
-Dindex.directoryis not specified, and a custom index is used, the system uses the default directory if no other index host nodes are online when a server starts.
Removing an offline index host node
You can remove offline nodes from the search cluster configuration by using the prpcUtils utility. This procedure assumes that the database details have already been entered in the prpcUtils.properties file.
- In the prpcUtils.properties file, enter the following information for the index node that you want to remove from the search node list:
- Save the file.
- Run the utility by entering the following command:
Disabling automatic reindexing
Reindexing on index host nodes is triggered automatically when no other index node exists in the cluster, eliminating the need to manually clean up old items and start reindexing. In addition, offline index host nodes are removed as index host nodes during normal shutdown and startup of any node in the cluster. As a result, you might have to add back a node as an index host node on the Search landing page. You can turn off automatic reindexing and removal of offline index host nodes by using the following Dynamic System Setting:
Owning Ruleset: Pega-SearchEngine
Setting Purpose: indexing/distributed/autonodecleanupandreindex