# update-config

## Description

Update the configuration for one or all nodes in the cluster.

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

If `--set-global` is specified, `update-config` will connect to the node (if the process is running) and run `SET GLOBAL`, setting the variable specified by the `--key` to the `--value`. This enables the variable’s value to be set before the node restarts.

Using `--set-global` is equivalent to running `SET GLOBAL` on a non-sync variable or running `SET CLUSTER` on a sync variable.

If `--reset` is specified, it will reset both the `SET GLOBAL` variables and the SingleStore config file variables.

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

* You must specify the `--memsql-id` of the Master Aggregator.
* You must specify the `--set-global` parameter.
* You cannot specify the `--all` parameter.

**Examples**

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

```shell
sdb-admin update-config --all --set-global --key "general_log" --value "PARTIAL"

```

```output

Toolbox is about to run 'memsqlctl update-config --key general_log --value PARTIAL --set-global'
on the following nodes:
    - On host 127.0.0.1:
      + 24084C82FD8E4342EF61ED4D85105A1CF5A264F5
      + B72DD1417CBAEAC04FD71ED3E0CAC81A723DB43C

Would you like to continue? [y/N]: y
✓ Updated configuration on 127.0.0.1  
Operation completed successfully

```

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

```shell
sdb-admin 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 `sdb-admin update-config` using the `--memsql-id` of the Master Aggregator.

## Usage

```
Usage:
  sdb-admin update-config [flags]

  For flags that can accept multiple values (indicated by VALUES after the name of the flag),
  separate each value with a comma.

Flags:
  -a, --all                                        Update all nodes in the cluster
  -h, --help                                       Help for update-config
      --key string                                 The configuration key to update
      --role {master, aggregator, leaf, unknown}   Update only nodes with the given role. Possible roles are LEAF, AGGREGATOR, and MASTER (default Unspecified)
      --memsql-id MemsqlID                         The node ID of the node on which to update the configuration
      --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:
      --backup-cache FILE_PATH                File path for the backup cache
      --cache-file FILE_PATH                  File path for the Toolbox node cache
  -c, --config FILE_PATH                      File path for the Toolbox configuration
      --disable-colors                        Disable color output in console, which some terminal sessions/environments may have difficulty with
      --disable-spinner                       Disable the progress spinner, which some terminal sessions/environments may have issues with
  -j, --json                                  Enable JSON output
      --parallelism POSITIVE_INTEGER          Maximum number of operations to run in parallel
      --runtime-dir DIRECTORY_PATH            Where to store Toolbox runtime data
      --ssh-control-persist SECONDS           Enable SSH ControlPersist and set it to the specified duration in seconds
      --ssh-max-sessions POSITIVE_INTEGER     Maximum number of SSH sessions to open per host, must be at least 3
      --ssh-strict-host-key-checking          Enable strict host key checking for SSH connections
      --ssh-user-known-hosts-file FILE_PATH   Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used
      --state-file FILE_PATH                  Toolbox state file path
  -v, --verbosity count                       Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count
  -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 the `--yes` or `--json` flags to override interactive behavior.

***

Modified at: April 22, 2024

Source: [/db/v9.1/reference/singlestore-tools-reference/sdb-admin-commands/update-config/](https://docs.singlestore.com/db/v9.1/reference/singlestore-tools-reference/sdb-admin-commands/update-config/)

(An index of the documentation is available at /llms.txt)
