3.5 管理 iManager 資料儲存

Docker 磁碟區是永久儲存 iManager 資料與組態的優先使用機制。如需有關永久儲存的詳細資訊,請參閱在 Docker 中管理資料。

啟動期間會將需要永久儲存的 iManager 應用程式資料放置在 /config 目錄中。Docker 磁碟區必須掛接到 iManager 容器中的 /config 路徑,才能將資料永久儲存在容器外的 Docker 主機檔案系統中。即使因為系統管理之故停止或移除容器,磁碟區內的應用程式資料仍會保留。

此實務對於在升級 iManager 容器期間保留舊組態和資料很有用。如需升級 iManager 容器的資訊,請參閱使用 Docker 容器升級 iManager。

下列範例顯示如何建立名為 iManager-volume 的 Docker 磁碟區:

docker volume create iManager-volume

下列指令顯示如何啟動附有磁碟區的 iManager 容器以供儲存之用:

docker run -it --name=iMan320 --net=host --restart on-failure:5 --memory="1000M" --cpuset-cpus="2" --volume iManager-volume:/config --volume /path/to/iManager.env:/etc/opt/novell/iManager/conf/iManager.env imanager:3.2.0 

在上述指令中,iManager-volume 是所建立並掛接到 iManager 容器中 /config 位置的 Docker 磁碟區。

附註:設定 iManager 容器後,您必須使用 docker restart iMan320 指令將容器重新啟動,才能使用 iManager。

在 /config 下的套件目錄會保留外掛程式的 npm 檔案。升級容器時,如果該容器附有舊磁碟區,則將會從該磁碟區中重新安裝舊版外掛程式。