mc admin heal was showing additional unnecessary entries
of nodes with empty disks listing when that node does not
belong to the current pool number. A node only belongs to
one pool, so remove the extra entries.
The earlier approach of using a license token for communicating with
SUBNET is being replaced with a simpler mechanism of API keys. Unlike
the license which is a JWT token, these API keys will be simple UUID
tokens, and don't have any embedded information in them. SUBNET would
generate the API key on cluster registration, and return in the API
response. mc then stores it in the `subnet api_key` config of minio,
to be used for subsequent communication with SUBNET.
In case the api_key is not available in the config, but the cluster's
license is available, it will be used as auth in the subnet API call,
and api_key will be set after the call succeeds. This will help in
smooth migration from older versions of MinIO.
Sometimes, with slow machines, speedtest will not able to accomplish
any PUT/GET operations though no errors is met. In that case, this
commit will show an adequate error message asking the user to increase
the --duration flag.
The writer needs to be closed before creating the request. Otherwise the
call to subnet api fails with error like:
HTTP/1.x transport connection broken: http: ContentLength=6235 with Body length 6303.
Windows users often click on the binary without
knowing `mc` is a command-line tool and should be
run from a terminal. Throw a message to guide them
on what to do.
- reach subnet, upon failure provide `--airgap` command line
to allow them to upload report manually.
- use a proper httpClient when reaching out to subnet
with a 10sec timeout, and also support custom proxies
with self signed certs.
- also fix some error messages and cleanup help with correct
wording and grammar.
When a dynamic config is reset, the minio api response has `true` as
value of the header `x-minio-config-applied`. In such cases, mc should
not show the message asking the user to restart `minio`.
Limiting tracing to a specific path requires an asterisk at the end. I
don't know if this is a regression or the example was always wrong. I
only ever figured this out by trial and error.
This fixes#3856.
Co-authored-by: Robert Lützner <robert.luetzner@iternity.com>
The command needs exactly one argument, but was allowing two and
ignoring the second if passed. Fixed the validation.
Signed-off-by: Shireesh Anjal <shireesh@minio.io>
The custom `String()` function written for the `HealthDataTypeFlag` was
resulting in a crash as it did not contain `\t` character on which the
usage gets split when printing the error message.
Fixed by reusing the `FlagStringer` from cli package, which is used by StringFlag.String() as well.
Subnet doesn't return `ContentLength` in it's api response, and hence
using it as the limit with `LimitReader` doesn't work. Fixed by using a
sufficiently large (1 MiB) limit.
By default, it will run in `online` mode and try to register the cluster
on subnet. If the subnet license is not available in minio/mc config, it
will
- ask the user for login credentials
- use the credentials for authentication and call the registration api
- get the license from response of the api and store it in config
- use the stored license for any subsequent calls
In case the user belongs to multiple organizations in subnet, they will
be prompted to choose the appropriate organization from the list.
If the client machine is in an airgapped environment, user can choose to
use the `--offline` flag when running the command. In this case, it will
- generate and print the registration token
- ask the user to paste it in the subnet registration screen
- accept the license generated by subnet and store it in config
As part of this work, the `health` sub-command is also enhanced to:
- run in `online` mode by default, which tries to upload the health
report to subnet. Here the user will be prompted for subnet credentials
(if license not available in config) _before_ generating the health
report as it is a long running process.
- support a new flag `--offline` which can be used when subnet is not
reachable. When used, the health report will be generated in a local
json.gz file, which can then be uploaded on subnet.
The examples in help text of both the sub-commands are enhanced to list
multiple use cases.
When saving license to config, first preference is given to minio
config. If the minio server supports the `subnet license` key, the
license will be stored here. In case it is an older version of minio
that doesn't support this key, then the license will be stored in mc
host config.
In case of non-distributed setup, the server doesn't return network perf
data. Because of this, the network spinner doesn't finish, and is closed
explicitly outside the loop, resulting two lines (one incomplete, one
complete) for it.
Fixed by explicitly checking the number of servers when checking for
completion of the network spinner.
In mc admin info output, it is better to show 'OK' status in yellow and
not in green when there is a failed disk or a failed network link so it
is easier for users to detect something wrong.
Perform only lightweight tests by default, and include the long running
tests only if specified through a `--full` flag in the `admin subnet
health` command.
Tag can be set directly under Filter tag and not always under
Filter.And in the lifecycle document. In that case, the tag won't be
properly showed in the tabular info of the ILM listing. This PR fixes
it.
heal info now shows the list of all MinIO nodes and the status of disks,
OK, unformatted, healing with an estimation of the time of healing
completion. It also shows the tolerance of nodes/disks, meaning how many
nodes or disks we can turn off before losing read operation in the
cluster.