|
2 | 2 |
|
3 | 3 | ## Usage Summary |
4 | 4 |
|
5 | | -Make sure a Hazelcast 4 or Hazelcast 5 cluster is running. |
| 5 | +### Home Directory |
| 6 | + |
| 7 | +CLC stores all configuration, logs and other files in its home directory. |
| 8 | +We will refer to that directory as `$CLC_HOME`. |
| 9 | +You can use `clc home` command to show where is `$CLC_HOME`: |
| 10 | +``` |
| 11 | +$ clc home |
| 12 | +/home/guest/.local/share/clc |
| 13 | +``` |
| 14 | + |
| 15 | +### Configuration |
| 16 | + |
| 17 | +CLC has a simple YAML configuration, usually named `config.yaml`. |
| 18 | +This file can exist anywhere in the file system, and can be used with the `--config` (or `-c`) flag: |
| 19 | + |
| 20 | +``` |
| 21 | +$ clc -c test/config.yaml |
| 22 | +``` |
| 23 | + |
| 24 | +If there is a `config.yaml` in the same directory with the CLC binary and the configuration was not explicitly set, CLC tries to load that configuration file: |
| 25 | +``` |
| 26 | +$ ls -lh |
| 27 | +total 17M |
| 28 | +-rwxrwxr-x 1 yuce yuce 17M Nov 26 23:11 clc* |
| 29 | +-rw------- 1 yuce yuce 200 Nov 26 23:12 config.yaml |
| 30 | +``` |
| 31 | + |
| 32 | +`configs` directory in `$CLC_HOME` is special, it contains all the configurations known to CLC. |
| 33 | +Known configurations can be directly specified by their names, instead of the full path. |
| 34 | +`clc config list` command lists the configurations known to CLC: |
| 35 | +``` |
| 36 | +# List configurations |
| 37 | +$ clc config list |
| 38 | +default |
| 39 | +pr-3066 |
| 40 | +
|
| 41 | +# Start CLC shell with configuration named pr-3066 |
| 42 | +$ clc -c pr-3066 |
| 43 | +``` |
| 44 | + |
| 45 | +If no configuration is specified, the `default` configuration is used. |
| 46 | + |
| 47 | +#### Configuration format |
| 48 | + |
| 49 | +All paths in the configuration are relative to the parent directory of the configuration file. |
| 50 | + |
| 51 | +* cluster |
| 52 | + * name: Name of the cluster. By default `dev`. |
| 53 | + * address: Address of a member in the cluster. By default `localhost:5701`. |
| 54 | + * discovery-token: Viridian Serverless Token. |
| 55 | + |
| 56 | +* ssl |
| 57 | + * ca-path: TLS CA certificate path. |
| 58 | + * cert-path: TLS certificate path. |
| 59 | + * key-path: TLS mutual authentication key certificate path. |
| 60 | + * key-password: Password for the key certificate. |
| 61 | + |
| 62 | +* log |
| 63 | + * path: Path to the log file, or `stderr`. By default, the logs are written to `$CLC_HOME/logs` with the current date as the name. |
| 64 | + * level: Log level, one of: `debug`, `info`, `warn`, `error`. The default is `info`. |
| 65 | + |
| 66 | +Here's a sample Viridian Serverless configuration: |
| 67 | +``` |
| 68 | +cluster: |
| 69 | + name: "pr-3814" |
| 70 | + viridian-token: "HY8eR7X...." |
| 71 | +ssl: |
| 72 | + ca-path: "ca.pem" |
| 73 | + cert-path: "cert.pem" |
| 74 | + key-path: "key.pem" |
| 75 | + key-password: "a6..." |
| 76 | +``` |
| 77 | + |
| 78 | +### Logging |
| 79 | + |
| 80 | +CLC doesn't log to the screen by default, in order to reduce clutter. |
| 81 | +By default, logs are saved in `$CLC_HOME/logs`, creating a new log file per day. |
| 82 | +In order to log to a different file, or to stderr (usually the screen), use the `--log.path` flag: |
| 83 | + |
| 84 | +``` |
| 85 | +# log to object-list.log |
| 86 | +$ clc object list --log.path object-list.log |
| 87 | +
|
| 88 | +# log to screen |
| 89 | +$ clc object list --log.path stderr |
| 90 | +``` |
| 91 | + |
| 92 | +By default, logs with level `info` and above are logged. |
| 93 | +You can use the `--log.level` flag to change the level. |
| 94 | +Supported levels: `debug`, `info`, `warn`, `error` |
| 95 | + |
| 96 | +``` |
| 97 | +# log only errors |
| 98 | +$ clc object list --log.level error |
| 99 | +``` |
| 100 | + |
6 | 101 |
|
7 | 102 | ### Non-interactive Mode |
8 | 103 |
|
|
0 commit comments