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

安裝 Trident Protect CLI 外掛程式

貢獻者

您可以使用 Trident Protect 命令列外掛程式( Trident 公用程式的延伸 tridentctl)來建立自訂資源( CRS ),並與 Trident 互動。

安裝 Trident Protect CLI 外掛程式

在使用命令列公用程式之前,您必須先將其安裝在用來存取叢集的機器上。根據您的機器使用的是 x64 或 ARM CPU ,請遵循下列步驟。

步驟
  1. 下載 Trident Protect CLI 外掛程式:

    curl -L -o tridentctl-protect https://github.com/NetApp/tridentctl-protect/releases/download/25.02.0/tridentctl-protect-linux-amd64
    Console
  1. 啟用外掛程式二進位檔的執行權限:

    chmod +x tridentctl-protect
    Console
  2. 將外掛程式二進位檔複製到路徑變數中定義的位置。例如, /usr/bin`或 `/usr/local/bin(您可能需要提升的 Privileges ):

    cp ./tridentctl-protect /usr/local/bin/
    Console
  3. 您也可以選擇將外掛程式二進位檔複製到主目錄中的某個位置。在這種情況下,建議您確保位置是 PATH 變數的一部分:

    cp ./tridentctl-protect ~/bin/
    Console
註 將外掛程式複製到 PATH 變數中的某個位置,可讓您輸入或 tridentctl protect`從任何位置使用外掛程式 `tridentctl-protect

檢視 Trident CLI 外掛程式說明

您可以使用內建的外掛程式說明功能,取得外掛程式功能的詳細說明:

步驟
  1. 使用說明功能檢視使用指南:

    tridentctl-protect help
    Console

啟用命令自動完成

安裝 Trident Protect CLI 外掛程式之後,您可以啟用某些命令的自動完成功能。

步驟
  1. 下載完成指令碼:

    curl -L -O https://github.com/NetApp/tridentctl-protect/releases/download/25.02.0/tridentctl-completion.bash
    Console
  2. 在主目錄中建立新目錄以包含指令碼:

    mkdir -p ~/.bash/completions
    Console
  3. 將下載的指令碼移至 `~/.bash/completions`目錄:

    mv tridentctl-completion.bash ~/.bash/completions/
    Console
  4. 將下列行新增至 `~/.bashrc`主目錄中的檔案:

    source ~/.bash/completions/tridentctl-completion.bash
    Console
結果

下次登入 Shell 時,您可以將命令自動完成功能與 tridentctl-Protect 外掛程式搭配使用。