Questo contenuto non è disponibile nella lingua selezionata.
31.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).
31.3.1. Taking a Site Offline (Remote Client-Server Mode) Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
In Red Hat JBoss Data Grid's Remote Client-Server mode, the
take-offline element is added to the backup element to configure when a site is automatically taken offline.
Example 31.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.
31.3.2. Taking a Site Offline (Library Mode) Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
In Red Hat JBoss Data Grid's Library mode, use the
backupFor element after defining all back up sites within the backups element:
Example 31.3. Taking a Site Offline in Library Mode
<backup>
<takeOffline afterFailures="${NUM}"
minTimeToWait="${PERIOD}"/>
</backup>
<backup>
<takeOffline afterFailures="${NUM}"
minTimeToWait="${PERIOD}"/>
</backup>
Add the
takeOffline element to the backup element to configure automatically taking a site offline.
- The
afterFailuresparameter specifies the number of times attempts to contact a site can fail before the site is taken offline. The default value (0) allows an infinite number of failures ifminTimeToWaitis less than0. If theminTimeToWaitis not less than0,afterFailuresbehaves as if the value is negative. A negative value for this parameter indicates that the site is taken offline after the time specified byminTimeToWaitelapses. - The
minTimeToWaitparameter specifies the number (in milliseconds) to wait to mark an unresponsive site as offline. The site is taken offline after the number attempts specified in theafterFailuresparameter conclude and the time specified byminTimeToWaitafter the first failure has elapsed. If this parameter is set to a value smaller than or equal to0, this parameter is disregarded and the site is taken offline based solely on theafterFailuresparameter.
31.3.3. Taking a Site Offline (Programmatically) Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
To configure taking a Cross-datacenter replication site offline automatically in Red Hat JBoss Data Grid programmatically:
Example 31.4. Taking a Site Offline Programmatically
31.3.4. Taking a Site Offline via JBoss Operations Network (JON) Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
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 22.6.2, “JBoss Operations Network Plugin Operations”
31.3.5. Taking a Site Offline via the CLI Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
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 31.3.6, “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)
31.3.6. Bring a Site Back Online Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
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 31.3.5, “Taking a Site Offline via the CLI” for details).