mirror of
https://github.com/minio/minio.git
synced 2025-01-13 07:53:21 -05:00
fix remote target healthcheck (#11267)
This commit is contained in:
parent
00af9881b0
commit
b97d53b29c
@ -367,9 +367,9 @@ func (sys *BucketTargetSys) getRemoteTargetClient(tcfg *madmin.BucketTarget) (*T
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
hcDuration := tcfg.HealthCheckDuration
|
hcDuration := defaultHealthCheckDuration
|
||||||
if hcDuration < 1 { // require minimum health check duration of 1 sec.
|
if tcfg.HealthCheckDuration >= 1 { // require minimum health check duration of 1 sec.
|
||||||
hcDuration = defaultHealthCheckDuration
|
hcDuration = tcfg.HealthCheckDuration
|
||||||
}
|
}
|
||||||
tc := &TargetClient{
|
tc := &TargetClient{
|
||||||
Client: api,
|
Client: api,
|
||||||
@ -461,10 +461,10 @@ func (tc *TargetClient) healthCheck() {
|
|||||||
_, err := tc.BucketExists(GlobalContext, tc.bucket)
|
_, err := tc.BucketExists(GlobalContext, tc.bucket)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
atomic.StoreInt32(&tc.up, 0)
|
atomic.StoreInt32(&tc.up, 0)
|
||||||
time.Sleep(tc.healthCheckDuration)
|
time.Sleep(tc.healthCheckDuration * time.Second)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
atomic.StoreInt32(&tc.up, 1)
|
atomic.StoreInt32(&tc.up, 1)
|
||||||
time.Sleep(tc.healthCheckDuration)
|
time.Sleep(tc.healthCheckDuration * time.Second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ an upcoming feature.
|
|||||||
By default, replication is completed asynchronously. If synchronous replication is desired, set the --sync flag while adding a
|
By default, replication is completed asynchronously. If synchronous replication is desired, set the --sync flag while adding a
|
||||||
remote replication target using the `mc admin bucket remote add` command
|
remote replication target using the `mc admin bucket remote add` command
|
||||||
```
|
```
|
||||||
mc admin bucket remote add myminio/srcbucket https://accessKey:secretKey@replica-endpoint:9000/destbucket --service replication --region us-east-1 --sync --healthcheck-seconds 100s
|
mc admin bucket remote add myminio/srcbucket https://accessKey:secretKey@replica-endpoint:9000/destbucket --service replication --region us-east-1 --sync --healthcheck-seconds 100
|
||||||
```
|
```
|
||||||
|
|
||||||
## Explore Further
|
## Explore Further
|
||||||
|
Loading…
Reference in New Issue
Block a user