forked from TrueCloudLab/frostfs-s3-gw
[#396] Rename params
session-token -> session-tokens rebalance_timer -> rebalance interval request_timeout -> healthcheck_timeout Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
parent
0f3ae334e5
commit
8d9e473804
7 changed files with 30 additions and 30 deletions
|
@ -200,8 +200,8 @@ func issueSecret() *cli.Command {
|
||||||
Value: "REP 2 IN X CBF 3 SELECT 2 FROM * AS X",
|
Value: "REP 2 IN X CBF 3 SELECT 2 FROM * AS X",
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "session-token",
|
Name: "session-tokens",
|
||||||
Usage: "create session token with rules, if the rules are set as 'none', no session tokens will be created",
|
Usage: "create session tokens with rules, if the rules are set as 'none', no session tokens will be created",
|
||||||
Required: false,
|
Required: false,
|
||||||
Destination: &sessionTokenFlag,
|
Destination: &sessionTokenFlag,
|
||||||
Value: "",
|
Value: "",
|
||||||
|
@ -278,7 +278,7 @@ It will be ceil rounded to the nearest amount of epoch.`,
|
||||||
|
|
||||||
sessionRules, skipSessionRules, err := getSessionRules(sessionTokenFlag)
|
sessionRules, skipSessionRules, err := getSessionRules(sessionTokenFlag)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return cli.Exit(fmt.Sprintf("couldn't parse 'session-token' flag: %s", err.Error()), 8)
|
return cli.Exit(fmt.Sprintf("couldn't parse 'session-tokens' flag: %s", err.Error()), 8)
|
||||||
}
|
}
|
||||||
|
|
||||||
issueSecretOptions := &authmate.IssueSecretOptions{
|
issueSecretOptions := &authmate.IssueSecretOptions{
|
||||||
|
|
|
@ -61,9 +61,9 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App {
|
||||||
|
|
||||||
prmPool pool.InitParameters
|
prmPool pool.InitParameters
|
||||||
|
|
||||||
reBalance = defaultRebalanceTimer
|
reBalance = defaultRebalanceInterval
|
||||||
conTimeout = defaultConnectTimeout
|
conTimeout = defaultConnectTimeout
|
||||||
reqTimeout = defaultRequestTimeout
|
hckTimeout = defaultHealthcheckTimeout
|
||||||
|
|
||||||
maxClientsCount = defaultMaxClientsCount
|
maxClientsCount = defaultMaxClientsCount
|
||||||
maxClientsDeadline = defaultMaxClientsDeadline
|
maxClientsDeadline = defaultMaxClientsDeadline
|
||||||
|
@ -73,8 +73,8 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App {
|
||||||
conTimeout = v
|
conTimeout = v
|
||||||
}
|
}
|
||||||
|
|
||||||
if v := v.GetDuration(cfgRequestTimeout); v > 0 {
|
if v := v.GetDuration(cfgHealthcheckTimeout); v > 0 {
|
||||||
reqTimeout = v
|
hckTimeout = v
|
||||||
}
|
}
|
||||||
|
|
||||||
if v := v.GetInt(cfgMaxClientsCount); v > 0 {
|
if v := v.GetInt(cfgMaxClientsCount); v > 0 {
|
||||||
|
@ -85,7 +85,7 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App {
|
||||||
maxClientsDeadline = v
|
maxClientsDeadline = v
|
||||||
}
|
}
|
||||||
|
|
||||||
if v := v.GetDuration(cfgRebalanceTimer); v > 0 {
|
if v := v.GetDuration(cfgRebalanceInterval); v > 0 {
|
||||||
reBalance = v
|
reBalance = v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App {
|
||||||
|
|
||||||
prmPool.SetKey(&key.PrivateKey)
|
prmPool.SetKey(&key.PrivateKey)
|
||||||
prmPool.SetNodeDialTimeout(conTimeout)
|
prmPool.SetNodeDialTimeout(conTimeout)
|
||||||
prmPool.SetHealthcheckTimeout(reqTimeout)
|
prmPool.SetHealthcheckTimeout(hckTimeout)
|
||||||
prmPool.SetClientRebalanceInterval(reBalance)
|
prmPool.SetClientRebalanceInterval(reBalance)
|
||||||
for _, peer := range fetchPeers(l, v) {
|
for _, peer := range fetchPeers(l, v) {
|
||||||
prmPool.AddNode(peer)
|
prmPool.AddNode(peer)
|
||||||
|
|
|
@ -17,8 +17,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
defaultRebalanceTimer = 15 * time.Second
|
defaultRebalanceInterval = 15 * time.Second
|
||||||
defaultRequestTimeout = 15 * time.Second
|
defaultHealthcheckTimeout = 15 * time.Second
|
||||||
defaultConnectTimeout = 30 * time.Second
|
defaultConnectTimeout = 30 * time.Second
|
||||||
defaultShutdownTimeout = 15 * time.Second
|
defaultShutdownTimeout = 15 * time.Second
|
||||||
|
|
||||||
|
@ -41,8 +41,8 @@ const ( // Settings.
|
||||||
|
|
||||||
// Timeouts.
|
// Timeouts.
|
||||||
cfgConnectTimeout = "connect_timeout"
|
cfgConnectTimeout = "connect_timeout"
|
||||||
cfgRequestTimeout = "request_timeout"
|
cfgHealthcheckTimeout = "healthcheck_timeout"
|
||||||
cfgRebalanceTimer = "rebalance_timer"
|
cfgRebalanceInterval = "rebalance_interval"
|
||||||
|
|
||||||
// Caching.
|
// Caching.
|
||||||
cfgObjectsCacheLifetime = "cache.objects.lifetime"
|
cfgObjectsCacheLifetime = "cache.objects.lifetime"
|
||||||
|
@ -180,9 +180,9 @@ func newSettings() *viper.Viper {
|
||||||
flags.String(cfgAddress, "", `address of wallet account`)
|
flags.String(cfgAddress, "", `address of wallet account`)
|
||||||
config := flags.String(cmdConfig, "", "config path")
|
config := flags.String(cmdConfig, "", "config path")
|
||||||
|
|
||||||
flags.Duration(cfgRequestTimeout, defaultRequestTimeout, "set gRPC request timeout")
|
flags.Duration(cfgHealthcheckTimeout, defaultHealthcheckTimeout, "set timeout to check node health during rebalance")
|
||||||
flags.Duration(cfgConnectTimeout, defaultConnectTimeout, "set gRPC connect timeout")
|
flags.Duration(cfgConnectTimeout, defaultConnectTimeout, "set timeout to connect to NeoFS nodes")
|
||||||
flags.Duration(cfgRebalanceTimer, defaultRebalanceTimer, "set gRPC connection rebalance timer")
|
flags.Duration(cfgRebalanceInterval, defaultRebalanceInterval, "set rebalance interval")
|
||||||
|
|
||||||
flags.Int(cfgMaxClientsCount, defaultMaxClientsCount, "set max-clients count")
|
flags.Int(cfgMaxClientsCount, defaultMaxClientsCount, "set max-clients count")
|
||||||
flags.Duration(cfgMaxClientsDeadline, defaultMaxClientsDeadline, "set max-clients deadline")
|
flags.Duration(cfgMaxClientsDeadline, defaultMaxClientsDeadline, "set max-clients deadline")
|
||||||
|
|
|
@ -45,9 +45,9 @@ S3_GW_PPROF=false
|
||||||
# Timeout to connect to a node
|
# Timeout to connect to a node
|
||||||
S3_GW_CONNECT_TIMEOUT=30s
|
S3_GW_CONNECT_TIMEOUT=30s
|
||||||
# Timeout to check node health during rebalance.
|
# Timeout to check node health during rebalance.
|
||||||
S3_GW_REQUEST_TIMEOUT=15s
|
S3_GW_HEALTHCHECK_TIMEOUT=15s
|
||||||
# Interval to check node health
|
# Interval to check node health
|
||||||
S3_GW_REBALANCE_TIMER=15s
|
S3_GW_REBALANCE_INTERVAL=15s
|
||||||
|
|
||||||
# Limits for processing of clients' requests
|
# Limits for processing of clients' requests
|
||||||
S3_GW_MAX_CLIENTS_COUNT=100
|
S3_GW_MAX_CLIENTS_COUNT=100
|
||||||
|
|
|
@ -46,10 +46,10 @@ pprof: false
|
||||||
|
|
||||||
# Timeout to connect to a node
|
# Timeout to connect to a node
|
||||||
connect_timeout: 30s
|
connect_timeout: 30s
|
||||||
# Timeout to check node health during rebalance.
|
# Timeout to check node health during rebalance
|
||||||
request_timeout: 15s
|
healthcheck_timeout: 15s
|
||||||
# Interval to check node health
|
# Interval to check node health
|
||||||
rebalance_timer: 15s
|
rebalance_interval: 15s
|
||||||
|
|
||||||
# Limits for processing of clients' requests
|
# Limits for processing of clients' requests
|
||||||
max_clients_count: 100
|
max_clients_count: 100
|
||||||
|
|
|
@ -187,12 +187,12 @@ If bearer rules are not set, a token will be auto-generated with a value:
|
||||||
### Session tokens
|
### Session tokens
|
||||||
|
|
||||||
With session token, there are 3 options:
|
With session token, there are 3 options:
|
||||||
1. append `--session-token` parameter with your custom rules in json format (as a string or file path). E.g.:
|
1. append `--session-tokens` parameter with your custom rules in json format (as a string or file path). E.g.:
|
||||||
```shell
|
```shell
|
||||||
$ neofs-authmate issue-secret --wallet wallet.json \
|
$ neofs-authmate issue-secret --wallet wallet.json \
|
||||||
--peer 192.168.130.71:8080 \
|
--peer 192.168.130.71:8080 \
|
||||||
--gate-public-key 0313b1ac3a8076e155a7e797b24f0b650cccad5941ea59d7cfd51a024a8b2a06bf \
|
--gate-public-key 0313b1ac3a8076e155a7e797b24f0b650cccad5941ea59d7cfd51a024a8b2a06bf \
|
||||||
--session-token session.json
|
--session-tokens session.json
|
||||||
```
|
```
|
||||||
where content of `session.json`:
|
where content of `session.json`:
|
||||||
```json
|
```json
|
||||||
|
@ -219,7 +219,7 @@ where content of `session.json`:
|
||||||
the authmate creates a `SETEACL` session token automatically in case when a user specified the token rule with `PUT` and
|
the authmate creates a `SETEACL` session token automatically in case when a user specified the token rule with `PUT` and
|
||||||
forgot about the rule with `SETEACL`.
|
forgot about the rule with `SETEACL`.
|
||||||
|
|
||||||
2. append `--session-token` parameter with the value `none` -- no session token will be created
|
2. append `--session-tokens` parameter with the value `none` -- no session token will be created
|
||||||
3. skip the parameter, and `authmate` will create session tokens with default rules (the same as in `session.json`
|
3. skip the parameter, and `authmate` will create session tokens with default rules (the same as in `session.json`
|
||||||
in example above)
|
in example above)
|
||||||
|
|
||||||
|
|
|
@ -84,12 +84,12 @@ $ neofs-s3-gw --max_clients_count 150 --max_clients_deadline 1m
|
||||||
### Connection to NeoFS
|
### Connection to NeoFS
|
||||||
|
|
||||||
Timeout to connect to NeoFS nodes can be set with `--connect_timeout` (default 30s)
|
Timeout to connect to NeoFS nodes can be set with `--connect_timeout` (default 30s)
|
||||||
and timeout to check node health during rebalance`--request_timeout` (default 15s).
|
and timeout to check node health during rebalance`--healthcheck_timeout` (default 15s).
|
||||||
|
|
||||||
Also, interval to check node health can be specified by `--rebalance_timer` value, default value is 15s.
|
Also, interval to check node health can be specified by `--rebalance_interval` value, default value is 15s.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ neofs-s3-gw --request_timeout 15s --connect_timeout 1m --rebalance_timer 1h
|
$ neofs-s3-gw --healthcheck_timeout 15s --connect_timeout 1m --rebalance_interval 1h
|
||||||
```
|
```
|
||||||
|
|
||||||
### Monitoring and metrics
|
### Monitoring and metrics
|
||||||
|
|
Loading…
Reference in a new issue