Outdated Version

You are viewing an older version of this section. View current production version.

update-config

Change a configuration value for one or all MemSQL Nodes on the local machine.

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

Usage

Change a configuration value for one or all MemSQL Nodes on the local machine

Usage:
  memsqlctl update-config [flags]

Flags:
      --all                 Update all nodes on this host
  -h, --help                Help for update-config
      --key string          The configuration key to update
      --memsql-id strings   MemSQL ID to modify
      --reset               Restore the setting to the default value
      --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
  -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                     Path to the CA certificate file in PEM format to authenticate the MemSQL server certificate
      --timeout duration                     Maximum time for operation to complete (e.g., 30s, 10m, 1.5h)
  -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

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 list of nodes.

For the target MemSQL 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.

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

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.

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

Example 1

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

memsqlctl update-config --all --set-global --key "general_log" --value "PARTIAL"

Output:

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.