이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 4. Performing Cross-Site Replication Operations
Bring sites online and offline. Transfer cache state to remote sites.
4.1. Cross-Site Operations with the CLI 링크 복사링크가 클립보드에 복사되었습니다!
The Data Grid command line interface lets you remotely connect to Data Grid servers, manage sites, and push state transfer to backup locations.
Prerequisites
- Start the Data Grid CLI.
- Connect to a running Data Grid cluster.
4.1.1. Bringing Backup Locations Offline and Online 링크 복사링크가 클립보드에 복사되었습니다!
Take backup locations offline manually and bring them back online.
Procedure
Check if backup locations are online or offline with the
site statuscommand://containers/default]> site status --cache=cacheName --site=NYC
//containers/default]> site status --cache=cacheName --site=NYCCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note--siteis an optional argument. If not set, the CLI returns all backup locations.Bring backup locations online with the
bring-onlinecommand://containers/default]> site bring-online --cache=customers --site=NYC
//containers/default]> site bring-online --cache=customers --site=NYCCopy to Clipboard Copied! Toggle word wrap Toggle overflow Take backup locations offline with the
take-offlinecommand://containers/default]> site take-offline --cache=customers --site=NYC
//containers/default]> site take-offline --cache=customers --site=NYCCopy to Clipboard Copied! Toggle word wrap Toggle overflow
For more information and examples, run the help site command.
4.1.2. Pushing State to Backup Locations 링크 복사링크가 클립보드에 복사되었습니다!
Transfer cache state to remote backup locations.
Procedure
Use the
sitecommand to push state transfer, as in the following example://containers/default]> site push-site-state --cache=cacheName --site=NYC
//containers/default]> site push-site-state --cache=cacheName --site=NYCCopy to Clipboard Copied! Toggle word wrap Toggle overflow
For more information and examples, run the help site command.
Reference
4.2. Cross-Site Operations with the REST API 링크 복사링크가 클립보드에 복사되었습니다!
Data Grid servers provide a REST API that allows you to perform cross-site operations.
4.2.1. Getting Status of All Backup Locations 링크 복사링크가 클립보드에 복사되었습니다!
Retrieve the status of all backup locations with GET requests.
GET /v2/caches/{cacheName}/x-site/backups/
GET /v2/caches/{cacheName}/x-site/backups/
Data Grid responds with the status of each backup location in JSON format, as in the following example:
{
"NYC": "online",
"LON": "offline"
}
{
"NYC": "online",
"LON": "offline"
}
| Value | Description |
|---|---|
|
| All nodes in the local cluster have a cross-site view with the backup location. |
|
| No nodes in the local cluster have a cross-site view with the backup location. |
|
| Some nodes in the local cluster have a cross-site view with the backup location, other nodes in the local cluster do not have a cross-site view. The response indicates status for each node. |
4.2.2. Getting Status of Specific Backup Locations 링크 복사링크가 클립보드에 복사되었습니다!
Retrieve the status of a backup location with GET requests.
GET /v2/caches/{cacheName}/x-site/backups/{siteName}
GET /v2/caches/{cacheName}/x-site/backups/{siteName}
Data Grid responds with the status of each node in the site in JSON format, as in the following example:
{
"NodeA":"offline",
"NodeB":"online"
}
{
"NodeA":"offline",
"NodeB":"online"
}
| Value | Description |
|---|---|
|
| The node is online. |
|
| The node is offline. |
|
| Not possible to retrieve status. The remote cache could be shutting down or a network error occurred during the request. |
4.2.3. Taking Backup Locations Offline 링크 복사링크가 클립보드에 복사되었습니다!
Take backup locations offline with GET requests and the ?action=take-offline parameter.
GET /v2/caches/{cacheName}/x-site/backups/{siteName}?action=take-offline
GET /v2/caches/{cacheName}/x-site/backups/{siteName}?action=take-offline
4.2.4. Bringing Backup Locations Online 링크 복사링크가 클립보드에 복사되었습니다!
Bring backup locations online with the ?action=bring-online parameter.
GET /v2/caches/{cacheName}/x-site/backups/{siteName}?action=bring-online
GET /v2/caches/{cacheName}/x-site/backups/{siteName}?action=bring-online
4.2.5. Pushing State to Backup Locations 링크 복사링크가 클립보드에 복사되었습니다!
Push cache state to a backup location with the ?action=start-push-state parameter.
GET /v2/caches/{cacheName}/x-site/backups/{siteName}?action=start-push-state
GET /v2/caches/{cacheName}/x-site/backups/{siteName}?action=start-push-state
4.2.6. Canceling State Transfer 링크 복사링크가 클립보드에 복사되었습니다!
Cancel state transfer operations with the ?action=cancel-push-state parameter.
GET /v2/caches/{cacheName}/x-site/backups/{siteName}?action=cancel-push-state
GET /v2/caches/{cacheName}/x-site/backups/{siteName}?action=cancel-push-state
4.2.7. Getting State Transfer Status 링크 복사링크가 클립보드에 복사되었습니다!
Retrieve status of state transfer operations with the ?action=push-state-status parameter.
GET /v2/caches/{cacheName}/x-site/backups?action=push-state-status
GET /v2/caches/{cacheName}/x-site/backups?action=push-state-status
Data Grid responds with the status of state transfer for each backup location in JSON format, as in the following example:
{
"NYC":"CANCELED",
"LON":"OK"
}
{
"NYC":"CANCELED",
"LON":"OK"
}
| Value | Description |
|---|---|
|
| State transfer to the backup location is in progress. |
|
| State transfer completed successfully. |
|
| An error occurred with state transfer. Check log files. |
|
| State transfer cancellation is in progress. |
4.2.8. Clearing State Transfer Status 링크 복사링크가 클립보드에 복사되었습니다!
Clear state transfer status for sending sites with the ?action=clear-push-state-status parameter.
GET /v2/caches/{cacheName}/x-site/local?action=clear-push-state-status
GET /v2/caches/{cacheName}/x-site/local?action=clear-push-state-status
4.2.9. Modifying Take Offline Conditions 링크 복사링크가 클립보드에 복사되었습니다!
Sites go offline if certain conditions are met. Modify the take offline parameters to control when backup locations automatically go offline.
Procedure
Check configured take offline parameters with
GETrequests and thetake-offline-configparameter.GET /v2/caches/{cacheName}/x-site/backups/{siteName}/take-offline-configGET /v2/caches/{cacheName}/x-site/backups/{siteName}/take-offline-configCopy to Clipboard Copied! Toggle word wrap Toggle overflow The Data Grid response includes
after_failuresandmin_waitfields as follows:{ "after_failures": 2, "min_wait": 1000 }{ "after_failures": 2, "min_wait": 1000 }Copy to Clipboard Copied! Toggle word wrap Toggle overflow Modify take offline parameters in the body of
PUTrequests.PUT /v2/caches/{cacheName}/x-site/backups/{siteName}/take-offline-configPUT /v2/caches/{cacheName}/x-site/backups/{siteName}/take-offline-configCopy to Clipboard Copied! Toggle word wrap Toggle overflow
4.2.10. Canceling State Transfer from Receiving Sites 링크 복사링크가 클립보드에 복사되었습니다!
If the connection between two backup locations breaks, you can cancel state transfer on the site that is receiving the push.
Cancel state transfer from a remote site and keep the current state of the local cache with the ?action=cancel-receive-state parameter.
GET /v2/caches/{cacheName}/x-site/backups/{siteName}?action=cancel-receive-state
GET /v2/caches/{cacheName}/x-site/backups/{siteName}?action=cancel-receive-state
4.2.11. Getting Status of Backup Locations 링크 복사링크가 클립보드에 복사되었습니다!
Retrieve the status of all backup locations from Cache Managers with GET requests.
GET /rest/v2/cache-managers/{cacheManagerName}/x-site/backups/
GET /rest/v2/cache-managers/{cacheManagerName}/x-site/backups/
Data Grid responds with status in JSON format, as in the following example:
| Value | Description |
|---|---|
|
| All nodes in the local cluster have a cross-site view with the backup location. |
|
| No nodes in the local cluster have a cross-site view with the backup location. |
|
| Some nodes in the local cluster have a cross-site view with the backup location, other nodes in the local cluster do not have a cross-site view. The response indicates status for each node. |
4.2.12. Taking Backup Locations Offline 링크 복사링크가 클립보드에 복사되었습니다!
Take backup locations offline with the ?action=take-offline parameter.
GET /rest/v2/cache-managers/{cacheManagerName}/x-site/backups/{siteName}?action=take-offline
GET /rest/v2/cache-managers/{cacheManagerName}/x-site/backups/{siteName}?action=take-offline
4.2.13. Bringing Backup Locations Online 링크 복사링크가 클립보드에 복사되었습니다!
Bring backup locations online with the ?action=bring-online parameter.
GET /rest/v2/cache-managers/{cacheManagerName}/x-site/backups/{siteName}?action=bring-online
GET /rest/v2/cache-managers/{cacheManagerName}/x-site/backups/{siteName}?action=bring-online
4.2.14. Starting State Transfer 링크 복사링크가 클립보드에 복사되었습니다!
Push state of all caches to remote sites with the ?action=start-push-state parameter.
GET /rest/v2/cache-managers/{cacheManagerName}/x-site/backups/{siteName}?action=start-push-state
GET /rest/v2/cache-managers/{cacheManagerName}/x-site/backups/{siteName}?action=start-push-state
4.2.15. Canceling State Transfer 링크 복사링크가 클립보드에 복사되었습니다!
Cancel ongoing state transfer operations with the ?action=cancel-push-state parameter.
GET /rest/v2/cache-managers/{cacheManagerName}/x-site/backups/{siteName}?action=cancel-push-state
GET /rest/v2/cache-managers/{cacheManagerName}/x-site/backups/{siteName}?action=cancel-push-state