Show Table of Contents
27.4. 設定例
27.4.1. Gluster ブリックのラベル付け
Gluster ブリックは、信頼されるストレージプール内のサーバーにおけるエクスポートディレクトリーです。このブリックが正常な SELinux コンテキストである
glusterd_brick_t でラベル付けされていない場合は、SELinux は特定のファイルアクセス操作を拒否し、各種の AVC メッセージを生成します。
以下の手順では、Gluster ブリックに適切な SELinux コンテキストをレベル付けする方法を説明します。ここでは、Gluster ブリックの例として
/dev/rhgs/gluster という論理ボリュームを作成、フォーマット済みであることを前提としています。
Gluster ブリックの詳細については、Red Hat Gluster Storage の『Administration Guide』にある『Red Hat Gluster Storage Volumes』の章を参照してください。
手順27.1 Gluster ブリックのラベル付け
- フォーマット済みの論理ボリュームをマウントするディレクトリーを作成します。例を示します。
~]#
mkdir /mnt/brick1 - 論理ボリューム (この例では
/dev/vg-group/gluster) を 上記で作成した/mnt/brick1/ディレクトリーにマウントします。~]#
mount /dev/vg-group/gluster /mnt/brick1/mountコマンドはデバイスを一時的にしかマウントしないことに注意してください。デバイスを永続的にマウントするには、下記のようなエントリーを/etc/fstabファイルに追加します。/dev/vg-group/gluster /mnt/brick1 xfs rw,inode64,noatime,nouuid 1 2
詳細情報は、fstab(5) man ページを参照してください。 /mnt/brick1/の SELinux コンテキストを確認します。~]$
ls -lZd /mnt/brick1/drwxr-xr-x. root root system_u:object_r:unlabeled_t:s0 /mnt/brick1/ディレクトリーにはunlabeled_tSELinux タイプがラベル付けされています。/mnt/brick1/の SELinux タイプをglusterd_brick_tSELinux タイプに変更します。~]#
semanage fcontext -a -t glusterd_brick_t "/mnt/brick1(/.*)?"restoreconユーティリティーを使用して変更を適用します。~]#
restorecon -Rv /mnt/brick1- 最後に、コンテキストが正常に変更されたことを確認します。
~]$
ls -lZd /mnt/brick1drwxr-xr-x. root root system_u:object_r:glusterd_brick_t:s0 /mnt/brick1/

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.