autofsを使用してNFSエクスポートマウント遅延を解決するには?

autofsを使用してNFSエクスポートマウント遅延を解決するには?

autofsを使用してNFSマウントをマウントすると、マウント遅延(10秒から1分)が発生します。 DNSを介してサーバー名を解決しながらこの遅延を回避するにはどうすればよいですか?

Manjaro Linuxでは、自動マウントバージョン5.1.6を使用しています。 NFSバージョン4.2を使用しています。

サーバー情報

サーバー(ホスト名verin)NFS設定/ etc / exports:

/data 192.168.1.0/24(rw,sync,nohide,no_subtree_check)

顧客情報

クライアント autofs 構成:

/etc/autofs/auto.master:

#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
/misc   /etc/autofs/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#   "nosuid" and "nodev" options unless the "suid" and "dev"
#   options are explicitly given.
#
/net    -hosts proto=tcp
#
# Include /etc/autofs/auto.master.d/*.autofs
# To add an extra map using this mechanism you will need to add
# two configuration items - one /etc/autofs/auto.master.d/extra.autofs file
# (using the same line format as the auto.master file)
# and a separate mount map (e.g. /etc/auto.extra or an auto.extra NIS map)
# that is referred to by the extra.autofs file.
#
+dir:/etc/autofs/auto.master.d
#
# If you have fedfs set up and the related binaries, either
# built as part of autofs or installed from another package,
# uncomment this line to use the fedfs program map to access
# your fedfs mounts.
#/nfs4  /usr/sbin/fedfs-map-nfs4 nobind
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master

クライアント詳細出力

/net/verin/dataこれは、最初のリストを試みたときの自動マウントの出力です。

$ sudo automount -f -v
Starting automounter version 5.1.6, master map auto.master
using kernel protocol version 5.05
mounted indirect on /misc with timeout 300, freq 75 seconds
mounted indirect on /net with timeout 300, freq 75 seconds
attempting to mount entry /net/verin
mounted offset on /net/verin/data with timeout 300, freq 75 seconds
mounted /net/verin
attempting to mount entry /net/verin/data
mounted /net/verin/data

ラインを印刷した後、長い遅延が発生しますattempting to mount entry /net/verin

クライアントデバッグ出力

デバッグ出力使用時の出力:

$ sudo automount -f --debug
Starting automounter version 5.1.6, master map auto.master
using kernel protocol version 5.05
lookup_nss_read_master: reading master files auto.master
do_init: parse(sun): init gathered global options: (null)
lookup_read_master: lookup(file): read entry /misc
lookup_read_master: lookup(file): read entry /net
lookup_read_master: lookup(file): read entry +dir:/etc/autofs/auto.master.d
lookup_nss_read_master: reading master dir /etc/autofs/auto.master.d
lookup_read_master: lookup(dir): scandir: /etc/autofs/auto.master.d
lookup_read_master: lookup(file): read entry +auto.master
lookup_nss_read_master: reading master files auto.master
do_init: parse(sun): init gathered global options: (null)
master_do_mount: mounting /misc
automount_path_to_fifo: fifo name /run/autofs.fifo-misc
lookup_nss_read_map: reading map file /etc/autofs/auto.misc
do_init: parse(sun): init gathered global options: (null)
mounted indirect on /misc with timeout 300, freq 75 seconds
st_ready: st_ready(): state = 0 path /misc
master_do_mount: mounting /net
automount_path_to_fifo: fifo name /run/autofs.fifo-net
lookup_nss_read_map: reading map hosts proto=tcp
do_init: parse(sun): init gathered global options: proto=tcp
lookup_read_map: lookup(hosts): read hosts map
lookup_read_map: lookup(hosts): map not browsable, update existing host entries only
mounted indirect on /net with timeout 300, freq 75 seconds
st_ready: st_ready(): state = 0 path /net
handle_packet: type = 3
handle_packet_missing_indirect: token 93, name verin, request pid 383755
attempting to mount entry /net/verin
lookup_mount: lookup(hosts): verin -> (null)
get_exports: lookup(hosts): fetchng export list for verin
parse_mount: parse(sun): expanded entry: "/data" "verin:/data"
parse_mount: parse(sun): gathered options: proto=tcp
parse_mount: parse(sun): dequote(""/data"") -> /data
parse_mapent: parse(sun): gathered options: proto=tcp
parse_mapent: parse(sun): dequote(""verin:/data"") -> verin:/data
update_offset_entry: parse(sun): updated multi-mount offset /data -> -proto=tcp verin:/data
do_mount_autofs_offset: mount offset /net/verin/data at /net/verin
mount_autofs_offset: calling mount -t autofs -s  -o fd=11,pgrp=383739,minproto=5,maxproto=5,offset automount /net/verin/data
mounted offset on /net/verin/data with timeout 300, freq 75 seconds
mount_autofs_offset: mounted trigger /net/verin/data at /net/verin/data
dev_ioctl_send_ready: token = 93
mounted /net/verin
handle_packet: type = 5
handle_packet_missing_direct: token 94, name /net/verin/data, request pid 383755
attempting to mount entry /net/verin/data
lookup_mount: lookup(hosts): /net/verin/data -> -proto=tcp verin:/data
parse_mount: parse(sun): expanded entry: -proto=tcp verin:/data
parse_mount: parse(sun): gathered options: proto=tcp
sun_mount: parse(sun): mounting root /net/verin/data, mountpoint /net/verin/data, what verin:/data, fstype nfs, options proto=tcp,nosuid,nodev,intr
mount(nfs): root=/net/verin/data name=/net/verin/data what=verin:/data, fstype=nfs, options=proto=tcp,nosuid,nodev,intr
mount(nfs): nfs options="proto=tcp,nosuid,nodev,intr", nobind=0, nosymlink=0, ro=0
get_nfs_info: called with host verin(192.168.1.2) proto 6 version 0x20
get_nfs_info: nfs v3 rpc ping time: 0.000210
get_nfs_info: host verin cost 209 weight 0
get_nfs_info: called with host verin(fd00::ba97:5aff:fe4e:d196) proto 6 version 0x20
get_nfs_info: nfs v3 rpc ping time: 0.000220
get_nfs_info: host verin cost 220 weight 0
prune_host_list: selected subset of hosts that support NFS3 over TCP
mount_mount: mount(nfs): calling mkdir_path /net/verin/data
mount(nfs): calling mount -t nfs -s -o proto=tcp,nosuid,nodev,intr verin:/data /net/verin/data
mount_mount: mount(nfs): mounted verin:/data on /net/verin/data
dev_ioctl_send_ready: token = 94
mounted /net/verin/data

ここでの遅延はラインの後ろにありますget_exports: lookup(hosts): fetchng export list for verin

追加情報

問題の解決中に収集した追加情報は次のとおりです。

verinという名前はDNSによって解決されます。どちらのコンピュータも私のプライマリドメインにあります。 DNS は他のコマンドをすばやく解決できます。ファイルにverinを追加すると、/etc/hosts遅延がなくなります。

NFSサーバーは遅延後にログを出力します(次のように構成されます)rpcdebug -m nfsd -s all

私が知っている限り、autofsはverinをチェックするのに遅れがありますが、他のすべて(ping、ssh、ドリルルックアップ)は名前の解決に非常に反応が速いようです。

ベストアンサー1

おすすめ記事