Hot-Spares können mit einer der folgenden Methoden aktiviert werden:
Manueller Austausch – Mithilfe des Befehls zpool replace können Sie ein ausgefallenes Gerät im Speicher-Pool durch ein Hot-Spare ersetzen.
Automatischer Austausch – Wenn ein Fehler erkannt wird, überprüft ein FMA-Agent den Pool, um festzustellen, ob dieser verfügbare Hot-Spares enthält. Wenn dies der Fall ist, ersetzt er das fehlerhafte Gerät durch ein verfügbares Ersatzgerät.
Falls ein gerade verwendetes Hot-Spare ausfällt, trennt der FMA-Agent das Ersatzgerät ab und macht den Austausch somit rückgängig. Dann versucht der Agent, das Datenspeichergerät mit einem anderen Hot-Spare zu ersetzen, falls dies möglich ist. Diese Funktion ist gegenwärtig Beschränkungen unterworfen, da das ZFS-Diagnoseprogramm nur Fehler generiert, wenn ein Datenspeichergerät aus dem System verschwindet.
Wenn Sie ein ausgefallenes Datenspeichergerät physisch durch ein aktives Ersatzgerät ersetzen, können Sie das ursprüngliche Gerät wieder aktivieren, indem Sie das Ersatzgerät mithilfe des Befehls zpool detach abtrennen. Wenn Sie die Eigenschaft autoreplace des Pools auf on setzen, wird das Ersatzgerät automatisch getrennt und wieder in den Ersatzgeräte-Pool zurückgeführt, sobald das neue Datenspeichergerät eingesetzt und die Inbetriebnahme abgeschlossen ist.
Mit dem Befehl zpool replace können Sie ein Datenspeichergerät manuell durch ein Hot-Spare ersetzen. Siehe Beispiel 4–8.
Ein fehlerhaftes Datenspeichergerät wird automatisch ausgetauscht, wenn ein Hot-Spare verfügbar ist. Beispiel:
# zpool status -x pool: zeepool state: DEGRADED status: One or more devices could not be opened. Sufficient replicas exist for the pool to continue functioning in a degraded state. action: Attach the missing device and online it using 'zpool online'. see: http://www.sun.com/msg/ZFS-8000-2Q scrub: resilver completed after 0h0m with 0 errors on Mon Jan 11 10:20:35 2010 config: NAME STATE READ WRITE CKSUM zeepool DEGRADED 0 0 0 mirror-0 DEGRADED 0 0 0 c1t2d0 ONLINE 0 0 0 spare-1 DEGRADED 0 0 0 c2t1d0 UNAVAIL 0 0 0 cannot open c2t3d0 ONLINE 0 0 0 88.5K resilvered spares c2t3d0 INUSE currently in use errors: No known data errors |
Derzeit können Sie ein Hot-Spare wie folgt deaktivieren:
Durch Entfernen des Hot-Spares aus dem Speicher-Pool.
Durch Trennen eines Hot-Spares, nachdem eine ausgefallene Festplatte physisch ersetzt wurde. Siehe Beispiel 4–9.
Durch temporäres oder dauerhaftes ?Einlagern“ (Swap-in) des Hot-Spares. Siehe Beispiel 4–10.
In diesem Beispiel wird der Befehl zpool replace verwendet, um die Festplatte c2t1d0 durch das Hot-Spare c2t3d0 zu ersetzen.
# zpool replace zeepool c2t1d0 c2t3d0 # zpool status zeepool pool: zeepool state: ONLINE scrub: resilver completed after 0h0m with 0 errors on Wed Jan 20 10:00:50 2010 config: NAME STATE READ WRITE CKSUM zeepool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c1t2d0 ONLINE 0 0 0 spare-1 ONLINE 0 0 0 c2t1d0 ONLINE 0 0 0 c2t3d0 ONLINE 0 0 0 90K resilvered spares c2t3d0 INUSE currently in use errors: No known data errors |
Dann trennen Sie die Festplatte c2t1d0.
# zpool detach zeepool c2t1d0 # zpool status zeepool pool: zeepool state: ONLINE scrub: resilver completed after 0h0m with 0 errors on Wed Jan 20 10:00:50 2010 config: NAME STATE READ WRITE CKSUM zeepool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c1t2d0 ONLINE 0 0 0 c2t3d0 ONLINE 0 0 0 90K resilvered errors: No known data errors |
In diesem Beispiel wird die ausgefallene Festplatte (c2t1d0) physisch ersetzt, und ZFS wird benachrichtig. Dazu wird der Befehl zpool replace verwendet.
# zpool replace zeepool c2t1d0 # zpool status zeepool pool: zeepool state: ONLINE scrub: resilver completed after 0h0m with 0 errors on Wed Jan 20 10:08:44 2010 config: NAME STATE READ WRITE CKSUM zeepool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c1t2d0 ONLINE 0 0 0 spare-1 ONLINE 0 0 0 c2t3d0 ONLINE 0 0 0 90K resilvered c2t1d0 ONLINE 0 0 0 spares c2t3d0 INUSE currently in use errors: No known data errors |
Danach können Sie den Befehl zpool detach verwenden, um das Hot-Spare in den Ersatzgeräte-Pool zurückzuführen. Beispiel:
# zpool detach zeepool c2t3d0 # zpool status zeepool pool: zeepool state: ONLINE scrub: resilver completed with 0 errors on Wed Jan 20 10:08:44 2010 config: NAME STATE READ WRITE CKSUM zeepool ONLINE 0 0 0 mirror ONLINE 0 0 0 c1t2d0 ONLINE 0 0 0 c2t1d0 ONLINE 0 0 0 spares c2t3d0 AVAIL errors: No known data errors |
Wenn Sie eine ausgefallene Festplatte durch temporäres oder dauerhaftes Einlagern des Hot-Spares, das die ausgefallene Festplatte gerade ersetzt, ersetzen möchten, trennen Sie die ursprüngliche (ausgefallene) Festplatte. Wenn die ausgefallene Festplatte schließlich ersetzt ist, können Sie sie wieder in den Speicher-Pool zurückführen, wo sie als Ersatzfestplatte verfügbar ist. Beispiel:
# zpool status zeepool pool: zeepool state: DEGRADED status: One or more devices could not be opened. Sufficient replicas exist for the pool to continue functioning in a degraded state. action: Attach the missing device and online it using 'zpool online'. see: http://www.sun.com/msg/ZFS-8000-2Q scrub: resilver in progress for 0h0m, 70.47% done, 0h0m to go config: NAME STATE READ WRITE CKSUM zeepool DEGRADED 0 0 0 mirror-0 DEGRADED 0 0 0 c1t2d0 ONLINE 0 0 0 spare-1 DEGRADED 0 0 0 c2t1d0 UNAVAIL 0 0 0 cannot open c2t3d0 ONLINE 0 0 0 70.5M resilvered spares c2t3d0 INUSE currently in use errors: No known data errors # zpool detach zeepool c2t1d0 # zpool status zeepool pool: zeepool state: ONLINE scrub: resilver completed after 0h0m with 0 errors on Wed Jan 20 13:46:46 2010 config: NAME STATE READ WRITE CKSUM zeepool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c1t2d0 ONLINE 0 0 0 c2t3d0 ONLINE 0 0 0 70.5M resilvered errors: No known data errors (Original failed disk c2t1d0 is physically replaced) # zpool add zeepool spare c2t1d0 # zpool status zeepool pool: zeepool state: ONLINE scrub: resilver completed after 0h0m with 0 errors on Wed Jan 20 13:48:46 2010 config: NAME STATE READ WRITE CKSUM zeepool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c1t2d0 ONLINE 0 0 0 c2t3d0 ONLINE 0 0 0 70.5M resilvered spares c2t1d0 AVAIL errors: No known data errors |