Skip to main content
La versione in lingua italiana fornita proviene da una traduzione automatica. Per eventuali incoerenze, fare riferimento alla versione in lingua inglese.

Implementa Trident

Collaboratori juliantap netapp-aruldeepa joan-ing netapp-mwallis

Trident per Docker offre un'integrazione diretta con l'ecosistema Docker per le piattaforme storage NetApp. Supporta il provisioning e la gestione delle risorse di storage dalla piattaforma di storage agli host Docker, con un framework per aggiungere altre piattaforme in futuro.

È possibile eseguire più istanze di Trident contemporaneamente sullo stesso host. Ciò consente connessioni simultanee a più sistemi di storage e tipi di storage, con l'abilità di personalizzare lo storage utilizzato per i volumi Docker.

Di cosa hai bisogno

Consultare la "prerequisiti per l'implementazione". Una volta soddisfatti i prerequisiti, è possibile distribuire Trident.

Metodo del plugin gestito da Docker (versione 1.13/17.03 e successive)

Nota
Prima di iniziare
Se è stato utilizzato Trident pre Docker 1,13/17,03 nel metodo daemon tradizionale, prima di utilizzare il metodo plugin gestito, è necessario arrestare il processo Trident e riavviare il daemon Docker.
  1. Arrestare tutte le istanze in esecuzione:

    pkill /usr/local/bin/netappdvp
    pkill /usr/local/bin/trident
  2. Riavviare Docker.

    systemctl restart docker
  3. Assicurarsi di avere installato Docker Engine 17.03 (nuovo 1.13) o versione successiva.

    docker --version

    Se la versione non è aggiornata, "installare o aggiornare l'installazione".

Fasi
  1. Creare un file di configurazione e specificare le opzioni come segue:

    • config: Il nome file predefinito è config.json, tuttavia, è possibile utilizzare qualsiasi nome scegliendo specificando il config con il nome del file. Il file di configurazione deve trovarsi in /etc/netappdvp directory sul sistema host.

    • log-level: Specificare il livello di registrazione (debug, info, warn, error, fatal). L'impostazione predefinita è info.

    • debug: Specificare se la registrazione di debug è attivata. Il valore predefinito è false. Sovrascrive log-level se true.

      1. Creare un percorso per il file di configurazione:

        sudo mkdir -p /etc/netappdvp
      2. Creare il file di configurazione:

        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. Avviare Trident utilizzando il sistema di plugin gestito. Sostituire <version> con la versione del plugin (xxx.xx.x) in uso.

    docker plugin install --grant-all-permissions --alias netapp netapp/trident-plugin:<version> config=myConfigFile.json
  3. Iniziare a utilizzare Trident per utilizzare storage dal sistema configurato.

    1. Creare un volume denominato "firstVolume":

      docker volume create -d netapp --name firstVolume
    2. Creare un volume predefinito all'avvio del container:

      docker run --rm -it --volume-driver netapp --volume secondVolume:/my_vol alpine ash
    3. Rimuovere il volume "firstVolume":

      docker volume rm firstVolume

Metodo tradizionale (versione 1.12 o precedente)

Prima di iniziare
  1. Assicurarsi di disporre di Docker versione 1.10 o successiva.

    docker --version

    Se la versione non è aggiornata, aggiornare l'installazione.

    curl -fsSL https://get.docker.com/ | sh
  2. Assicurarsi che NFS e/o iSCSI siano configurati per il sistema.

Fasi
  1. Installare e configurare il plug-in NetApp Docker Volume:

    1. Scaricare e disimballare l'applicazione:

      ----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.