Encrypting Existing Search Indexes
Encrypting DSE Search indexes turns on encryption only for new files. Additional steps are required to encrypt existing data. When you encrypt existing DSE Search indexes, a node restart is required.
There are several ways to encrypt existing DSE Search indexes. Choose the method that is appropriate for your environment.
When using TDE secure local file system.
Encryption keys are stored
or locally with on-server encryption.
Encryption is enabled per core.
To enable encryption for an existing core, change the
<directoryFactory name="DirectoryFactory" class="solr.EncryptedFSDirectoryFactory"/>
Upload the changed
For example, you can use
dsetoolto upload the changed resource file:
dsetool reload_core keyspace_name.table_name
Restart the DataStax Enterprise node.
Enabling encryption does not require a node restart. However, the
directoryFactorychanges require a node restart.
Encryption is enabled only for new files. Additional steps are required to encrypt existing data.
To encrypt existing files, use one of these methods:
Slowest option: Use
dsetoolto reload the core and reindex while the node is running
dsetool reload_core keyspace_name.table_name deleteAll=true reindex=true
Fastest option: Requires that the local node is offline
When your DataStax Enterprise cluster has a second remote node that is running, use
dsetoolto encrypt index files on the local offline node. The encryption configuration is read from the remote node.
The remote node that contains the encryption configuration must be running.
The local node is offline.
The user that runs this command must have read and write permissions to the directory that contains the index files.
Enable encryption for all nodes that have a search index.
dsetool upgrade_index_files <keyspace_name>.<table_name> -h <IP_address> [<options>]
You can specify the following options for offline index encryption:
Required. The keyspace and table names of the search index. Keyspace and table names are case-sensitive. Enclose names that contain uppercase in double quotation marks.
- -h IP_address
Required. Node hostname or IP address of the remote node that contains the encryption configuration that is used for index encryption. The remote node must be running.
- -c port
The DSE port on the remote node that contains the encryption configuration.
Preserves the index files from the current index as a backup after successful upgrade. The preserved index file backup is moved to the
--workspacedirectory. When not specified, index files from the current index are deleted.
- --workspace directory
The workspace directory for the upgrade process. The upgraded index is created in this directory. When not specified, the default directory is the same directory that contains the search index files.
- --index directory
The data directory that contains the search index files. When not specified, the default directory is inferred from the search index name.
Simple option: But eventual and uncertain
You can wait, and as new data is added to your index, encryption occurs when indexes are compacted or merged. Because new files are encrypted, your files are eventually encrypted.
To verify which files are encrypted, use this command to list all DSE Search index files for the specified search core on the local node:
dsetool list_index_files <keyspace_name>.<table_name> [--index <directory>]
--index <directory>specifies the data directory that contains the search index files. When not specified, the default directory is inferred from the search core name.
After you verify which files are encrypted, you can encrypt existing files using a different option.
What is next
To disable encryption, disable encryption for the backing CQL table. No node restart is required.