nfs 4をredhat / centos 7で実行しよう

nfs 4をredhat / centos 7で実行しよう

RHEL 7.9を実行し、LAN上の複数のサーバー間でnfsを実行しようとしています。私は常にnfs v3をマウントとして使用します。最新バージョンのnfs(4.2ベース)でこれを行う方法はありますか/etc/nfs.conf

別のLAN上のサーバーで

mount | grep bkup

bkupserver:/bkup on /bkup type nfs4 (rw,nosuid,noexec,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.2,local_lock=none,addr=192.168.1.1)

しかし、なぜこれが起こるのかわかりません。バージョン=4.1代わりに4.2があります。

しかし、私の本当の問題は、私の他のサーバーがいつもそう言うことです。章=3同時に私はその理由を知らない。

私のサーバー間で私が気づいた唯一の違いは、nfsv4ワーカーサーバーに/etc/exports/ /bkup *(rw,no_root_squash) versus my nfsv3 servers having etc / exports as/ bkup *(rw、async、no_root_squash)`があることです。

エクスポートオプション自体がnfsバージョンの発生を引き起こしたり防止したりしますか?

以下は参考用の「/etc/nfs.conf」です。私はnfs v3を得ました。/etc/sysconfig/nfs以下のようにポート番号のみを一致するように編集しました。私のサーバーはvers = 4.1を実行しており、対応する "/etc/nfs.conf"が影響を受けていないことを確認しました。編集して、/etc/sysconfig/nfsファイアウォールで開くことができるようにポート番号を宣言しました。

# This is a general configuration for the
# NFS daemons and tools; this is /etc/nfs.conf in RHEL 7.9
#
#[general]
# pipefs-directory=/var/lib/nfs/rpc_pipefs
#
#[exportfs]
# debug=0
#
#[gssd]
# verbosity=0
# rpc-verbosity=0
# use-memcache=0
# use-machine-creds=1
# avoid-dns=1
# limit-to-legacy-enctypes=0
# context-timeout=0
# rpc-timeout=5
# keytab-file=/etc/krb5.keytab
# cred-cache-directory=
# preferred-realm=
#
[lockd]
port=4001
udp-port=4001
#
#[mountd]
# debug=0
# manage-gids=n
# descriptors=0
port=4002
threads=8
# reverse-lookup=n
# state-directory-path=/var/lib/nfs
# ha-callout=
#
#[nfsdcltrack]
# debug=0
# storagedir=/var/lib/nfs/nfsdcltrack
#
[nfsd]
# debug=0
threads=8
# host=
port=4003
# grace-time=90
# lease-time=90
udp=y
tcp=y
# vers2=n
vers3=y
vers4=y
vers4.0=y
vers4.1=y
vers4.2=y
rdma=y
#
#[statd]
# debug=0
port=4004
outgoing-port=4005
# name=
# state-directory-path=/var/lib/nfs/statd
# ha-callout=
# no-notify=0
#
[sm-notify]
# debug=0
# force=0
# retry-time=900
outgoing-port=4006
# outgoing-addr=
# lift-grace=y

ベストアンサー1

  • CentOS 7.0より前のシステムからCentOS 7.9 NFSサーバーに接続する場合は、NFS 4.1またはNFS 3を介してのみ接続できます。

  • システムに NFS4 とバージョン 4.2 を強制的に使用させるには、mount コマンドで次のオプションを使用します。

#mount -t nfs4 -o vers=4.2,rw,no_root_squash bkupserver:/bkup /bkup
  • NFS V4用ファイアウォールに正しいポートが開いていることを確認してください。
#firewall-cmd --permanent --add-service=nfs
#filewall-cmd --permanent --add-service=rpc-bind
#firewall-cmd --reload

完全性のために、上記のようにバージョンv4.2が有効になっていることを確認する必要があります。

参考資料を見る:https://access.redhat.com/solutions/2325171

おすすめ記事