From 211ff985f92f4a8308a8f6064815e6a2d19376c6 Mon Sep 17 00:00:00 2001 From: releng Date: Wed, 9 Oct 2024 17:28:12 -0400 Subject: [PATCH] Sync from server repo (92191f1ad71) --- commands/cmd_add_node.go | 6 ++++-- commands/cmd_add_subcluster.go | 14 +++++++++----- commands/cmd_config_recover.go | 4 ++-- commands/cmd_create_archive.go | 4 ++-- commands/cmd_create_db.go | 5 +++-- commands/cmd_get_draining_status.go | 9 ++++++--- commands/cmd_install_packages.go | 6 ++++-- commands/cmd_list_all_nodes.go | 4 ++-- commands/cmd_re_ip.go | 6 ++++-- commands/cmd_remove_node.go | 6 ++++-- commands/cmd_remove_subcluster.go | 6 ++++-- commands/cmd_restart_node.go | 6 +++--- commands/cmd_revive_db.go | 9 ++++++--- commands/cmd_sandbox.go | 4 +++- commands/cmd_save_restore_point.go | 6 ++++-- commands/cmd_show_restore_points.go | 2 +- commands/cmd_start_db.go | 11 ++++++++--- commands/cmd_start_replication.go | 11 +++++++---- commands/cmd_start_subcluster.go | 6 ++++-- commands/cmd_stop_db.go | 2 +- commands/cmd_stop_node.go | 6 ++++-- commands/cmd_unsandbox.go | 6 ++++-- 22 files changed, 89 insertions(+), 50 deletions(-) diff --git a/commands/cmd_add_node.go b/commands/cmd_add_node.go index 4f9636d..3068bb0 100644 --- a/commands/cmd_add_node.go +++ b/commands/cmd_add_node.go @@ -53,12 +53,14 @@ func makeCmdAddNode() *cobra.Command { Examples: # Add a single host to the existing database with config file vcluster add_node --db-name test_db --new-hosts 10.20.30.43 \ - --config /opt/vertica/config/vertica_cluster.yaml + --config /opt/vertica/config/vertica_cluster.yaml \ + --password "PASSWORD" # Add multiple hosts to the existing database with user input vcluster add_node --db-name test_db --new-hosts 10.20.30.43,10.20.30.44 \ --data-path /data --hosts 10.20.30.40 \ - --node-names v_test_db_node0001,v_test_db_node0002 + --node-names v_test_db_node0001,v_test_db_node0002 \ + --password "PASSWORD" `, []string{dbNameFlag, configFlag, hostsFlag, ipv6Flag, dataPathFlag, depotPathFlag, passwordFlag}, diff --git a/commands/cmd_add_subcluster.go b/commands/cmd_add_subcluster.go index bd5be3a..b912ccc 100644 --- a/commands/cmd_add_subcluster.go +++ b/commands/cmd_add_subcluster.go @@ -53,22 +53,26 @@ Examples: # Add a subcluster with config file vcluster add_subcluster --subcluster sc1 \ --config /opt/vertica/config/vertica_cluster.yaml \ - --is-primary --control-set-size 1 + --is-primary --control-set-size 1 \ + --password "PASSWORD" # Add a subcluster with user input vcluster add_subcluster --subcluster sc1 --db-name test_db \ --hosts 10.20.30.40,10.20.30.41,10.20.30.42 \ - --is-primary --control-set-size -1 + --is-primary --control-set-size -1 \ + --password "PASSWORD" # Add a subcluster and new nodes in the subcluster with config file vcluster add_subcluster --subcluster sc1 \ --config /opt/vertica/config/vertica_cluster.yaml \ - --is-primary --control-set-size 1 --new-hosts 10.20.30.43 + --is-primary --control-set-size 1 --new-hosts 10.20.30.43 \ + --password "PASSWORD" # Add a subcluster new nodes in the subcluster with user input vcluster add_subcluster --subcluster sc1 --db-name test_db \ - --hosts 10.20.30.40,10.20.30.41,10.20.30.42 \ - --is-primary --control-set-size -1 --new-hosts 10.20.30.43 + --hosts 10.20.30.40,10.20.30.41,10.20.30.42 \ + --is-primary --control-set-size -1 --new-hosts 10.20.30.43 \ + --password "PASSWORD" `, []string{dbNameFlag, configFlag, hostsFlag, ipv6Flag, eonModeFlag, passwordFlag, dataPathFlag, depotPathFlag}, diff --git a/commands/cmd_config_recover.go b/commands/cmd_config_recover.go index 47921b7..5f91480 100644 --- a/commands/cmd_config_recover.go +++ b/commands/cmd_config_recover.go @@ -52,13 +52,13 @@ Examples: # Recover the config file to the default location vcluster manage_config recover --db-name test_db \ --hosts 10.20.30.41,10.20.30.42,10.20.30.43 \ - --catalog-path /data --depot-path /data --password "" + --catalog-path /data --depot-path /data --password "PASSWORD" # Recover the config file to /tmp/vertica_cluster.yaml vcluster manage_config recover --db-name test_db \ --hosts 10.20.30.41,10.20.30.42,10.20.30.43 \ --catalog-path /data --depot-path /data \ - --config /tmp/vertica_cluster.yaml --password "" + --config /tmp/vertica_cluster.yaml --password "PASSWORD" `, []string{dbNameFlag, hostsFlag, catalogPathFlag, depotPathFlag, ipv6Flag, configFlag, passwordFlag}, ) diff --git a/commands/cmd_create_archive.go b/commands/cmd_create_archive.go index 6a08f29..2d5818d 100644 --- a/commands/cmd_create_archive.go +++ b/commands/cmd_create_archive.go @@ -48,11 +48,11 @@ func makeCmdCreateArchive() *cobra.Command { Examples: # Create an archive in a given archive name - vcluster create_archive --db-name DBNAME --archive-name ARCHIVE_ONE + vcluster create_archive --db-name DBNAME --archive-name ARCHIVE_ONE --password "PASSWORD" # Create an archive in a given archive name and number of restore point(default 3) vcluster create_archive --db-name DBNAME --archive-name ARCHIVE_ONE \ - --num-restore-points 6 + --num-restore-points 6 --password "PASSWORD" # Create an archive in main cluster with user input password vcluster create_archive --db-name DBNAME --archive-name ARCHIVE_ONE \ diff --git a/commands/cmd_create_db.go b/commands/cmd_create_db.go index a869996..ef84be9 100644 --- a/commands/cmd_create_db.go +++ b/commands/cmd_create_db.go @@ -52,7 +52,8 @@ Examples: --hosts 10.20.30.40,10.20.30.41,10.20.30.42 \ --catalog-path /data --data-path /data \ --config-param HttpServerConf=/opt/vertica/config/https_certs/httpstls.json \ - --config $HOME/custom/directory/vertica_cluster.yaml + --config $HOME/custom/directory/vertica_cluster.yaml \ + --password "PASSWORD" # Read the password from file vcluster create_db --db-name test_db \ @@ -76,7 +77,7 @@ Examples: vcluster create_db --db-name test_db \ --hosts 10.20.30.40,10.20.30.41,10.20.30.42 \ --catalog-path /data --data-path /data \ - --password 12345678 + --password "PASSWORD" `, []string{dbNameFlag, hostsFlag, catalogPathFlag, dataPathFlag, depotPathFlag, communalStorageLocationFlag, passwordFlag, configFlag, ipv6Flag, configParamFlag}, diff --git a/commands/cmd_get_draining_status.go b/commands/cmd_get_draining_status.go index 2db7426..eda973c 100644 --- a/commands/cmd_get_draining_status.go +++ b/commands/cmd_get_draining_status.go @@ -54,15 +54,18 @@ func makeCmdGetDrainingStatus() *cobra.Command { Examples: # Show draining status of all subclusters in main cluster with user input vcluster get_draining_status --db-name test_db \ - --hosts 10.20.30.40,10.20.30.41,10.20.30.42 + --hosts 10.20.30.40,10.20.30.41,10.20.30.42 \ + --password "PASSWORD" # Show draining status of all subclusters in main cluster with config file vcluster get_draining_status \ - --config /opt/vertica/config/vertica_cluster.yaml + --config /opt/vertica/config/vertica_cluster.yaml \ + --password "PASSWORD" # Show draining status of all subclusters in a sandbox with config file vcluster get_draining_status --sandbox sand1 \ - --config /opt/vertica/config/vertica_cluster.yaml + --config /opt/vertica/config/vertica_cluster.yaml \ + --password "PASSWORD" `, []string{dbNameFlag, configFlag, passwordFlag, hostsFlag, ipv6Flag, sandboxFlag, eonModeFlag, outputFileFlag}, diff --git a/commands/cmd_install_packages.go b/commands/cmd_install_packages.go index c822821..255192c 100644 --- a/commands/cmd_install_packages.go +++ b/commands/cmd_install_packages.go @@ -51,11 +51,13 @@ func makeCmdInstallPackages() *cobra.Command { Examples: # Install default packages with user input vcluster install_packages --db-name test_db \ - --hosts 10.20.30.40,10.20.30.41,10.20.30.42 + --hosts 10.20.30.40,10.20.30.41,10.20.30.42 \ + --password "PASSWORD" # Force (re)install default packages with config file vcluster install_packages --db-name test_db --force-reinstall \ - --config /opt/vertica/config/vertica_cluster.yaml + --config /opt/vertica/config/vertica_cluster.yaml \ + --password "PASSWORD" `, []string{dbNameFlag, configFlag, hostsFlag, ipv6Flag, passwordFlag, outputFileFlag}, ) diff --git a/commands/cmd_list_all_nodes.go b/commands/cmd_list_all_nodes.go index 5eae393..d0bfb23 100644 --- a/commands/cmd_list_all_nodes.go +++ b/commands/cmd_list_all_nodes.go @@ -59,8 +59,8 @@ Nodes separated by a sandbox have the state "UNKNOWN." Examples: # List the status of nodes with config file where password authentication is # used to access the database - vcluster list_all_nodes --password testpassword \ - --config /opt/vertica/config/vertica_cluster.yaml + vcluster list_all_nodes --password "PASSWORD" \ + --config /opt/vertica/config/vertica_cluster.yaml `, []string{dbNameFlag, hostsFlag, passwordFlag, ipv6Flag, catalogPathFlag, configFlag, outputFileFlag}, ) diff --git a/commands/cmd_re_ip.go b/commands/cmd_re_ip.go index ef9c5fe..d90b932 100644 --- a/commands/cmd_re_ip.go +++ b/commands/cmd_re_ip.go @@ -59,11 +59,13 @@ This file should only include the IP addresses of nodes that you want to update. Examples: # Alter the IP address of database nodes with user input vcluster re_ip --db-name test_db --hosts 10.20.30.40,10.20.30.41,10.20.30.42 \ - --catalog-path /data --re-ip-file /data/re_ip_map.json + --catalog-path /data --re-ip-file /data/re_ip_map.json \ + --password "PASSWORD" # Alter the IP address of database nodes with config file vcluster re_ip --db-name test_db --re-ip-file /data/re_ip_map.json \ - --config /opt/vertica/config/vertica_cluster.yaml + --config /opt/vertica/config/vertica_cluster.yaml \ + --password "PASSWORD" `, []string{dbNameFlag, hostsFlag, ipv6Flag, catalogPathFlag, configParamFlag, configFlag}, ) diff --git a/commands/cmd_remove_node.go b/commands/cmd_remove_node.go index 01372a6..0fbfecc 100644 --- a/commands/cmd_remove_node.go +++ b/commands/cmd_remove_node.go @@ -52,11 +52,13 @@ Examples: # Remove multiple nodes from the existing database with config file vcluster remove_node --db-name test_db \ --remove 10.20.30.40,10.20.30.42 \ - --config /opt/vertica/config/vertica_cluster.yaml + --config /opt/vertica/config/vertica_cluster.yaml \ + --password "PASSWORD" # Remove a single node from the existing database with user input vcluster remove_node --db-name test_db --remove 10.20.30.42 \ - --hosts 10.20.30.40 --data-path /data + --hosts 10.20.30.40 --data-path /data \ + --password "PASSWORD" `, []string{dbNameFlag, configFlag, hostsFlag, ipv6Flag, catalogPathFlag, dataPathFlag, depotPathFlag, passwordFlag}, ) diff --git a/commands/cmd_remove_subcluster.go b/commands/cmd_remove_subcluster.go index f8fb4ef..e79753d 100644 --- a/commands/cmd_remove_subcluster.go +++ b/commands/cmd_remove_subcluster.go @@ -47,12 +47,14 @@ func makeCmdRemoveSubcluster() *cobra.Command { Examples: # Remove a subcluster with config file vcluster remove_subcluster --subcluster sc1 \ - --config /opt/vertica/config/vertica_cluster.yaml + --config /opt/vertica/config/vertica_cluster.yaml \ + --password "PASSWORD" # Remove a subcluster with user input vcluster remove_subcluster --db-name test_db \ --hosts 10.20.30.40,10.20.30.41,10.20.30.42 --subcluster sc1 \ - --data-path /data --depot-path /data + --data-path /data --depot-path /data \ + --password "PASSWORD" `, []string{dbNameFlag, configFlag, hostsFlag, ipv6Flag, eonModeFlag, dataPathFlag, depotPathFlag, passwordFlag}, ) diff --git a/commands/cmd_restart_node.go b/commands/cmd_restart_node.go index 2b086e7..a83012e 100644 --- a/commands/cmd_restart_node.go +++ b/commands/cmd_restart_node.go @@ -56,20 +56,20 @@ One of --restart and --start-hosts is required. Examples: # Start a single node in the database with config file vcluster start_node --db-name test_db \ - --start v_test_db_node0004=10.20.30.43 --password testpassword \ + --start v_test_db_node0004=10.20.30.43 --password "PASSWORD" \ --config /opt/vertica/config/vertica_cluster.yaml # Start a single node and change its IP address in the database # with config file (assuming the node IP address previously stored # catalog was not 10.20.30.44) vcluster start_node --db-name test_db \ - --start v_test_db_node0004=10.20.30.44 --password testpassword \ + --start v_test_db_node0004=10.20.30.44 --password "PASSWORD" \ --config /opt/vertica/config/vertica_cluster.yaml # Start multiple nodes in the database with config file vcluster start_node --db-name test_db \ --start v_test_db_node0003=10.20.30.42,v_test_db_node0004=10.20.30.43 \ - --password testpassword --config /opt/vertica/config/vertica_cluster.yaml + --password "PASSWORD" --config /opt/vertica/config/vertica_cluster.yaml `, []string{dbNameFlag, hostsFlag, ipv6Flag, configFlag, passwordFlag}, ) diff --git a/commands/cmd_revive_db.go b/commands/cmd_revive_db.go index 6de8f21..dd944ba 100644 --- a/commands/cmd_revive_db.go +++ b/commands/cmd_revive_db.go @@ -53,18 +53,21 @@ Examples: vcluster revive_db --db-name test_db \ --hosts 10.20.30.40,10.20.30.41,10.20.30.42 \ --communal-storage-location /communal \ - --config /opt/vertica/config/vertica_cluster.yaml + --config /opt/vertica/config/vertica_cluster.yaml \ + --password "PASSWORD" # Describe the database only when reviving the database vcluster revive_db --db-name test_db --communal-storage-location /communal \ - --display-only + --display-only \ + --password "PASSWORD" # Revive a database with user input by restoring to a given restore point vcluster revive_db --db-name test_db \ --hosts 10.20.30.40,10.20.30.41,10.20.30.42 \ --communal-storage-location /communal \ --config /opt/vertica/config/vertica_cluster.yaml --force-removal \ - --ignore-cluster-lease --restore-point-archive db --restore-point-index 1 + --ignore-cluster-lease --restore-point-archive db --restore-point-index 1 \ + --password "PASSWORD" `, []string{dbNameFlag, hostsFlag, ipv6Flag, communalStorageLocationFlag, configFlag, outputFileFlag, configParamFlag}, diff --git a/commands/cmd_sandbox.go b/commands/cmd_sandbox.go index 64baa76..bd6bf5d 100644 --- a/commands/cmd_sandbox.go +++ b/commands/cmd_sandbox.go @@ -70,10 +70,12 @@ Examples: # Sandbox a subcluster with config file vcluster sandbox_subcluster --subcluster sc1 --sandbox sand \ --config /opt/vertica/config/vertica_cluster.yaml + --password "PASSWORD" # Sandbox a subcluster with user input vcluster sandbox_subcluster --subcluster sc1 --sandbox sand \ - --hosts 10.20.30.40,10.20.30.41,10.20.30.42 --db-name test_db + --hosts 10.20.30.40,10.20.30.41,10.20.30.42 --db-name test_db \ + --password "PASSWORD" `, []string{dbNameFlag, configFlag, hostsFlag, ipv6Flag, passwordFlag}, ) diff --git a/commands/cmd_save_restore_point.go b/commands/cmd_save_restore_point.go index c3c6fc7..be1d89c 100644 --- a/commands/cmd_save_restore_point.go +++ b/commands/cmd_save_restore_point.go @@ -49,11 +49,13 @@ func makeCmdSaveRestorePoint() *cobra.Command { Examples: # Save restore point in a given archive with user input vcluster save_restore_point --db-name test_db \ - --archive-name ARCHIVE_ONE + --archive-name ARCHIVE_ONE \ + --password "PASSWORD" # Save restore point for a sandbox vcluster save_restore_point --db-name test_db \ - --archive-name ARCHIVE_ONE --sandbox SANDBOX_ONE + --archive-name ARCHIVE_ONE --sandbox SANDBOX_ONE \ + --password "PASSWORD" `, []string{dbNameFlag, hostsFlag, passwordFlag, diff --git a/commands/cmd_show_restore_points.go b/commands/cmd_show_restore_points.go index c43d665..db623f0 100644 --- a/commands/cmd_show_restore_points.go +++ b/commands/cmd_show_restore_points.go @@ -56,7 +56,7 @@ Examples: # List restore points without filters with user input vcluster show_restore_points --db-name test_db \ --hosts 10.20.30.40,10.20.30.41,10.20.30.42 \ - --communal-storage-location /communal + --communal-storage-location /communal # List restore points without filters with config file vcluster show_restore_points --db-name test_db \ diff --git a/commands/cmd_start_db.go b/commands/cmd_start_db.go index 04f1482..00758a0 100644 --- a/commands/cmd_start_db.go +++ b/commands/cmd_start_db.go @@ -61,13 +61,18 @@ specified nodes are started, and the specified subset must be a quorum of nodes. Examples: # Start a database with config file using password authentication vcluster start_db --password testpassword \ - --config /opt/vertica/config/vertica_cluster.yaml + --config /opt/vertica/config/vertica_cluster.yaml \ + --password "PASSWORD" + # Start a database partially with config file on a sandbox vcluster start_db --password testpassword \ - --config /home/dbadmin/vertica_cluster.yaml --sandbox "sand" + --config /home/dbadmin/vertica_cluster.yaml --sandbox "sand" \ + --password "PASSWORD" + # Start a database partially with config file on a sandbox vcluster start_db --password testpassword \ - --config /home/dbadmin/vertica_cluster.yaml --main-cluster-only + --config /home/dbadmin/vertica_cluster.yaml --main-cluster-only \ + --password "PASSWORD" `, []string{dbNameFlag, hostsFlag, communalStorageLocationFlag, ipv6Flag, configFlag, catalogPathFlag, passwordFlag, eonModeFlag, configParamFlag}, diff --git a/commands/cmd_start_replication.go b/commands/cmd_start_replication.go index 421dea5..6f38d2b 100644 --- a/commands/cmd_start_replication.go +++ b/commands/cmd_start_replication.go @@ -54,22 +54,25 @@ if any one of the following conditions are met: Examples: # Start database replication with config and connection file vcluster replication start --config /opt/vertica/config/vertica_cluster.yaml \ - --target-conn /opt/vertica/config/target_connection.yaml + --target-conn /opt/vertica/config/target_connection.yaml \ + --password "PASSWORD" # Replicate data from a sandbox in the source database to a target database # specified in the connection file. vcluster replication start --config /opt/vertica/config/vertica_cluster.yaml \ - --target-conn /opt/vertica/config/target_connection.yaml --sandbox sand + --target-conn /opt/vertica/config/target_connection.yaml --sandbox sand \ + --password "PASSWORD" # Start database replication with user input and connection file vcluster replication start --db-name test_db --hosts 10.20.30.40 \ - --target-conn /opt/vertica/config/target_connection.yaml + --target-conn /opt/vertica/config/target_connection.yaml \ + --password "PASSWORD" # Start database replication with config and connection file # tls option and tls-based authentication vcluster replication start --config /opt/vertica/config/vertica_cluster.yaml \ --key-file /path/to/key-file --cert-file /path/to/cert-file \ - --target-conn /opt/vertica/config/target_connection.yaml --source-tlsconfig test_tlsconfig + --target-conn /opt/vertica/config/target_connection.yaml --source-tlsconfig test_tlsconfig # Start database replication with user input # option and password-based authentication diff --git a/commands/cmd_start_subcluster.go b/commands/cmd_start_subcluster.go index 3f2df93..a20c43c 100644 --- a/commands/cmd_start_subcluster.go +++ b/commands/cmd_start_subcluster.go @@ -48,11 +48,13 @@ func makeCmdStartSubcluster() *cobra.Command { Examples: # Start a subcluster with config file vcluster start_subcluster --subcluster sc1 \ - --config /opt/vertica/config/vertica_cluster.yaml + --config /opt/vertica/config/vertica_cluster.yaml \ + --password "PASSWORD" # Start a subcluster with user input vcluster start_subcluster --db-name test_db \ - --hosts 10.20.30.40,10.20.30.41,10.20.30.42 --subcluster sc1 + --hosts 10.20.30.40,10.20.30.41,10.20.30.42 --subcluster sc1 \ + --password "PASSWORD" `, []string{dbNameFlag, configFlag, hostsFlag, ipv6Flag, eonModeFlag, passwordFlag}, ) diff --git a/commands/cmd_stop_db.go b/commands/cmd_stop_db.go index 9a821bb..1c53361 100644 --- a/commands/cmd_stop_db.go +++ b/commands/cmd_stop_db.go @@ -52,7 +52,7 @@ func makeCmdStopDB() *cobra.Command { Examples: # Stop a database with config file using password authentication - vcluster stop_db --password testpassword \ + vcluster stop_db --password "PASSWORD" \ --config /opt/vertica/config/vertica_cluster.yaml `, []string{dbNameFlag, hostsFlag, ipv6Flag, eonModeFlag, configFlag, passwordFlag}, diff --git a/commands/cmd_stop_node.go b/commands/cmd_stop_node.go index 9443f42..bfd1d7e 100644 --- a/commands/cmd_stop_node.go +++ b/commands/cmd_stop_node.go @@ -51,11 +51,13 @@ nodes will be set to read-only mode to prevent data loss. Examples: # Gracefully stop a node with config file vcluster stop_node --stop-hosts 10.20.30.43 \ - --config /home/dbadmin/vertica_cluster.yaml + --config /home/dbadmin/vertica_cluster.yaml \ + --password "PASSWORD" # Gracefully stop nodes with user input vcluster stop_node --db-name test_db --stop-hosts 10.20.30.40,10.20.30.41 \ - --hosts 10.20.30.40,10.20.30.41,10.20.30.42 + --hosts 10.20.30.40,10.20.30.41,10.20.30.42 \ + --password "PASSWORD" `, []string{dbNameFlag, hostsFlag, ipv6Flag, configFlag, passwordFlag}, ) diff --git a/commands/cmd_unsandbox.go b/commands/cmd_unsandbox.go index 56225c5..d2f9715 100644 --- a/commands/cmd_unsandbox.go +++ b/commands/cmd_unsandbox.go @@ -65,11 +65,13 @@ directory path_to_catalog_of_sc1/metadata/sandbox_name. Examples: # Unsandbox a subcluster with config file vcluster unsandbox_subcluster --subcluster sc1 \ - --config /opt/vertica/config/vertica_cluster.yaml + --config /opt/vertica/config/vertica_cluster.yaml \ + --password "PASSWORD" # Unsandbox a subcluster with user input vcluster unsandbox_subcluster --subcluster sc1 \ - --hosts 10.20.30.40,10.20.30.41,10.20.30.42 --db-name test_db + --hosts 10.20.30.40,10.20.30.41,10.20.30.42 --db-name test_db \ + --password "PASSWORD" `, []string{dbNameFlag, configFlag, ipv6Flag, passwordFlag, hostsFlag}, )