Ce contenu n'est pas disponible dans la langue sélectionnée.
35.3. Taking a Site Offline
In Red Hat JBoss Data Grid's Cross-datacenter replication configuration, if backing up to one site fails a certain number of times during a time interval, that site can be marked as offline automatically. This feature removes the need for manual intervention by an administrator to mark the site as offline.
It is possible to configure JBoss Data Grid to take down a site automatically when specified conditions are met, or for an administrator to manually take down a site:
- Configure automatically taking a site offline:
- Declaratively in Remote Client-Server mode.
- Declaratively in Library mode.
- Using the programmatic method.
- Manually taking a site offline:
- Using JBoss Operations Network (JON).
- Using the JBoss Data Grid Command Line Interface (CLI).
35.3.1. Taking a Site Offline Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
To take a site offline in either mode of Red Hat JBoss Data Grid's add the
take-offline element to the backup element. This will configure when a site is automatically taken offline.
Example 35.2. Taking a Site Offline in Remote Client-Server Mode
<backup>
<take-offline after-failures="${NUMBER}"
min-wait="${PERIOD}" />
</backup>
<backup>
<take-offline after-failures="${NUMBER}"
min-wait="${PERIOD}" />
</backup>
The
take-offline element use the following parameters to configure when to take a site offline:
- The
after-failuresparameter specifies the number of times attempts to contact a site can fail before the site is taken offline. - The
min-waitparameter specifies the number (in milliseconds) to wait to mark an unresponsive site as offline. The site is offline when themin-waitperiod elapses after the first attempt, and the number of failed attempts specified in theafter-failuresparameter occur.
35.3.2. Taking a Site Offline via JBoss Operations Network (JON) Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
A site can be taken offline in Red Hat JBoss Data Grid using the JBoss Operations Network operations. For a list of the metrics, see Section 23.6.2, “JBoss Operations Network Plugin Operations”
35.3.3. Taking a Site Offline via the CLI Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
Use Red Hat JBoss Data Grid's Command Line Interface (CLI) to manually take a site from a cross-datacenter replication configuration down if it is unresponsive using the
site command.
The
site command can be used to check the status of a site as follows:
[jmx://localhost:12000/MyCacheManager/namedCache]> site --status ${SITENAME}
[jmx://localhost:12000/MyCacheManager/namedCache]> site --status ${SITENAME}
The result of this command would either be
online or offline according to the current status of the named site.
The command can be used to bring a site online or offline by name as follows:
[jmx://localhost:12000/MyCacheManager/namedCache]> site --offline ${SITENAME}
[jmx://localhost:12000/MyCacheManager/namedCache]> site --offline ${SITENAME}
[jmx://localhost:12000/MyCacheManager/namedCache]> site --online ${SITENAME}
[jmx://localhost:12000/MyCacheManager/namedCache]> site --online ${SITENAME}
If the command is successful, the output
ok displays after the command. As an alternate, the site can also be brought online using JMX (see Section 35.3.4, “Bring a Site Back Online” for details).
For more information about the JBoss Data Grid CLI and its commands, see the Developer Guide's chapter on the JBoss Data Grid Command Line Interface (CLI)
35.3.4. Bring a Site Back Online Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
After a site is taken offline, the site can be brought back online either using the JMX console to invoke the
bringSiteOnline(siteName) operation on the XSiteAdmin MBean (See Section C.23, “XSiteAdmin” for details) or using the CLI (see Section 35.3.3, “Taking a Site Offline via the CLI” for details).