• 検索結果がありません。

gdeploy を使用した NFS Ganesha のデプロイ

ドキュメント内 管理ガイド (ページ 60-67)

第 5 章 ストレージボリュームの設定

5.1. GDEPLOY を使用した GLUSTER ストレージボリュームの設定

5.1.8. gdeploy を使用した NFS Ganesha のデプロイ

gdeploy は、gdeploy バージョン 2.0.2-35 からの Red Hat Gluster Storage 3.5 での NFS Ganesha のデ プロイメントおよび設定をサポートします。

NFS-Ganesha は、NFS プロトコル用のユーザー空間ファイルサーバーです。NFS-Ganesha の詳細は

を参照してください。

https://access.redhat.com/documentation/en-us/red_hat_gluster_storage/3.5/html-single/administration_guide/#nfs_ganesha

5.1.8.1. 前提条件前提条件

以下の前提条件を満たしていることを確認します。

Subscription Manager のサブスクライブのサブスクライブ

さらに続行するには、サブスクリプションマネージャーをサブスクライブし、NFS Ganesha パッケー ジを取得する必要があります。

以下の詳細を設定ファイルに追加し、サブスクリプションマネージャーにサブスクライブします。

[RH-subscription1]

action=register

username=<user>@redhat.com password=<password>

pool=<pool-id>

以下のコマンドを実行して設定ファイルを実行します。

# gdeploy -c txt.conf リポジトリーの有効化 リポジトリーの有効化

必要なリポジトリーを有効にするには、設定ファイルに以下の詳細を追加します。

[RH-subscription2]

action=enable-repos

repos=rhel-7-server-rpms,rh-gluster-3-for-rhel-7-server-rpms,rh-gluster-3-nfs-for-rhel-7-server-rpms,rhel-ha-for-rhel-7-server-rpms,rhel-7-server-ansible-2-rpms

以下のコマンドを実行して設定ファイルを実行します。

# gdeploy -c txt.conf

ファイアウォールポートの有効化 ファイアウォールポートの有効化

ファイアウォールポートを有効にするには、設定ファイルに以下の詳細を追加します。

[firewalld]

action=add

ports=111/tcp,2049/tcp,54321/tcp,5900/tcp,5900-6923/tcp,5666/tcp,16514/tcp services=glusterfs,nlm,nfs,rpc-bind,high-availability,mountd,rquota

注記 注記

NFS クライアントの UDP マウントが失敗するようにするには、gdeploy の [firewalld]

セクションにポート 2049/udp を追加するようにしてください。

以下のコマンドを実行して設定ファイルを実行します。

# gdeploy -c txt.conf

必要なパッケージをインストールします。

必要なパッケージをインストールします。

必要なパッケージをインストールするには、設定ファイルに以下の詳細を追加します。

[yum]

action=install repolist=

gpgcheck=no update=no

packages=glusterfs-ganesha

以下のコマンドを実行して設定ファイルを実行します。

# gdeploy -c txt.conf

5.1.8.2. サポート対象のアクションサポート対象のアクション

gdeploy の NFS Ganesha モジュールを使用すると、ユーザーは以下の操作を実行できます。

クラスターの作成 クラスターの破棄 ノードの追加 ノードの削除

ボリュームのエクスポート ボリュームのエクスポート解除 NFS Ganesha 設定の更新 クラスターの作成

クラスターの作成

このアクションにより、指定のボリュームに新しい NFS-Ganesha 設定が作成されます。このアクショ ンでは、設定ファイルセクションの nfs-ganesha が以下の変数に対応します。

ha-name: これはオプションの変数です。デフォルトは ganesha-ha-360 です。

cluster-nodes: これは必須引数です。この変数では、クラスターを形成するために使用されるク

ラスターノード名のコンマ区切りの値が必要です。

vip: これは必須引数です。この変数には、IP アドレスのコンマ区切りリストが必要です。これ

らは仮想 IP アドレスになります。

volname: 設定に [volume] セクションが含まれている場合に任意の変数です。

たとえば、NFS-Ganesha クラスターを作成するには、設定ファイルに以下の詳細を追加します。

[hosts]

host-1.example.com host-2.example.com host-3.example.com host-4.example.com [backend-setup]

devices=/dev/vdb vgs=vg1

pools=pool1 lvs=lv1

mountpoints=/mnt/brick

[firewalld]

action=add

ports=111/tcp,2049/tcp,54321/tcp,5900/tcp,5900-6923/tcp,5666/tcp,16514/tcp,662/tcp,662/udp services=glusterfs,nlm,nfs,rpc-bind,high-availability,mountd,rquota

[volume]

action=create volname=ganesha transport=tcp replica_count=3 force=yes

#Creating a high availability cluster and exporting the volume [nfs-ganesha]

action=create-cluster ha-name=ganesha-ha-360

cluster-nodes=host-1.example.com,host-2.example.com,host-3.example.com,host-4 .example.com vip=10.70.44.121,10.70.44.122

volname=ganesha

ignore_ganesha_errors=no

上記の例では、必要なパッケージがインストールされ、ボリュームが作成され、NFS-Ganesha が有効 になります。

以下のコマンドを使用して設定を実行します。

# gdeploy -c txt.conf クラスターの破棄 クラスターの破棄

destroy-cluster クラスターは、NFS Ganesha を無効にします。1 つの変数を許可し cluster-nodesま す。

たとえば、NFS-Ganesha クラスターを破棄するには、設定ファイルに以下の詳細を追加します。

[hosts]

host-1.example.com host-2.example.com

# To destroy the high availability cluster [nfs-ganesha]

action=destroy-cluster

cluster-nodes=host-1.example.com,host-2.example.com 以下のコマンドを使用して設定を実行します。

# gdeploy -c txt.conf ノードの追加

ノードの追加

add-node アクションでは、3 つの変数を使用できます。

nodes: クラスターに追加する必要のあるカンマ区切りのホスト名の一覧を受け入れます。

vip: ip

cluster_nodes: NFS Ganesha クラスターのカンマ区切りノードの一覧を受け入れます。

たとえば、ノードを追加するには、以下の情報を設定ファイルに追加します。

[hosts]

host-1.example.com host-2.example.com host-3.example.com [peer]

action=probe [clients]

action=mount

volname=host-3.example.com:gluster_shared_storage hosts=host-3.example.com

fstype=glusterfs

client_mount_points=/var/run/gluster/shared_storage/

[nfs-ganesha]

action=add-node

nodes=host-3.example.com

cluster_nodes=host-1.example.com,host-2.example.com vip=10.0.0.33

以下のコマンドを使用して設定を実行します。

# gdeploy -c txt.conf ノードの削除

ノードの削除

この delete-node アクションは 1 つの変数を取ります。これは nodes、NFS Ganesha クラスターから 削除するノードを指定するコンマ区切りリストです。

例:

[hosts]

host-1.example.com host-2.example.com host-3.example.com host-4.example.com [nfs-ganesha]

action=delete-node

nodes=host-2.example.com ボリュームのエクスポート ボリュームのエクスポート

このアクションによりボリュームがエクスポートされます。export-volume アクションは 1 つの変数を サポートし volnameます。

たとえば、ボリュームをエクスポートする場合は、以下の詳細を設定ファイルに追加します。

[hosts]

host-1.example.com

host-2.example.com [nfs-ganesha]

action=export-volume volname=ganesha

以下のコマンドを使用して設定を実行します。

# gdeploy -c txt.conf

ボリュームのエクスポートを解除します。

ボリュームのエクスポートを解除します。

このアクションはボリュームをエクスポート解除します。unexport-volume アクションは 1 つの変数を サポートし volnameます。

たとえば、ボリュームをエクスポート解除するには、以下の詳細を設定ファイルに追加します。

[hosts]

host-1.example.com host-2.example.com [nfs-ganesha]

action=unexport-volume volname=ganesha

以下のコマンドを使用して設定を実行します。

# gdeploy -c txt.conf NFS Ganesha 設定の更新設定の更新

このアクションは config ブロックを設定ファイルに追加または削除または追加し、クラスター refresh-config 上で実行されます。

アクションは以下の変数に refresh-config 対応します。

del-config-lines block-name volname ha-conf-dir

update_config_lines

例 1: クライアントブロックを追加して refresh-config を実行するには、設定ファイルに以下の詳細を追 加します。

注記 注記

refresh-config クライアントブロックでは、以下のような制限があります。

1 つのクライアントでのみ機能します。

[hosts]

host1-example.com host2-example.com [nfs-ganesha]

action=refresh-config

# Default block name is `client' block-name=client

config-block=clients = 10.0.0.1;|allow_root_access = true;|access_type = "RO";|Protocols = "2",

"3";|anonymous_uid = 1440;|anonymous_gid = 72;

volname=ganesha

以下のコマンドを使用して設定を実行します。

# gdeploy -c txt.conf

例 2 - 行を削除して refresh-config を実行すると、設定ファイルに以下の詳細が追加されます。

[hosts]

host1-example.com host2-example.com

[nfs-ganesha]

action=refresh-config del-config-lines=client volname=ganesha

以下のコマンドを使用して設定を実行します。

# gdeploy -c txt.conf

例 3: ボリュームで refresh-config を実行するには、以下の詳細を設定ファイルに追加します。

[hosts]

host1-example.com host2-example.com

[nfs-ganesha]

action=refresh-config volname=ganesha

以下のコマンドを使用して設定を実行します。

# gdeploy -c txt.conf

例 4: 行を変更し、refresh-config を実行すると、設定ファイルに以下の詳細が追加されます。

[hosts]

host1-example.com host2-example.com

[nfs-ganesha]

action=refresh-config

update_config_lines=Access_type = "RO";

#update_config_lines=Protocols = "4";

#update_config_lines=clients = 10.0.0.1;

volname=ganesha

以下のコマンドを使用して設定を実行します。

# gdeploy -c txt.conf

ドキュメント内 管理ガイド (ページ 60-67)