CLI Overview
This page provides an overview of the Weka system CLI.

Available Top-Level Commands

The Weka CLI is installed on each Weka host and is available through the weka command. Running this command will display a list of all available top-level commands:
1
$ weka
2
Usage:
3
weka [--help] [--build] [--version] [--legal]
4
5
Description:
6
The base command for all weka related CLIs
7
8
Subcommands:
9
agent Command s that control the weka agent (outside the weka containers)
10
alerts List alerts in the Weka cluster
11
cloud Cloud commands. List the cluster's cloud status, if no subcommand supplied.
12
cluster Commands that manage the cluster
13
debug Commands used to debug a weka cluster
14
diags Diagnostics commands to help understand the status of the cluster and its environment
15
events List all events that conform to the filter criteria
16
fs List filesystems defined in this Weka cluster
17
local Commands that control weka and its containers on the local machine
18
mount Mounts a wekafs filesystem. This is the helper utility installed at /sbin/mount.wekafs.
19
nfs Commands that manage client-groups, permissions and interface-groups
20
org List organizations defined in the Weka cluster
21
security Security commands.
22
smb Commands that manage Weka's SMB container
23
stats List all statistics that conform to the filter criteria
24
status Get an overall status of the Weka cluster
25
umount Unmounts wekafs filesystems. This is the helper utility installed at /sbin/umount.wekafs.
26
user List users defined in the Weka cluster
27
version When run without arguments, lists the versions available on this machine. Subcommands allow for
28
downloading of versions, setting the current version and other actions to manage versions.
29
30
Options:
31
--agent Start the agent service
32
-h, --help Show help message
33
--build Prints the CLI build number and exits
34
-v, --version Prints the CLI version and exits
35
--legal Prints software license information and exits
Copied!
Note: There are a number of options which are common to many commands:
-J|--jsonflag prints the raw JSON value returned by the cluster.
-H|--hostnameflag directs the CLI to communicate with the cluster through the given hostname.
--raw-units flag causes units such as capacity and bytes to be printed in their raw format, as returned by the cluster.
--UTC flag causes timestamps to be printed in the UTC timezone, rather than in the local time of the machine running the CLI command.
-f|--format flag specifies the format to output the result (view, csv, markdown, or JSON)
-o|--output flag specifies the columns of the output to be included.
-s|--sort flag specifies the order to sort the output. May include a '+' or '-' before the column name to sort by ascending or descending order.
-F| --filter flag specifies the filter values for a member (without forcing it to be in the output).
--no-header flag indicates that the column header should not be shown when printing the output.
-C|--CONNECT-TIMEOUT flag can be used to change the default timeout used for connecting to the system via the JRPC protocol.
-T|--TIMEOUT flag can be used to change the default timeout for which the commands waits for a response before giving up.

Command Hierarchy

Most Weka system top-level commands are the default list command for their own collection. Additional sub-commands may be available under them.
For Example: The weka fs command displays a list of all filesystems and is also the top-level command for all filesystems, filesystem groups, and snapshot-related operations. It is possible to use the -h/--help flags or the help command to display a list of available commands at each level, as shown below:
1
$ weka fs
2
| FileSystem | Name | Group | SSD Bu | Total | Is re | Is creat | Is remov
3
| ID | | | dget | Budget | ady | ing | ing
4
+------------+---------+---------+--------+--------+-------+----------+----------
5
| FSId: 0 | default | default | 57 GiB | 57 GiB | True | False | False
Copied!
1
$ weka fs -h
2
Usage:
3
weka fs [--name name]
4
[--HOST HOST]
5
[--PORT PORT]
6
[--CONNECT-TIMEOUT CONNECT-TIMEOUT]
7
[--TIMEOUT TIMEOUT]
8
[--format format]
9
[--output output]...
10
[--sort sort]...
11
[--filter filter]...
12
[--help]
13
[--raw-units]
14
[--UTC]
15
[--no-header]
16
[--verbose]
17
[--json]
18
19
Description:
20
List filesystems defined in this Weka cluster
21
22
Subcommands:
23
create Create a filesystem
24
download Download a filesystem from object store
25
update Update a filesystem
26
delete Delete a filesystem
27
restore Restore filesystem content from a snapshot
28
group List filesystem groups
29
snapshot List snapshots
30
tier Show object storage connectivity for each node in the cluster
31
32
Options:
33
--name Filesystem name
34
-H, --HOST Specify the host. Alternatively, use the WEKA_HOST env variable
35
-P, --PORT Specify the port. Alternatively, use the WEKA_PORT env variable
36
-C, --CONNECT-TIMEOUT Timeout for connecting to cluster, default: 10 secs (format: 3s, 2h, 4m, 1d, 1d5h, 1w)
37
-T, --TIMEOUT Timeout to wait for response, default: 1 minute (format: 3s, 2h, 4m, 1d, 1d5h, 1w)
38
-f, --format Specify in what format to output the result. Available options are:
39
view|csv|markdown|json|oldview (format: 'view', 'csv', 'markdown', 'json' or 'oldview')
40
-o, --output Specify which columns to output. May include any of the following:
41
id,name,group,usedSSDD,usedSSDM,usedSSD,freeSSD,availableSSDM,availableSSD,usedTotalD,usedTotal,freeTotal,availableTotal,maxFiles,status,encrypted,stores,auth
42
-s, --sort Specify which column(s) to take into account when sorting the output. May include a '+' or
43
'-' before the column name to sort in ascending or descending order respectively. Usage:
44
[+|-]column1[,[+|-]column2[,..]]
45
-F, --filter Specify what values to filter by in a specific column. Usage:
46
column1=val1[,column2=val2[,..]]
47
-h, --help Show help message
48
-R, --raw-units Print values in raw units (bytes, seconds, etc.). When not set, sizes are printed in
49
human-readable format, e.g 1KiB 234MiB 2GiB.
50
-U, --UTC Print times in UTC. When not set, times are converted to the local time of this host.
51
--no-header Don't show column headers when printing the output
52
-v, --verbose Show all columns in output
53
Copied!

Connecting to Another Host

Most Weka system commands deliver the same result on all cluster hosts. However, it is sometimes necessary to execute a command on a specific host. This is performed using the -H/--hostname option and specifying the hostname or IP address of the target host.

CLI Auto-completion

Using bash you can use auto-completion for CLI commands and parameters. The auto-completion script is automatically installed.
To disable the auto-completion script, run weka agent autocomplete uninstall
To (re-)install the script on a host, run weka agent autocomplete install and re-enter your shell session.
You can also use weka agent autocomplete export to get the bash completions script and write it to any desired location.

Cluster Status

The weka status command displays the overall status of the Weka system.
For Example: If the cluster is healthy, a result similar to the following should be displayed:
1
$ weka status
2
WekaIO v3.10.0 (CLI build 3.10.0)
3
4
cluster: WekaProd (00569cef-5679-4e1d-afe5-7e82748887de)
5
status: OK (8 backends UP, 48 drives UP)
6
protection: 6+2
7
hot spare: 1 failure domains
8
drive storage: 82.94 TiB total, 82.94 TiB unprovisioned
Copied!
For Example: If the cluster has one failed host, a result similar to the following should be displayed:
1
$ weka status
2
WekaIO v3.10.0 (CLI build 3.10.0)
3
4
cluster: WekaProd (00569cef-5679-4e1d-afe5-7e82748887de)
5
status: DEGRADED (7 backends UP, 42 drives UP)
6
Rebuild in progress (3%)
7
protection: 6+2
8
hot spare: 1 failure domains
9
drive storage: 82.94 TiB total, 82.94 TiB unprovisioned
Copied!
Last modified 1mo ago