
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, 드릴 조회)은 이름을 확인하는 데 매우 반응이 빠른 것 같습니다.