update-config

Description

Change a configuration value for one or all nodes on the host.

For a full list of config variables to set see the list of engine variables.

If neither --memsql-id nor --all is specified and the engine variable specified by the --key is not a sync variable, update-config will prompt the user to select a node from a table.

For the target nodes, update-config instructs each node, on startup, to set the engine variable (specified by the --key) to the --value.

If --delete is specified, it will delete the existing key and value.

If the engine variable (specified by the --key) is a sync variable:

  • You must run update-config on the Master Aggregator.

  • You must specify the --set-global parameter.

Usage

Usage:
  memsqlctl update-config [flags]

Flags:
      --all                 Update all nodes on this host
      --detailed-output     Display detailed output of the command
  -h, --help                Help for update-config
      --key string          The configuration key to update
      --memsql-id strings   The node ID of the node to modify
      --reset               Reset the key to the default value (formerly --delete)
      --set-global          Execute the associated SET GLOBAL statement
      --value string        The value to set for the key

Global Flags:
  -c, --config FILE_PATH                     Path to the memsqctl config file
      --default-install-dir DIRECTORY_PATH   Path to the default install directory
      --insecure-ssl                         Fall back to insecure SSL connections to local nodes if memsqlctl is unable to otherwise establish a connection (ADVANCED)
  -j, --json                                 Print output in JSON format
      --node-metadata-file FILE_PATH         Path to the node metadata file
      --parallelism POSITIVE_INTEGER         Maximum amount of operations to be run in parallel
      --ssl-ca FILE_PATH                     The path to the CA certificate file (in PEM format) to authenticate the database certificate
      --timeout duration                     Maximum time for operation to complete (e.g., 30s, 10m, 1.5h)
      --verbose-json                         Print output in JSON format, include some warnings and user messages
  -v, --verbosity count                      Increase logging verbosity
  -y, --yes                                  Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default

Remarks

  • This command is interactive unless you use either --yes or --json flag to override interactive behavior.

  • The memsqlctl update-config command is equivalent to the sdb-admin update-config command.

Example 1

The following example sets the general_log engine variable on all nodes on the local host.

memsqlctl update-config --all --set-global --key "general_log" --value "PARTIAL"
memsqlctl will perform the following actions:
  · Update configuration setting on node with MemSQL ID 179062CAEEBCBDA755B75297BF6D9B2AE4C98FB7 on port 3306
    - Execute command `SET GLOBAL general_log=PARTIAL`
    - Update MemSQL config file with setting general_log=PARTIAL

  · Update configuration setting on node with MemSQL ID E31F8D60BA422D0DC1C82C0BE274C7DC51F6A754 on port 3307
    - Execute command `SET GLOBAL general_log=PARTIAL`
    - Update MemSQL config file with setting general_log=PARTIAL

Would you like to continue? [y/N]: y
✓ Executed SET GLOBAL command on node with MemSQL ID 179062CAEEBCBDA755B75297BF6D9B2AE4C98FB7
✓ Updated MemSQL config file for node with MemSQL ID 179062CAEEBCBDA755B75297BF6D9B2AE4C98FB7
✓ Executed SET GLOBAL command on node with MemSQL ID E31F8D60BA422D0DC1C82C0BE274C7DC51F6A754
✓ Updated MemSQL config file for node with MemSQL ID E31F8D60BA422D0DC1C82C0BE274C7DC51F6A754

Example 2

The following example attempts to set a sync variable on a leaf node.

memsqlctl update-config --memsql-id B72DD1417CBAEAC04FD71ED3E0CAC81A723DB43C --set-global
--key "default_distributed_ddl_timeout" --value "15"

As expected, update-config fails with the following error:

Variable default_distributed_ddl_timeout must be set on a Master Aggregator

To correct this error, run memsqlctl update-config on the Master Aggregator.

Last modified: April 22, 2024

Was this article helpful?