Skip to main content
本繁體中文版使用機器翻譯,譯文僅供參考,若與英文版本牴觸,應以英文版本為準。

部署 Trident

貢獻者 juliantap netapp-aruldeepa joan-ing netapp-mwallis

Trident for Docker 可直接與適用於 NetApp 儲存平台的 Docker 生態系統整合。它支援從儲存平台到Docker主機的儲存資源資源配置與管理、並提供架構、可在未來新增更多平台。

Trident 的多個執行個體可以同時在同一部主機上執行。這可同時連線至多個儲存系統和儲存類型、並可自訂Docker磁碟區所使用的儲存設備。

您需要的產品

請參閱"部署的先決條件"。在您確定符合先決條件之後、即可開始部署 Trident 。

Docker託管外掛程式方法(1.1/17.03版及更新版本)

註
開始之前
如果您在傳統的精靈方法中使用 Trident pred Docker 1.3/17.03 、請務必先停止 Trident 程序、然後重新啟動 Docker 精靈、再使用託管外掛程式方法。
  1. 停止所有執行中的執行個體:

    pkill /usr/local/bin/netappdvp
    pkill /usr/local/bin/trident
  2. 重新啟動Docker。

    systemctl restart docker
  3. 請確定您已安裝Docker Engine 17.03(全新1.13)或更新版本。

    docker --version

    如果您的版本過時、 "安裝或更新安裝"。

步驟
  1. 建立組態檔並指定下列選項:

    • 「config」:預設檔案名稱為「config.json」、但您可以使用任何名稱、只要在檔案名稱中指定「config」選項即可。組態檔必須位於主機系統的「/etc/netappdvp」目錄中。

    • 記錄層級:指定記錄層級(「debug」、「info」、「warn」、「f誤差」、「fatal」)。預設值為「資訊」。

    • 「Debug」:指定是否啟用偵錯記錄。預設值為假。如果為true、則會置換記錄層級。

      1. 建立組態檔的位置:

        sudo mkdir -p /etc/netappdvp
      2. 建立組態檔:

        cat << EOF > /etc/netappdvp/config.json
        {
          "version": 1,
          "storageDriverName": "ontap-nas",
          "managementLIF": "10.0.0.1",
          "dataLIF": "10.0.0.2",
          "svm": "svm_nfs",
          "username": "vsadmin",
          "password": "password",
          "aggregate": "aggr1"
        }
        EOF
  2. 使用託管外掛程式系統啟動 Trident 。請以您使用的外掛程式版本( xxx.xxx.x )取代 <version>。

    docker plugin install --grant-all-permissions --alias netapp netapp/trident-plugin:<version> config=myConfigFile.json
  3. 開始使用 Trident 從設定的系統中消耗儲存設備。

    1. 建立名為「firstVolume」的Volume:

      docker volume create -d netapp --name firstVolume
    2. 在容器啟動時建立預設Volume:

      docker run --rm -it --volume-driver netapp --volume secondVolume:/my_vol alpine ash
    3. 移除Volume「firstVolume」:

      docker volume rm firstVolume

傳統方法(1.12版或更早版本)

開始之前
  1. 請確定您擁有Docker 1.10版或更新版本。

    docker --version

    如果您的版本已過時、請更新安裝。

    curl -fsSL https://get.docker.com/ | sh
  2. 確保已為您的系統設定NFS和/或iSCSI。

步驟
  1. 安裝及設定NetApp Docker Volume外掛程式:

    1. 下載並解壓縮應用程式:

      ----trident-installer-26.10.1.tar.gz
      wget https://github.com/NetApp/trident/releases/download/10.0/
      tar zxf trident-installer-26.10.1.tar.gz
.. Move to a location in the bin path:
+
[source,console]

sudo mv trident-installer/extras/bin/trident /usr/local/bin/ sudo chown root:root /usr/local/bin/trident sudo chmod 755 /usr/local/bin/trident

.. Create a location for the configuration file:
+
[source,console]

sudo mkdir -p /etc/netappdvp

.. Create the configuration file:
+
[source,console]

cat << EOF > /etc/netappdvp/ontap-nas.json

+
[source,json]

{ "version": 1, "storageDriverName": "ontap-nas", "managementLIF": "10.0.0.1", "dataLIF": "10.0.0.2", "svm": "svm_nfs", "username": "vsadmin", "password": "password", "aggregate": "aggr1" } EOF

. After placing the binary and creating the configuration file, start the Trident daemon using the desired configuration file.
+
[source,console]

sudo trident --config=/etc/netappdvp/ontap-nas.json

+
NOTE: Unless specified, the default name for the volume driver is "netapp".
+
After the daemon is started, you can create and manage volumes by using the Docker CLI interface.

. Create a volume:
+
[source,console]

docker volume create -d netapp --name trident_1

. Provision a Docker volume when starting a container:
+
[source,console]

docker run --rm -it --volume-driver netapp --volume trident_2:/my_vol alpine ash

. Remove a Docker volume:
+
[source,console]

docker volume rm trident_1

+
[source,console]

docker volume rm trident_2

== Start Trident at system startup

A sample unit file for systemd based systems can be found at `contrib/trident.service.example` in the Git repo. To use the file with RHEL, do the following:

. Copy the file to the correct location.
+
You should use unique names for the unit files if you have more than one instance running.
+
[source,console]

cp contrib/trident.service.example /usr/lib/systemd/system/trident.service

. Edit the file, change the description (line 2) to match the driver name and the configuration file path (line 9) to reflect your environment.
. Reload systemd for it to ingest changes:
+
[source,console]

systemctl daemon-reload

. Enable the service.
+
This name varies depending on what you named the file in the `/usr/lib/systemd/system` directory.
+
[source,console]

systemctl enable trident

. Start the service.
+
[source,console]

systemctl start trident

. View the status.
+
[source,console]

systemctl status trident

NOTE: Any time you modify the unit file, run the `systemctl daemon-reload` command for it to be aware of the changes.