Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reformat elasticsearch-node messages #39811

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ public class DetachClusterCommand extends ElasticsearchNodeCommand {

static final String NODE_DETACHED_MSG = "Node was successfully detached from the cluster";
static final String CONFIRMATION_MSG =
"-------------------------------------------------------------------------------\n" +
"\n" +
"You should run this tool only if you have permanently lost all\n" +
"your master-eligible nodes, and you cannot restore the cluster\n" +
"from a snapshot, or you have already run `elasticsearch-node unsafe-bootstrap`\n" +
"on a master-eligible node that formed a cluster with this node.\n" +
"This tool can cause arbitrary data loss and its use should be your last resort.\n" +
"Do you want to proceed?\n";
DELIMITER +
"\n" +
"You should only run this tool if you have permanently lost all of the\n" +
"master-eligible nodes in this cluster and you cannot restore the cluster\n" +
"from a snapshot, or you have already unsafely bootstrapped a new cluster\n" +
"by running `elasticsearch-node unsafe-bootstrap` on a master-eligible\n" +
"node that belonged to the same cluster as this node. This tool can cause\n" +
"arbitrary data loss and its use should be your last resort.\n" +
"\n" +
"Do you want to proceed?\n";

public DetachClusterCommand() {
super("Detaches this node from its cluster, allowing it to unsafely join a new cluster");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@
public abstract class ElasticsearchNodeCommand extends EnvironmentAwareCommand {
private static final Logger logger = LogManager.getLogger(ElasticsearchNodeCommand.class);
protected final NamedXContentRegistry namedXContentRegistry;
static final String DELIMITER = "------------------------------------------------------------------------\n";

static final String STOP_WARNING_MSG =
"--------------------------------------------------------------------------\n" +
DELIMITER +
"\n" +
" WARNING: Elasticsearch MUST be stopped before running this tool." +
"\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,17 @@ public class UnsafeBootstrapMasterCommand extends ElasticsearchNodeCommand {
static final String CLUSTER_STATE_TERM_VERSION_MSG_FORMAT =
"Current node cluster state (term, version) pair is (%s, %s)";
static final String CONFIRMATION_MSG =
"--------------------------------------------------------------------------\n" +
DELIMITER +
"\n" +
"You should only run this tool if you have permanently lost half or more\n" +
"of the master-eligible nodes in this cluster, and you cannot restore the\n" +
"cluster from a snapshot. This tool can cause arbitrary data loss and its\n" +
"use should be your last resort. If you have multiple surviving master\n" +
"eligible nodes, you should run this tool on the node with the highest\n" +
"cluster state (term, version) pair.\n" +
"\n" +
"You should run this tool only if you have permanently lost half\n" +
"or more of the master-eligible nodes, and you cannot restore the cluster\n" +
"from a snapshot. This tool can cause arbitrary data loss and its use " +
"should be your last resort.\n" +
"If you have multiple survived master eligible nodes, consider running\n" +
"this tool on the node with the highest cluster state (term, version) pair.\n" +
"Do you want to proceed?\n";

static final String NOT_MASTER_NODE_MSG = "unsafe-bootstrap tool can only be run on master eligible node";

static final String NO_NODE_METADATA_FOUND_MSG = "no node meta data is found, node has not been started yet?";
Expand Down