github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/docs/cli/config.md (about)

     1  ---
     2  layout: post
     3  title: CONFIG
     4  permalink: /docs/cli/config
     5  redirect_from:
     6   - /cli/config.md/
     7   - /docs/cli/config.md/
     8  ---
     9  
    10  Primarily, there are two main configuration-managing commands, each having multiple subcommands and sub-subcommands:
    11  
    12  1. `ais config`		- show and update configuration
    13  2. `ais show config`	- show configuration
    14  
    15  > As always, the subcommands of the `ais config` and, respectively, `ais show config` will reveal themselves as completions (upon `<TAB-TAB>`).
    16  
    17  In brief:
    18  
    19  ```console
    20  $ ais config --help
    21  NAME:
    22     ais config - configure AIS cluster and individual nodes (in the cluster); configure CLI (tool)
    23  
    24  USAGE:
    25     ais config command [command options] [arguments...]
    26  
    27  COMMANDS:
    28     show     show CLI, cluster, or node configurations (nodes inherit cluster and have local)
    29     cluster  configure AIS cluster
    30     node     configure AIS node
    31     reset    reset (cluster | node | CLI) configuration to system defaults
    32     cli      display and change AIS CLI configuration
    33  
    34  OPTIONS:
    35     --help, -h  show help
    36  ```
    37  
    38  > As always, `ais config show` is an alias for `ais show config` - both can be used interchangeably.
    39  
    40  Here's a couple quick usage examples:
    41  
    42  ### Example: show config, update config
    43  
    44  ```console
    45  # show `ais config` subcommands:
    46  $ ais config <TAB-TAB>
    47  cli    cluster    node    reset    show
    48  
    49  # select `cluster` configuration and see usage and options
    50  $ ais config cluster --help
    51  
    52  # show the entire cluster configuration in JSON
    53  $ ais config cluster --json
    54  
    55  # show one selected section (e.g., checksum) from the cluster config
    56  $ ais config cluster checksum
    57  
    58  # update one value (e.g., checksum type)
    59  $ ais config cluster checksum=md5
    60  
    61  # using JSON-formatted values, update backend configuration;
    62  # for supported backend providers, see docs/providers.md
    63  $ ais config cluster backend.conf='{"gcp":{}, "aws":{}}'
    64  
    65  # e.g., to remove all backends, run:
    66  # ais config cluster backend.conf='{}'
    67  ```
    68  
    69  > **Notice** single quotes above. Single or double quotes are required when the value contains spaces and/or wildcards. But single quotes, in particular, are strongly recommended when the value itself contains double quotes.
    70  
    71  ### Example: show specific config section (flat and JSON)
    72  
    73  ```console
    74  $ ais show cluster config ec
    75  PROPERTY                 VALUE
    76  ec.objsize_limit         262144
    77  ec.compression           never
    78  ec.bundle_multiplier     2
    79  ec.data_slices           1
    80  ec.parity_slices         1
    81  ec.enabled               false
    82  ec.disk_only             false
    83  
    84  # same in JSON:
    85  
    86  $ ais show config cluster ec --json
    87  
    88      "ec": {
    89          "objsize_limit": 262144,
    90          "compression": "never",
    91          "bundle_multiplier": 2,
    92          "data_slices": 1,
    93          "parity_slices": 1,
    94          "enabled": false,
    95          "disk_only": false
    96      }
    97  ```
    98  
    99  Further, as far as configuration, AIS supports **inheritance** and **local override**.
   100  
   101  Here's how it works:
   102  
   103  At any point in time there is a single, protected and replicated, version of the cluster configuration. When a new cluster gets deployed, all clustered nodes inherit the same (initial) version - identical default values.
   104  
   105  Subsequently, when a new node joins cluster it will also receive the current version of the cluster configuration.
   106  
   107  On the other hand, it is possible at any point in time to select any node and override (any selected) inherited value - the value *inherited* by the node with its replica of the cluster config.
   108  
   109  Note, however: if and when the corresponding value changes on the cluster level, the node's override will take precedence - the specific update won't apply (to this node).
   110  
   111  > In other words, overriding inherited (cluster) configuration on the node level breaks the future inheritance.
   112  
   113  > Use `ais config reset` to remove all previous overrides.
   114  
   115  Finally, note that all configuration updates are, by default, persistent. Use the `--transient` flag to make them transient - i.e., in memory only, i.e., *not* persisting across reboots.
   116  
   117  See also:
   118  
   119  * [AIStore Configuration](/docs/configuration.md)
   120  
   121  ## Table of Contents
   122  
   123  - [Show configuration](#show-configuration)
   124  - [`ais show config`](#ais-show-config)
   125  - [Update cluster configuration](#update-cluster-configuration)
   126  - [Update node configuration](#update-node-configuration)
   127  - [Reset configuration](#reset-configuration)
   128  - [CLI own configuration](#cli-own-configuration)
   129  
   130  ## Show configuration
   131  
   132  The command `ais show config` is structured as follows.
   133  
   134  ```console
   135  # 1. Select to show: CLI config, cluster config, or the config of any of the clustered nodes, e.g.:
   136  
   137  $ ais show config <TAB-TAB>
   138  cli           cluster       p[kdQp8080]   t[NBzt8081]
   139  ```
   140  
   141  > Notice here (and everywhere) that target nodes have `t` prefix, while AIS gateways (aka proxies) start with `p`.
   142  
   143  ```console
   144  # 2. For the cluster config, select a named section, or simply press Enter. Following
   145  # is the complete list of configuration sections resulting from pressing <TAB-TAB>:
   146  
   147  $ ais show config cluster
   148  auth               disk               features           lru                proxy              timeout
   149  backend            distributed_sort   fshc               memsys             rebalance          transport
   150  checksum           downloader         keepalivetracker   mirror             resilver           uuid
   151  client             ec                 lastupdate_time    net                space              versioning
   152  config_version     log                periodic           tcb                write_policy
   153  ```
   154  
   155  ```console
   156  # 3. Tip: help is available at any point. For instance, as stated above, you could select a section.
   157  # But you could also run `ais show config cluster` with no section selected,
   158  # with or without `--json` option to format the output:
   159  
   160  $ ais show config cluster --help
   161  NAME:
   162     ais show config - show CLI, cluster, or node configurations (nodes inherit cluster and have local)
   163  
   164  USAGE:
   165     ais show config [command options] cli | cluster [CONFIG SECTION OR PREFIX] |
   166        NODE_ID [ cluster | local | all [CONFIG SECTION OR PREFIX ] ]
   167  
   168  OPTIONS:
   169     --json, -j  json input/output
   170     --help, -h  show help
   171  ```
   172  
   173  ```console
   174  # 4. Finally, for any specific node you can show its inherited config (where some of the values *may* be overridden) and its local one:
   175  
   176  $ ais show config t[NBzt8081]
   177  inherited   local
   178  ```
   179  
   180  ## `ais show config`
   181  
   182  As stated above, the command further splits as follows:
   183  
   184  `ais show config cluster` or `ais show config cli` or `ais show config [NODE_ID]`
   185  
   186  Node configuration consists of two parts:
   187  
   188  - global cluster configuration which is the same across the cluster
   189  - local daemon configuration which overrides the global one.
   190  
   191  ### Cluster configuration
   192  
   193  `ais show cluster config [CONFIG_PREFIX]`
   194  
   195  Display the cluster configuration. If `CONFIG_PREFIX` is given, only that configurations matching the prefix will be shown.
   196  
   197  #### Options
   198  
   199  | Flag | Type | Description | Default |
   200  | --- | --- | --- | --- |
   201  | `--json, -j` | `bool` | Output in JSON format | `false` |
   202  
   203  ### Node configuration
   204  
   205  `ais show config NODE_ID [CONFIG_PREFIX]`
   206  
   207  Display the actual daemon configuration. If `CONFIG_PREFIX` is given, only the configurations matching the prefix will be shown.
   208  The output includes extra column with global values. Some values in the column have special meaning:
   209  
   210  - `-` - the local and global values are the same, the option is not overridden
   211  - `N/A` - the option is local-only and does not exist in global config
   212  
   213  #### Options
   214  
   215  | Flag | Type | Description | Default |
   216  | --- | --- | --- | --- |
   217  | `--json, -j` | `bool` | Output in JSON format | `false` |
   218  
   219  ### Examples
   220  
   221  #### Show node's local configuration
   222  
   223  Display all local configurations of the node with ID `CASGt8088`
   224  
   225  ```console
   226  $ ais show config local CASGt8088
   227  PROPERTY                         VALUE
   228  confdir                          /home/divaturi/.ais8
   229  log_dir                          /tmp/ais/8/log
   230  host_net.hostname
   231  host_net.hostname_intra_control
   232  host_net.hostname_intra_data
   233  host_net.port                    8088
   234  host_net.port_intra_control      9088
   235  host_net.port_intra_data         10088
   236  fspaths.paths                    /tmp/ais/mp1/8,/tmp/ais/mp2/8,/tmp/ais/mp3/8,/tmp/ais/mp4/8,/tmp/ais/mp5/8
   237  test_fspaths.root                /tmp/ais
   238  test_fspaths.count               5
   239  test_fspaths.instance            8
   240  ```
   241  
   242  #### Show cluster configurations on a node
   243  
   244  Display all cluster configurations (and overrides) of the node with ID `CASGt8088`
   245  
   246  ```console
   247  $ ais show config inherited CASGt8088
   248  PROPERTY                                 VALUE                                                           DEFAULT
   249  auth.enabled                             false                                                           -
   250  auth.secret                              aBitLongSecretKey                                               -
   251  backend.conf                             map[]                                                           -
   252  checksum.enable_read_range               false                                                           -
   253  checksum.type                            xxhash                                                          -
   254  checksum.validate_cold_get               true                                                            -
   255  checksum.validate_obj_move               false                                                           -
   256  checksum.validate_warm_get               false                                                           -
   257  client.client_long_timeout               30m                                                             -
   258  # only 10 lines of output shown
   259  ```
   260  
   261  #### Show cluster LRU config section
   262  
   263  Display only the LRU config section of the global config
   264  
   265  ```console
   266  $ ais show config cluster lru
   267  PROPERTY		        VALUE
   268  lru.dont_evict_time	    1s
   269  lru.capacity_upd_time	10m
   270  lru.enabled		        true
   271  
   272  $ ais show config cluster space
   273  PROPERTY		        VALUE
   274  space.cleanupwm		    70
   275  space.lowwm		        80
   276  space.highwm		    90
   277  space.out_of_space	    95
   278  ```
   279  
   280  ## Update cluster configuration
   281  
   282  `ais config cluster NAME=VALUE [NAME=VALUE...]`
   283  
   284  Alternatively:
   285  
   286  ```console
   287  $ ais config cluster <TAB-TAB>
   288  Display all 108 possibilities? (y or n)
   289  
   290  $ ais config cluster time<TAB-TAB>
   291  $ ais config cluster timeout.<TAB-TAB>
   292  timeout.cplane_operation    timeout.max_host_busy       timeout.send_file_time
   293  timeout.join_startup_time   timeout.max_keepalive       timeout.startup_time
   294  ```
   295  
   296  And so on.
   297  
   298  Updating is done by specifying name-value pairs. Use completions to help you remind (and/or type) the name and specify the new value. Use space or the `=` sign to delineate names from values.
   299  
   300  **NOTE:** to see the current (pre-update) value, simply press Enter.
   301  
   302  For example:
   303  
   304  ```console
   305  $ ais config cluster lru.enabled
   306  PROPERTY         VALUE
   307  lru.enabled      true
   308  
   309  $ ais config cluster lru.enabled=false
   310  {
   311  	    "lru.enabled": "false"
   312  }
   313  
   314  cluster config updated
   315  ```
   316  
   317  ### Set multiple config values in one shot
   318  
   319  Change `periodic.stats_time` and `disk.disk_util_low_wm` config values for the entire cluster.
   320  
   321  ```console
   322  $ ais config cluster periodic.stats_time=10s disk.disk_util_low_wm=40
   323  Config has been updated successfully.
   324  ```
   325  
   326  ## Update node configuration
   327  
   328  `ais config node NODE_ID inherited NAME=VALUE [NAME=VALUE...]`
   329  
   330  or
   331  
   332  `ais config node NODE_ID local NAME=VALUE [NAME=VALUE...]`
   333  
   334  
   335  Usually, the steps:
   336  
   337  1. Select a node or use `<TAB-TAB>` to complete the selection.
   338  2. Next, select `inherited` to update cluster-level values. Alternatively, type or select `local`.
   339  3. Update selected value. Name and value can be separated either with `=` character or with a space.
   340  
   341  > When updating inherited values, keep in mind: all previous overrides can be undone using `ais config reset` command.
   342  
   343  ### Set multiple config values
   344  
   345  ```console
   346  # Change `periodic.stats_time` and `disk.disk_util_low_wm` config values for node CMhHp8082.
   347  
   348  $ ais config node CMhHp8082 periodic.stats_time=10s disk.disk_util_low_wm=40
   349  Config has been updated successfully.
   350  ```
   351  
   352  ## Reset configuration
   353  
   354  `ais config reset [NODE_ID]`
   355  
   356  Reset configuration for a specific daemon or the entire cluster back to the cluster configuration.
   357  That is, all local overrides will be removed and the cluster configuration will be applied to all nodes.
   358  To reset the configuration for the entire cluster, do not specify a `DEAMON_ID` argument.
   359  
   360  ```console
   361  # Discard local overrides for all nodes:
   362  
   363  $ ais config reset
   364  config successfully reset for all nodes
   365  ```
   366  
   367  ```console
   368  # Reset node's configuration to the current cluster-level values:
   369  
   370  $ ais config reset CMhHp8082
   371  config for node "CMhHp8082" successfully reset
   372  ```
   373  
   374  ## CLI own configuration
   375  
   376  CLI (tool) has configuration of its own. CLI (tool) can be used to view and update its own config.
   377  
   378  ### Show CLI configuration
   379  
   380  `ais config cli show [--path] [--json]`
   381  
   382  Display the current CLI configuration.
   383  If `--path` is set, display only the path to the CLI configuration file.
   384  
   385  #### Examples
   386  
   387  ```console
   388  $ ais config cli show
   389  PROPERTY                         VALUE
   390  aliases				 cp => 'bucket cp'; create => 'bucket create'; evict => 'bucket evict';
   391                                   ls => 'bucket ls'; rmb => 'bucket rm'; start => 'job start';
   392  				 blob-download => 'job start blob-download'; download => 'job start download';
   393  				 dsort => 'job start dsort'; stop => 'job stop'; wait => 'job wait';
   394  				 get => 'object get'; prefetch => 'object prefetch'; put => 'object put';
   395  				 rmo => 'object rm'
   396  auth.url			 http://127.0.0.1:52001
   397  cluster.client_ca_tls
   398  cluster.client_crt
   399  cluster.client_crt_key
   400  cluster.default_ais_host	 http://127.0.0.1:8080
   401  cluster.default_docker_host	 http://172.50.0.2:8080
   402  cluster.skip_verify_crt		 false
   403  cluster.url			 http://127.0.0.1:8080
   404  default_provider		 ais
   405  no_color			 false
   406  no_more				 false
   407  timeout.http_timeout		 0s
   408  timeout.tcp_timeout		 60s
   409  verbose				 false
   410  
   411  $ ais config cli show --path
   412  /home/user/.ais/cli/cli.json
   413  ```
   414  
   415  ### Change CLI configuration
   416  
   417  `ais config cli set NAME=VALUE [NAME=VALUE...]`
   418  
   419  Modify the CLI configuration. The configuration file is updated only if **all** new options are applied without errors.
   420  If an option name does not exist or value is incorrect the operation is aborted.
   421  
   422  #### Examples
   423  
   424  ```console
   425  $ ais config cli set timeout.tcp_timeout 61s
   426  "timeout.tcp_timeout" set to: "61s" (was: "60s")
   427  
   428  $ ais config cli show --json
   429  {
   430      "cluster": {
   431          "url": "http://127.0.0.1:8080",
   432          "default_ais_host": "http://127.0.0.1:8080",
   433          "default_docker_host": "http://172.50.0.2:8080",
   434          "client_crt": "",
   435          "client_crt_key": "",
   436          "client_ca_tls": "",
   437          "skip_verify_crt": false
   438      },
   439      "timeout": {
   440          "tcp_timeout": "60s",
   441          "http_timeout": "0s"
   442      },
   443      "auth": {
   444          "url": "http://127.0.0.1:52001"
   445      },
   446      "aliases": {
   447          "wait": "job wait",
   448          "cp": "bucket cp",
   449          "ls": "bucket ls",
   450          "prefetch": "object prefetch",
   451          "rmo": "object rm",
   452          "dsort": "job start dsort",
   453          "get": "object get",
   454          "rmb": "bucket rm",
   455          "start": "job start",
   456          "put": "object put",
   457          "stop": "job stop",
   458          "blob-download": "job start blob-download",
   459          "create": "bucket create",
   460          "download": "job start download",
   461          "evict": "bucket evict"
   462      },
   463      "default_provider": "ais",
   464      "no_color": false,
   465      "verbose": false,
   466      "no_more": false
   467  }
   468  ```