mirror of
https://github.com/minio/minio.git
synced 2025-04-21 11:04:20 -04:00
add missing handler for reloading site replication config on peers (#19042)
This commit is contained in:
parent
30a466aa71
commit
0c068b15c7
@ -540,6 +540,16 @@ func (client *peerRESTClient) LoadGroup(group string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (client *peerRESTClient) ReloadSiteReplicationConfig(ctx context.Context) error {
|
||||||
|
conn := client.gridConn()
|
||||||
|
if conn == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err := reloadSiteReplicationConfigHandler.Call(ctx, conn, grid.NewMSSWith(map[string]string{}))
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// VerifyBinary - sends verify binary message to remote peers.
|
// VerifyBinary - sends verify binary message to remote peers.
|
||||||
func (client *peerRESTClient) VerifyBinary(ctx context.Context, u *url.URL, sha256Sum []byte, releaseInfo string, reader io.Reader) error {
|
func (client *peerRESTClient) VerifyBinary(ctx context.Context, u *url.URL, sha256Sum []byte, releaseInfo string, reader io.Reader) error {
|
||||||
values := make(url.Values)
|
values := make(url.Values)
|
||||||
@ -970,15 +980,6 @@ func (client *peerRESTClient) DriveSpeedTest(ctx context.Context, opts madmin.Dr
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (client *peerRESTClient) ReloadSiteReplicationConfig(ctx context.Context) error {
|
|
||||||
respBody, err := client.callWithContext(context.Background(), peerRESTMethodReloadSiteReplicationConfig, nil, nil, -1)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer xhttp.DrainBody(respBody)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *peerRESTClient) GetLastDayTierStats(ctx context.Context) (DailyAllTierStats, error) {
|
func (client *peerRESTClient) GetLastDayTierStats(ctx context.Context) (DailyAllTierStats, error) {
|
||||||
var result map[string]lastDayTierStats
|
var result map[string]lastDayTierStats
|
||||||
respBody, err := client.callWithContext(context.Background(), peerRESTMethodGetLastDayTierStats, nil, nil, -1)
|
respBody, err := client.callWithContext(context.Background(), peerRESTMethodGetLastDayTierStats, nil, nil, -1)
|
||||||
|
@ -25,61 +25,43 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
peerRESTMethodHealth = "/health"
|
peerRESTMethodHealth = "/health"
|
||||||
peerRESTMethodServerInfo = "/serverinfo"
|
peerRESTMethodServerInfo = "/serverinfo"
|
||||||
peerRESTMethodLocalStorageInfo = "/localstorageinfo"
|
peerRESTMethodLocalStorageInfo = "/localstorageinfo"
|
||||||
peerRESTMethodCPUInfo = "/cpuinfo"
|
peerRESTMethodCPUInfo = "/cpuinfo"
|
||||||
peerRESTMethodDiskHwInfo = "/diskhwinfo"
|
peerRESTMethodDiskHwInfo = "/diskhwinfo"
|
||||||
peerRESTMethodNetHwInfo = "/nethwinfo"
|
peerRESTMethodNetHwInfo = "/nethwinfo"
|
||||||
peerRESTMethodOsInfo = "/osinfo"
|
peerRESTMethodOsInfo = "/osinfo"
|
||||||
peerRESTMethodMemInfo = "/meminfo"
|
peerRESTMethodMemInfo = "/meminfo"
|
||||||
peerRESTMethodProcInfo = "/procinfo"
|
peerRESTMethodProcInfo = "/procinfo"
|
||||||
peerRESTMethodSysErrors = "/syserrors"
|
peerRESTMethodSysErrors = "/syserrors"
|
||||||
peerRESTMethodSysServices = "/sysservices"
|
peerRESTMethodSysServices = "/sysservices"
|
||||||
peerRESTMethodSysConfig = "/sysconfig"
|
peerRESTMethodSysConfig = "/sysconfig"
|
||||||
peerRESTMethodDeleteBucketMetadata = "/deletebucketmetadata"
|
peerRESTMethodGetBucketStats = "/getbucketstats"
|
||||||
peerRESTMethodLoadBucketMetadata = "/loadbucketmetadata"
|
peerRESTMethodGetAllBucketStats = "/getallbucketstats"
|
||||||
peerRESTMethodGetBucketStats = "/getbucketstats"
|
peerRESTMethodVerifyBinary = "/verifybinary"
|
||||||
peerRESTMethodGetAllBucketStats = "/getallbucketstats"
|
peerRESTMethodCommitBinary = "/commitbinary"
|
||||||
peerRESTMethodVerifyBinary = "/verifybinary"
|
peerRESTMethodSignalService = "/signalservice"
|
||||||
peerRESTMethodCommitBinary = "/commitbinary"
|
peerRESTMethodBackgroundHealStatus = "/backgroundhealstatus"
|
||||||
peerRESTMethodSignalService = "/signalservice"
|
peerRESTMethodGetLocks = "/getlocks"
|
||||||
peerRESTMethodBackgroundHealStatus = "/backgroundhealstatus"
|
peerRESTMethodStartProfiling = "/startprofiling"
|
||||||
peerRESTMethodGetLocks = "/getlocks"
|
peerRESTMethodDownloadProfilingData = "/downloadprofilingdata"
|
||||||
peerRESTMethodLoadUser = "/loaduser"
|
peerRESTMethodLog = "/log"
|
||||||
peerRESTMethodLoadServiceAccount = "/loadserviceaccount"
|
peerRESTMethodGetBandwidth = "/bandwidth"
|
||||||
peerRESTMethodDeleteUser = "/deleteuser"
|
peerRESTMethodGetMetacacheListing = "/getmetacache"
|
||||||
peerRESTMethodDeleteServiceAccount = "/deleteserviceaccount"
|
peerRESTMethodUpdateMetacacheListing = "/updatemetacache"
|
||||||
peerRESTMethodLoadPolicy = "/loadpolicy"
|
peerRESTMethodGetPeerMetrics = "/peermetrics"
|
||||||
peerRESTMethodLoadPolicyMapping = "/loadpolicymapping"
|
peerRESTMethodGetPeerBucketMetrics = "/peerbucketmetrics"
|
||||||
peerRESTMethodDeletePolicy = "/deletepolicy"
|
peerRESTMethodSpeedTest = "/speedtest"
|
||||||
peerRESTMethodLoadGroup = "/loadgroup"
|
peerRESTMethodDriveSpeedTest = "/drivespeedtest"
|
||||||
peerRESTMethodStartProfiling = "/startprofiling"
|
peerRESTMethodStopRebalance = "/stoprebalance"
|
||||||
peerRESTMethodDownloadProfilingData = "/downloadprofilingdata"
|
peerRESTMethodGetLastDayTierStats = "/getlastdaytierstats"
|
||||||
peerRESTMethodCycleBloom = "/cyclebloom"
|
peerRESTMethodDevNull = "/devnull"
|
||||||
peerRESTMethodTrace = "/trace"
|
peerRESTMethodNetperf = "/netperf"
|
||||||
peerRESTMethodListen = "/listen"
|
peerRESTMethodMetrics = "/metrics"
|
||||||
peerRESTMethodLog = "/log"
|
peerRESTMethodResourceMetrics = "/resourcemetrics"
|
||||||
peerRESTMethodGetLocalDiskIDs = "/getlocaldiskids"
|
peerRESTMethodGetReplicationMRF = "/getreplicationmrf"
|
||||||
peerRESTMethodGetBandwidth = "/bandwidth"
|
peerRESTMethodGetSRMetrics = "/getsrmetrics"
|
||||||
peerRESTMethodGetMetacacheListing = "/getmetacache"
|
|
||||||
peerRESTMethodUpdateMetacacheListing = "/updatemetacache"
|
|
||||||
peerRESTMethodGetPeerMetrics = "/peermetrics"
|
|
||||||
peerRESTMethodGetPeerBucketMetrics = "/peerbucketmetrics"
|
|
||||||
peerRESTMethodLoadTransitionTierConfig = "/loadtransitiontierconfig"
|
|
||||||
peerRESTMethodSpeedTest = "/speedtest"
|
|
||||||
peerRESTMethodDriveSpeedTest = "/drivespeedtest"
|
|
||||||
peerRESTMethodReloadSiteReplicationConfig = "/reloadsitereplicationconfig"
|
|
||||||
peerRESTMethodReloadPoolMeta = "/reloadpoolmeta"
|
|
||||||
peerRESTMethodLoadRebalanceMeta = "/loadrebalancemeta"
|
|
||||||
peerRESTMethodStopRebalance = "/stoprebalance"
|
|
||||||
peerRESTMethodGetLastDayTierStats = "/getlastdaytierstats"
|
|
||||||
peerRESTMethodDevNull = "/devnull"
|
|
||||||
peerRESTMethodNetperf = "/netperf"
|
|
||||||
peerRESTMethodMetrics = "/metrics"
|
|
||||||
peerRESTMethodResourceMetrics = "/resourcemetrics"
|
|
||||||
peerRESTMethodGetReplicationMRF = "/getreplicationmrf"
|
|
||||||
peerRESTMethodGetSRMetrics = "/getsrmetrics"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -41,12 +41,20 @@ if [ ! -f ./mc ]; then
|
|||||||
chmod +x mc
|
chmod +x mc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
minio server --config-dir /tmp/minio-internal --address ":9001" /tmp/minio-internal-idp1/{1...4} >/tmp/minio1_1.log 2>&1 &
|
minio server --config-dir /tmp/minio-internal --address ":9001" http://localhost:9001/tmp/minio-internal-idp1/{1...4} http://localhost:9010/tmp/minio-internal-idp1/{5...8} >/tmp/minio1_1.log 2>&1 &
|
||||||
site1_pid=$!
|
site1_pid1=$!
|
||||||
minio server --config-dir /tmp/minio-internal --address ":9002" /tmp/minio-internal-idp2/{1...4} >/tmp/minio2_1.log 2>&1 &
|
minio server --config-dir /tmp/minio-internal --address ":9010" http://localhost:9001/tmp/minio-internal-idp1/{1...4} http://localhost:9010/tmp/minio-internal-idp1/{5...8} >/tmp/minio1_2.log 2>&1 &
|
||||||
site2_pid=$!
|
site1_pid2=$!
|
||||||
minio server --config-dir /tmp/minio-internal --address ":9003" /tmp/minio-internal-idp3/{1...4} >/tmp/minio3_1.log 2>&1 &
|
|
||||||
site3_pid=$!
|
minio server --config-dir /tmp/minio-internal --address ":9002" http://localhost:9002/tmp/minio-internal-idp2/{1...4} http://localhost:9020/tmp/minio-internal-idp2/{5...8} >/tmp/minio2_1.log 2>&1 &
|
||||||
|
site2_pid1=$!
|
||||||
|
minio server --config-dir /tmp/minio-internal --address ":9020" http://localhost:9002/tmp/minio-internal-idp2/{1...4} http://localhost:9020/tmp/minio-internal-idp2/{5...8} >/tmp/minio2_2.log 2>&1 &
|
||||||
|
site2_pid2=$!
|
||||||
|
|
||||||
|
minio server --config-dir /tmp/minio-internal --address ":9003" http://localhost:9003/tmp/minio-internal-idp3/{1...4} http://localhost:9030/tmp/minio-internal-idp3/{5...8} >/tmp/minio3_1.log 2>&1 &
|
||||||
|
site3_pid1=$!
|
||||||
|
minio server --config-dir /tmp/minio-internal --address ":9030" http://localhost:9003/tmp/minio-internal-idp3/{1...4} http://localhost:9030/tmp/minio-internal-idp3/{5...8} >/tmp/minio3_2.log 2>&1 &
|
||||||
|
site3_pid2=$!
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
@ -54,8 +62,25 @@ export MC_HOST_minio1=http://minio:minio123@localhost:9001
|
|||||||
export MC_HOST_minio2=http://minio:minio123@localhost:9002
|
export MC_HOST_minio2=http://minio:minio123@localhost:9002
|
||||||
export MC_HOST_minio3=http://minio:minio123@localhost:9003
|
export MC_HOST_minio3=http://minio:minio123@localhost:9003
|
||||||
|
|
||||||
|
export MC_HOST_minio10=http://minio:minio123@localhost:9010
|
||||||
|
export MC_HOST_minio20=http://minio:minio123@localhost:9020
|
||||||
|
export MC_HOST_minio30=http://minio:minio123@localhost:9030
|
||||||
|
|
||||||
./mc admin replicate add minio1 minio2
|
./mc admin replicate add minio1 minio2
|
||||||
|
|
||||||
|
site_enabled=$(./mc admin replicate info minio1)
|
||||||
|
site_enabled_peer=$(./mc admin replicate info minio10)
|
||||||
|
|
||||||
|
[[ $site_enabled =~ "is not enabled" ]] && {
|
||||||
|
echo "expected both peers to have same information"
|
||||||
|
exit_1
|
||||||
|
}
|
||||||
|
|
||||||
|
[[ $site_enabled_peer =~ "is not enabled" ]] && {
|
||||||
|
echo "expected both peers to have same information"
|
||||||
|
exit_1
|
||||||
|
}
|
||||||
|
|
||||||
./mc admin user add minio1 foobar foo12345
|
./mc admin user add minio1 foobar foo12345
|
||||||
|
|
||||||
## add foobar-g group with foobar
|
## add foobar-g group with foobar
|
||||||
@ -361,7 +386,8 @@ if [ "${policy}" != "null" ]; then
|
|||||||
exit_1
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
kill -9 ${site1_pid}
|
kill -9 ${site1_pid1} ${site1_pid2}
|
||||||
|
|
||||||
# Update tag on minio2/newbucket when minio1 is down
|
# Update tag on minio2/newbucket when minio1 is down
|
||||||
./mc tag set minio2/newbucket "key=val2"
|
./mc tag set minio2/newbucket "key=val2"
|
||||||
# create a new bucket on minio2. This should replicate to minio1 after it comes online.
|
# create a new bucket on minio2. This should replicate to minio1 after it comes online.
|
||||||
@ -371,7 +397,8 @@ kill -9 ${site1_pid}
|
|||||||
./mc rb minio2/bucket2
|
./mc rb minio2/bucket2
|
||||||
|
|
||||||
# Restart minio1 instance
|
# Restart minio1 instance
|
||||||
minio server --config-dir /tmp/minio-internal --address ":9001" /tmp/minio-internal-idp1/{1...4} >/tmp/minio1_1.log 2>&1 &
|
minio server --config-dir /tmp/minio-internal --address ":9001" http://localhost:9001/tmp/minio-internal-idp1/{1...4} http://localhost:9010/tmp/minio-internal-idp1/{5...8} >/tmp/minio1_1.log 2>&1 &
|
||||||
|
minio server --config-dir /tmp/minio-internal --address ":9010" http://localhost:9001/tmp/minio-internal-idp1/{1...4} http://localhost:9010/tmp/minio-internal-idp1/{5...8} >/tmp/minio1_2.log 2>&1 &
|
||||||
sleep 200
|
sleep 200
|
||||||
|
|
||||||
# Test whether most recent tag update on minio2 is replicated to minio1
|
# Test whether most recent tag update on minio2 is replicated to minio1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user