ARTEMIS-3486: update docs around data tools commands, note use of broker instance and refresh shown output

This commit is contained in:
Robbie Gemmell 2021-09-16 18:53:46 +01:00 committed by Justin Bertram
parent 0f23e29f01
commit 8451f50b57
2 changed files with 218 additions and 128 deletions

View File

@ -177,13 +177,13 @@ public class Artemis {
.withDescription("activation tools group (sync) (example ./artemis activation list)") .withDescription("activation tools group (sync) (example ./artemis activation list)")
.withDefaultCommand(ActivationSequenceList.class) .withDefaultCommand(ActivationSequenceList.class)
.withCommands(ActivationSequenceList.class, ActivationSequenceSet.class); .withCommands(ActivationSequenceList.class, ActivationSequenceSet.class);
builder.withGroup("data").withDescription("data tools group (print|imp|exp|encode|decode|compact) (example ./artemis data print)"). builder.withGroup("data").withDescription("data tools group (print|imp|exp|encode|decode|compact|recover) (example ./artemis data print)").
withDefaultCommand(HelpData.class).withCommands(RecoverMessages.class, PrintData.class, XmlDataExporter.class, XmlDataImporter.class, DecodeJournal.class, EncodeJournal.class, CompactJournal.class); withDefaultCommand(HelpData.class).withCommands(RecoverMessages.class, PrintData.class, XmlDataExporter.class, XmlDataImporter.class, DecodeJournal.class, EncodeJournal.class, CompactJournal.class);
builder.withGroup("user").withDescription("default file-based user management (add|rm|list|reset) (example ./artemis user list)"). builder.withGroup("user").withDescription("default file-based user management (add|rm|list|reset) (example ./artemis user list)").
withDefaultCommand(HelpUser.class).withCommands(ListUser.class, AddUser.class, RemoveUser.class, ResetUser.class); withDefaultCommand(HelpUser.class).withCommands(ListUser.class, AddUser.class, RemoveUser.class, ResetUser.class);
builder = builder.withCommands(Run.class, Stop.class, Kill.class, PerfJournal.class); builder = builder.withCommands(Run.class, Stop.class, Kill.class, PerfJournal.class);
} else { } else {
builder.withGroup("data").withDescription("data tools group (print) (example ./artemis data print)"). builder.withGroup("data").withDescription("data tools group (print|recover) (example ./artemis data print)").
withDefaultCommand(HelpData.class).withCommands(RecoverMessages.class, PrintData.class); withDefaultCommand(HelpData.class).withCommands(RecoverMessages.class, PrintData.class);
builder = builder.withCommand(Create.class); builder = builder.withCommand(Create.class);
} }

View File

@ -2,18 +2,21 @@
You can use the Artemis CLI to execute data maintenance tools: You can use the Artemis CLI to execute data maintenance tools:
This is a list of sub-commands available The following sub-commands are available when running the CLI data
command from a particular broker instance that has already been
installed using the create command:
Name | Description Name | Description
---|--- ---|---
print | Prints a report about journal records of a non-running server
exp | Export the message data using a special and independent XML format exp | Export the message data using a special and independent XML format
imp | Imports the journal to a running broker using the output from expt imp | Imports the journal to a running broker using the output from expt
data | Prints a report about journal records and summary of existent records, as well a report on paging
recover | Revive data from the journal. It can be used in conjunction with historic journaling.
encode | shows an internal format of the journal encoded to String encode | shows an internal format of the journal encoded to String
decode | imports the internal journal format from encode decode | imports the internal journal format from encode
compact | Compacts the journal of a non running server
recover | Recover (undelete) messages from an existing journal and create a new one.
You can use the help at the tool for more information on how to execute each of the tools. For example: You can use the CLI help for more information on how to execute each of the tools. For example:
``` ```
$ ./artemis help data print $ ./artemis help data print
@ -28,9 +31,11 @@ SYNOPSIS
[--jdbc-driver-class-name <jdbcClassName>] [--jdbc-driver-class-name <jdbcClassName>]
[--jdbc-large-message-table-name <jdbcLargeMessages>] [--jdbc-large-message-table-name <jdbcLargeMessages>]
[--jdbc-message-table-name <jdbcMessages>] [--jdbc-message-table-name <jdbcMessages>]
[--jdbc-node-manager-table-name <jdbcNodeManager>]
[--jdbc-page-store-table-name <jdbcPageStore>] [--journal <journal>] [--jdbc-page-store-table-name <jdbcPageStore>] [--journal <journal>]
[--large-messages <largeMessges>] [--output <output>] [--large-messages <largeMessges>] [--output <output>]
[--paging <paging>] [--safe] [--verbose] [--] [<configuration>] [--paging <paging>] [--reclaimed] [--safe] [--verbose] [--]
[<configuration>]
OPTIONS OPTIONS
--bindings <binding> --bindings <binding>
@ -63,8 +68,11 @@ OPTIONS
--jdbc-message-table-name <jdbcMessages> --jdbc-message-table-name <jdbcMessages>
Name of the jdbc messages table Name of the jdbc messages table
--jdbc-node-manager-table-name <jdbcNodeManager>
Name of the jdbc node manager table
--jdbc-page-store-table-name <jdbcPageStore> --jdbc-page-store-table-name <jdbcPageStore>
Name of the page sotre messages table Name of the page store messages table
--journal <journal> --journal <journal>
The folder used for messages journal (default from broker.xml) The folder used for messages journal (default from broker.xml)
@ -78,6 +86,10 @@ OPTIONS
--paging <paging> --paging <paging>
The folder used for paging (default from broker.xml) The folder used for paging (default from broker.xml)
--reclaimed
This option will try to print as many records as possible from
reclaimed files
--safe --safe
It will print your data structure without showing your data It will print your data structure without showing your data
@ -100,250 +112,328 @@ For a full list of data tools commands available use:
``` ```
$ ./artemis help data $ ./artemis help data
NAME NAME
artemis data - data tools group (print|imp|exp|encode|decode|compact) artemis data - data tools group
(example ./artemis data print) (print|imp|exp|encode|decode|compact|recover) (example ./artemis data
print)
SYNOPSIS SYNOPSIS
artemis data artemis data
artemis data compact [--verbose] [--paging <paging>] artemis data compact [--journal <journal>]
[--journal <journal>] [--large-messages <largeMessges>] [--large-messages <largeMessges>] [--paging <paging>]
[--broker <brokerConfig>] [--bindings <binding>] [--broker <brokerConfig>] [--bindings <binding>] [--verbose]
artemis data decode [--verbose] [--suffix <suffix>] [--paging <paging>] artemis data decode [--journal <journal>]
[--prefix <prefix>] [--file-size <size>] --input <input> [--large-messages <largeMessges>] [--file-size <size>]
[--journal <journal>] [--directory <directory>] [--paging <paging>] [--prefix <prefix>] [--suffix <suffix>]
[--large-messages <largeMessges>] [--broker <brokerConfig>] [--broker <brokerConfig>] [--directory <directory>]
[--bindings <binding>] [--bindings <binding>] [--verbose] --input <input>
artemis data encode [--verbose] [--directory <directory>] artemis data encode [--journal <journal>]
[--suffix <suffix>] [--paging <paging>] [--prefix <prefix>] [--large-messages <largeMessges>] [--file-size <size>]
[--file-size <size>] [--journal <journal>] [--paging <paging>] [--prefix <prefix>] [--suffix <suffix>]
[--large-messages <largeMessges>] [--broker <brokerConfig>] [--broker <brokerConfig>] [--bindings <binding>] [--verbose]
[--bindings <binding>] [--directory <directory>]
artemis data exp [--jdbc-bindings-table-name <jdbcBindings>] artemis data exp [--jdbc-driver-class-name <jdbcClassName>]
[--jdbc-message-table-name <jdbcMessages>] [--paging <paging>] [--journal <journal>] [--jdbc-connection-url <jdbcURL>]
[--jdbc-connection-url <jdbcURL>] [--large-messages <largeMessges>]
[--jdbc-large-message-table-name <jdbcLargeMessages>] [--f] [--jdbc-bindings-table-name <jdbcBindings>] [--paging <paging>] [--f]
[--large-messages <largeMessges>] [--broker <brokerConfig>] [--jdbc-large-message-table-name <jdbcLargeMessages>]
[--jdbc-page-store-table-name <jdbcPageStore>] [--broker <brokerConfig>] [--jdbc-page-store-table-name <jdbcPageStore>]
[--jdbc-driver-class-name <jdbcClassName>] [--jdbc] [--verbose] [--bindings <binding>] [--jdbc] [--verbose]
[--journal <journal>] [--output <output>] [--bindings <binding>] [--jdbc-message-table-name <jdbcMessages>]
artemis data imp [--user <user>] [--legacy-prefixes] [--verbose] [--jdbc-node-manager-table-name <jdbcNodeManager>] [--output <output>]
[--host <host>] [--port <port>] [--transaction] --input <input> artemis data imp [--legacy-prefixes] [--password <password>]
[--password <password>] [--sort] [--transaction] [--verbose] [--port <port>] [--user <user>] [--sort]
artemis data print [--jdbc-bindings-table-name <jdbcBindings>] --input <input> [--host <host>]
[--jdbc-message-table-name <jdbcMessages>] [--paging <paging>] artemis data print [--reclaimed]
[--jdbc-connection-url <jdbcURL>] [--jdbc-driver-class-name <jdbcClassName>] [--journal <journal>]
[--jdbc-large-message-table-name <jdbcLargeMessages>] [--f] [--jdbc-connection-url <jdbcURL>] [--large-messages <largeMessges>]
[--large-messages <largeMessges>] [--broker <brokerConfig>] [--jdbc-bindings-table-name <jdbcBindings>] [--paging <paging>] [--f]
[--jdbc-page-store-table-name <jdbcPageStore>] [--jdbc-large-message-table-name <jdbcLargeMessages>] [--safe]
[--jdbc-driver-class-name <jdbcClassName>] [--safe] [--jdbc] [--verbose] [--broker <brokerConfig>] [--jdbc-page-store-table-name <jdbcPageStore>]
[--journal <journal>] [--output <output>] [--bindings <binding>] [--bindings <binding>] [--jdbc] [--verbose]
[--jdbc-message-table-name <jdbcMessages>]
[--jdbc-node-manager-table-name <jdbcNodeManager>] [--output <output>]
artemis data recover [--jdbc-driver-class-name <jdbcClassName>]
[--journal <journal>] [--jdbc-connection-url <jdbcURL>]
[--large-messages <largeMessges>] [--reclaimed] --target <outputJournal>
[--jdbc-bindings-table-name <jdbcBindings>] [--paging <paging>] [--f]
[--jdbc-large-message-table-name <jdbcLargeMessages>]
[--broker <brokerConfig>] [--jdbc-page-store-table-name <jdbcPageStore>]
[--bindings <binding>] [--jdbc] [--verbose]
[--jdbc-message-table-name <jdbcMessages>]
[--jdbc-node-manager-table-name <jdbcNodeManager>] [--output <output>]
COMMANDS COMMANDS
With no arguments, Display help information With no arguments, Display help information
recover
Recover (undelete) every message on the journal by creating a new
output journal. Rolled backed and acked messages will be sent out to
the output as much as possible.
With --jdbc-driver-class-name option, JDBC driver classname
With --journal option, The folder used for messages journal (default
from broker.xml)
With --jdbc-connection-url option, The connection used for the
database
With --large-messages option, The folder used for large-messages
(default from broker.xml)
With --reclaimed option, This option will try to recover as many
records as possible from reclaimed files
With --target option, Output folder container the new journal with
all the generated messages
With --jdbc-bindings-table-name option, Name of the jdbc bindigns
table
With --paging option, The folder used for paging (default from
broker.xml)
With --f option, This will allow certain tools like print-data to be
performed ignoring any running servers. WARNING: Changing data
concurrently with a running broker may damage your data. Be careful
with this option.
With --jdbc-large-message-table-name option, Name of the large
messages table
With --broker option, This would override the broker configuration
from the bootstrap
With --jdbc-page-store-table-name option, Name of the page store
messages table
With --bindings option, The folder used for bindings (default from
broker.xml)
With --jdbc option, It will activate jdbc
With --verbose option, Adds more information on the execution
With --jdbc-message-table-name option, Name of the jdbc messages
table
With --jdbc-node-manager-table-name option, Name of the jdbc node
manager table
With --output option, Output name for the file
print print
Print data records information (WARNING: don't use while a Print data records information (WARNING: don't use while a
production server is running) production server is running)
With --jdbc-bindings-table-name option, Name of the jdbc bindigns With --reclaimed option, This option will try to print as many
table records as possible from reclaimed files
With --jdbc-message-table-name option, Name of the jdbc messages With --jdbc-driver-class-name option, JDBC driver classname
table
With --paging option, The folder used for paging (default from With --journal option, The folder used for messages journal (default
broker.xml) from broker.xml)
With --jdbc-connection-url option, The connection used for the With --jdbc-connection-url option, The connection used for the
database database
With --jdbc-large-message-table-name option, Name of the large With --large-messages option, The folder used for large-messages
messages table (default from broker.xml)
With --jdbc-bindings-table-name option, Name of the jdbc bindigns
table
With --paging option, The folder used for paging (default from
broker.xml)
With --f option, This will allow certain tools like print-data to be With --f option, This will allow certain tools like print-data to be
performed ignoring any running servers. WARNING: Changing data performed ignoring any running servers. WARNING: Changing data
concurrently with a running broker may damage your data. Be careful concurrently with a running broker may damage your data. Be careful
with this option. with this option.
With --large-messages option, The folder used for large-messages With --jdbc-large-message-table-name option, Name of the large
(default from broker.xml) messages table
With --safe option, It will print your data structure without
showing your data
With --broker option, This would override the broker configuration With --broker option, This would override the broker configuration
from the bootstrap from the bootstrap
With --jdbc-page-store-table-name option, Name of the page sotre With --jdbc-page-store-table-name option, Name of the page store
messages table messages table
With --jdbc-driver-class-name option, JDBC driver classname With --bindings option, The folder used for bindings (default from
broker.xml)
With --safe option, It will print your data structure without
showing your data
With --jdbc option, It will activate jdbc With --jdbc option, It will activate jdbc
With --verbose option, Adds more information on the execution With --verbose option, Adds more information on the execution
With --journal option, The folder used for messages journal (default With --jdbc-message-table-name option, Name of the jdbc messages
from broker.xml) table
With --jdbc-node-manager-table-name option, Name of the jdbc node
manager table
With --output option, Output name for the file With --output option, Output name for the file
With --bindings option, The folder used for bindings (default from
broker.xml)
exp exp
Export all message-data using an XML that could be interpreted by Export all message-data using an XML that could be interpreted by
any system. any system.
With --jdbc-bindings-table-name option, Name of the jdbc bindigns With --jdbc-driver-class-name option, JDBC driver classname
table
With --jdbc-message-table-name option, Name of the jdbc messages With --journal option, The folder used for messages journal (default
table from broker.xml)
With --paging option, The folder used for paging (default from
broker.xml)
With --jdbc-connection-url option, The connection used for the With --jdbc-connection-url option, The connection used for the
database database
With --jdbc-large-message-table-name option, Name of the large With --large-messages option, The folder used for large-messages
messages table (default from broker.xml)
With --jdbc-bindings-table-name option, Name of the jdbc bindigns
table
With --paging option, The folder used for paging (default from
broker.xml)
With --f option, This will allow certain tools like print-data to be With --f option, This will allow certain tools like print-data to be
performed ignoring any running servers. WARNING: Changing data performed ignoring any running servers. WARNING: Changing data
concurrently with a running broker may damage your data. Be careful concurrently with a running broker may damage your data. Be careful
with this option. with this option.
With --large-messages option, The folder used for large-messages With --jdbc-large-message-table-name option, Name of the large
(default from broker.xml) messages table
With --broker option, This would override the broker configuration With --broker option, This would override the broker configuration
from the bootstrap from the bootstrap
With --jdbc-page-store-table-name option, Name of the page sotre With --jdbc-page-store-table-name option, Name of the page store
messages table messages table
With --jdbc-driver-class-name option, JDBC driver classname With --bindings option, The folder used for bindings (default from
broker.xml)
With --jdbc option, It will activate jdbc With --jdbc option, It will activate jdbc
With --verbose option, Adds more information on the execution With --verbose option, Adds more information on the execution
With --journal option, The folder used for messages journal (default With --jdbc-message-table-name option, Name of the jdbc messages
from broker.xml) table
With --jdbc-node-manager-table-name option, Name of the jdbc node
manager table
With --output option, Output name for the file With --output option, Output name for the file
With --bindings option, The folder used for bindings (default from
broker.xml)
imp imp
Import all message-data using an XML that could be interpreted by Import all message-data using an XML that could be interpreted by
any system. any system.
With --user option, User name used to import the data. (default
null)
With --legacy-prefixes option, Do not remove prefixes from legacy With --legacy-prefixes option, Do not remove prefixes from legacy
imports imports
With --verbose option, Adds more information on the execution With --password option, User name used to import the data. (default
null)
With --host option, The host used to import the data (default
localhost)
With --port option, The port used to import the data (default 61616)
With --transaction option, If this is set to true you will need a With --transaction option, If this is set to true you will need a
whole transaction to commit at the end. (default false) whole transaction to commit at the end. (default false)
With --input option, The input file name (default=exp.dmp) With --verbose option, Adds more information on the execution
With --password option, User name used to import the data. (default With --port option, The port used to import the data (default 61616)
With --user option, User name used to import the data. (default
null) null)
With --sort option, Sort the messages from the input (used for older With --sort option, Sort the messages from the input (used for older
versions that won't sort messages) versions that won't sort messages)
With --input option, The input file name (default=exp.dmp)
With --host option, The host used to import the data (default
localhost)
decode decode
Decode a journal's internal format into a new journal set of files Decode a journal's internal format into a new journal set of files
With --verbose option, Adds more information on the execution With --journal option, The folder used for messages journal (default
from broker.xml)
With --suffix option, The journal suffix (default amq) With --large-messages option, The folder used for large-messages
(default from broker.xml)
With --file-size option, The journal size (default 10485760)
With --paging option, The folder used for paging (default from With --paging option, The folder used for paging (default from
broker.xml) broker.xml)
With --prefix option, The journal prefix (default activemq-data) With --prefix option, The journal prefix (default activemq-data)
With --file-size option, The journal size (default 10485760) With --suffix option, The journal suffix (default amq)
With --input option, The input file name (default=exp.dmp) With --broker option, This would override the broker configuration
from the bootstrap
With --journal option, The folder used for messages journal (default
from broker.xml)
With --directory option, The journal folder (default journal folder With --directory option, The journal folder (default journal folder
from broker.xml) from broker.xml)
With --bindings option, The folder used for bindings (default from
broker.xml)
With --verbose option, Adds more information on the execution
With --input option, The input file name (default=exp.dmp)
encode
Encode a set of journal files into an internal encoded data format
With --journal option, The folder used for messages journal (default
from broker.xml)
With --large-messages option, The folder used for large-messages With --large-messages option, The folder used for large-messages
(default from broker.xml) (default from broker.xml)
With --file-size option, The journal size (default 10485760)
With --paging option, The folder used for paging (default from
broker.xml)
With --prefix option, The journal prefix (default activemq-data)
With --suffix option, The journal suffix (default amq)
With --broker option, This would override the broker configuration With --broker option, This would override the broker configuration
from the bootstrap from the bootstrap
With --bindings option, The folder used for bindings (default from With --bindings option, The folder used for bindings (default from
broker.xml) broker.xml)
encode
Encode a set of journal files into an internal encoded data format
With --verbose option, Adds more information on the execution With --verbose option, Adds more information on the execution
With --directory option, The journal folder (default the journal With --directory option, The journal folder (default the journal
folder from broker.xml) folder from broker.xml)
With --suffix option, The journal suffix (default amq)
With --paging option, The folder used for paging (default from
broker.xml)
With --prefix option, The journal prefix (default activemq-data)
With --file-size option, The journal size (default 10485760)
With --journal option, The folder used for messages journal (default
from broker.xml)
With --large-messages option, The folder used for large-messages
(default from broker.xml)
With --broker option, This would override the broker configuration
from the bootstrap
With --bindings option, The folder used for bindings (default from
broker.xml)
compact compact
Compacts the journal of a non running server Compacts the journal of a non running server
With --verbose option, Adds more information on the execution
With --paging option, The folder used for paging (default from
broker.xml)
With --journal option, The folder used for messages journal (default With --journal option, The folder used for messages journal (default
from broker.xml) from broker.xml)
With --large-messages option, The folder used for large-messages With --large-messages option, The folder used for large-messages
(default from broker.xml) (default from broker.xml)
With --paging option, The folder used for paging (default from
broker.xml)
With --broker option, This would override the broker configuration With --broker option, This would override the broker configuration
from the bootstrap from the bootstrap
With --bindings option, The folder used for bindings (default from With --bindings option, The folder used for bindings (default from
broker.xml) broker.xml)
With --verbose option, Adds more information on the execution
``` ```