TxnStore Commands
TxnStore commands are a collection of commands used to work with TxnStore and its indices.
Following are the TxnStore commands:
- HELP
- LISTROLES
- LISTUSERS
- CREATEUSER
- DELETEUSER
- LISTREPO
- CREATEREPO
- DELETEREPO
- BACKUP
- RESTORE
- ACTION
- HEAD
HELP
The Help command displays the complete list of TxnStore commands along with their respective description.
Syntax Defined
Syntax: ae help txnstore
Alias Defined
Alias: ae help opensearch
Sample Output:
D:\RPA\AssistEdgeAutomation\scripts> ae help txnstore
Any input required for action should be passed using env variable. Txnstore internal users will be used for backup and restore. For Backup and Restore, elasticsearch curator is used.
D:\RPA\AssistEdgeAutomation\scripts> |
NOTE: |
For backward compatibility, ae elastic is still supported in all ae txnstore commands, for example: ae txnstore <Component Name> is executed as ae elastic <Component Name>. |
LISTROLES
The listroles command displays a list of all available TxnStore roles.
Syntax Defined
Syntax: ae txnstore listroles
Alias Defined
Alias: ae opensearch listroles
Sample Output
D:\RPA\AssistEdgeAutomation\scripts>ae txnstore listroles
D:\RPA\AssistEdgeAutomation\scripts> |
LISTUSERS
The listusers command displays the list of local TxnStore users and their roles.
Syntax Defined
Syntax: ae txnstore listusers
Alias Defined
Alias: ae opensearch listusers
Sample Output
D:\RPA\AssistEdgeAutomation\scripts>ae txnstore listusers
User Role
D:\RPA\AssistEdgeAutomation\scripts> |
CREATEUSER
The createuser command creates a local TxnStore user. You must assign a role to this local user during creation.
Syntax Defined
Syntax: ae txnstore createuser
Alias Defined
Alias: ae opensearch createuser
Sample Output
D:\RPA\AssistEdgeAutomation\scripts>ae txnstore createuser
|
Enter details related to the user as mentioned below:
- Please provide username: Provide the name of the user you want to create in the repository and then press <Enter>8.
- Do you want to create it as a backup/snapshot user? (Y/N): If you want the user to be able to take backups/snapshots, enter Y; otherwise, enter N to provide the desired role and then press <Enter>8 .
- Enter password (HIDDEN): Provide the password for the user and then press <Enter>8 .
- Enter role name: Provide the role that you want to assign to the user and then press <Enter>8 .
NOTE: |
There must be at least one user with snapshot_user role if you need to take TxnStore backup. |
DELETEUSER
The deleteuser command is used to delete a local TxnStore user.
Syntax Defined
Syntax: ae txnstore deleteuser
Alias Defined
Alias: ae opensearch deleteuser
Sample Output
D:\RPA\AssistEdgeAutomation\scripts>ae txnstore deleteuser
|
LISTREPO
The listrepo command displays the names and locations of all repositories created in TxnStore.
Syntax Defined
Syntax: ae txnstore listrepo
Alias Defined
Alias: ae opensearch listrepo
Sample Output
D:\RPA\AssistEdgeAutomation\scripts>ae txnstore listrepo
D:\RPA\AssistEdgeAutomation\scripts> |
CREATEREPO
The createrepo command is used to create a repository for TxnStore. This repository is used to backup and restore the TxnStore indices.
Prerequisites
Before running the createrepo command, follow these steps:
- Stop all the AE components.
- Create a new folder in the desired directory. For example - <Installation Directory>\AssistEdgeAutomation\data\Repo. Copy the path of new folder.
- Open the ae.properties file in the <Installation Directory>\AssistEdgeAutomation\scripts folder and paste the folder path in TXNSTORE_REPO_PATH= line and save it. In case there are multiple repositories, the comma separated path can be provided.
- Restart all the AE components.
- In a cluster setup:
- Network shared location should be used for creating the repository, for more information see Network Drive Commands.
- ae.properties must be updated on all machines.
- CREATEREPO command need to be executed only on one server.
NOTE: |
Two repositories should not point to the same path. |
Syntax Defined
Syntax: ae txnstore createrepo
Alias Defined
Alias: ae opensearch createrepo
Sample Output
D:\RPA\AssistEdgeAutomation\scripts>ae txnstore createrepo |
Enter details related to the repository as mentioned below:
- Please provide repository name: Provide the name of repository that you want to create in TxnStore and then press <Enter>8 .
- Please provide repository path: Provide the repository path added in the ae.properties file and then press <Enter>8 .
DELETEREPO
The deleterepo command is used to permanently delete a repository from
TxnStore.
Syntax Defined
Syntax: ae txnstore deleterepo
Alias Defined
Alias: ae opensearch deleterepo
Sample Output
D:\RPA\AssistEdgeAutomation\scripts>ae txnstore deleterepo |
BACKUP
The backup command is used to take backup of TxnStore index/indices in an TxnStore repository.
Prerequisites
- Make sure to create an TxnStore repository and add a user in TxnStore.
- Ensure TxnStore is running before running the backup command.
Syntax Defined
Syntax: ae txnstore backup
Alias Defined
Alias: ae opensearch backup
Sample Output
D:\RPA\AssistEdgeAutomation\scripts>ae txnstore backup |
Enter details related to the repository as mentioned below:
- Please provide repository name: Provide the repository name created in the TxnStore and then press <Enter>8 .
- Please provide index name: Provide the index name for which you want to take backup, enter * to backup all indices and then press <Enter>8 .
- Please provide Txnstore username: Provide the name of a local TxnStore user and has access to create TxnStore snapshot (snapshot_user role access) and then press <Enter>8 .
- Please provide Txnstore password (HIDDEN): Provide the password of the user and then press <Enter>8 .
RESTORE
The restore command is used to restore TxnStore data from backup.
Prerequisites
- Make sure you already have an TxnStore backup in a repository.
- Ensure TXNSTORE is running before running the restore command.
Syntax Defined
Syntax: ae txnstore restore
Alias Defined
Alias: ae opensearch restore
Sample Output
D:\RPA\AssistEdgeAutomation\scripts>ae txnstore restore |
Enter details related to the repository as mentioned below:
- Please provide repository name: Provide the repository name created in the TxnStore where the backup of index/indices are already present and then press <Enter>8 .
- Please provide index name: Provide the index name for which you want to take restore TxnStore data, enter * to restore all indices present in the backup and then press <Enter>8 .
- Please provide Txnstore username: Provide the name of a user who exists in the TxnStore repository and then press <Enter>8 .
- Please provide Txnstore password (HIDDEN): Provide the password of the user and then press <Enter>8 .
ACTION
The action command can be used if the user wants to perform additional operations on the opensearch data apart from the existing operations provided by AE. The actions that can be performed using the action command can be found at https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html.
Prerequisites
- Create a custom .yml file.
- Make sure to create an TxnStore repository and add a user in TxnStore.
- Ensure TxnStore is running before running the backup command.
Syntax Defined
Syntax: ae txnstore action <location of action file>
Alias Defined
Alias: ae opensearch action <location of action file>
Sample Output
Following is an example of how to create the index by using an action file command:
D:\RPA\AssistEdgeAutomation\scripts>ae txnstore “ \AssistEdgeAutomation\ runtime\opensearch\plugins\curator-5.8.4\createindex.yml” |
Enter details related to the repository as mentioned below:
- Please provide Txnstore username: Provide the name of a user who exists in the TxnStore repository and then press <Enter>8 .
- Please provide Txnstore password (HIDDEN): Provide the password of the user and then press <Enter>8 .
HEAD
The head command is used for debugging TxnStore. After running this command, a URL is generated; you can use this URL in a browser, along with local user details, to start the ElasticSearch head plugin for debugging.
Syntax Defined
Syntax: txnstore <Head> <port>
Alias Defined
Alias: ae opensearch <Head> <port>
Sample Output
You must provide a port number that is not in use.
D:\RPA\AssistEdgeAutomation\scripts>ae txnstore head 8503 |