autofs 문제 "메인 맵을 읽는 중 문제가 발생했습니다. 최대 대기 시간이 초과되었습니다."

autofs 문제 "메인 맵을 읽는 중 문제가 발생했습니다. 최대 대기 시간이 초과되었습니다."

autofs를 사용하여 cifs 파티션을 마운트하려고 합니다. 많은 시행착오 끝에 마침내 설치에 성공했습니다(제가 겪었던 가장 큰 문제는 지침에 있었습니다.여기, 매핑 파일의 이 줄

"[any_name] -fstype=cifs,[other_options] > ://[remote_server]/[remote_share_name]"

실제로는 다음과 같아야 합니다.

"[remote_share_name] -fstype=cifs,[other_options] ://[remote_server]/"

어쨌든 이 모든 작업이 완료되면 다음을 사용하여 cifs 파티션을 마운트할 수 있습니다.

sudo automount -f -d &

불행하게도 다음 명령으로 실제 autofs 서비스를 사용할 때 내 공유가 마운트되지 않습니다.

sudo /sbin/service autofs restart

autofs sysconfig를 디버그 모드로 구성한 후 로그 파일을 살펴보고 다음 오류를 확인했습니다.

12월 18일 13:33:51 SRVR_XYZ 자동 마운트[7986]: autofs 중지됨
12월 18일 13:46:09 SRVR_XYZ 자동 마운트[8740]: lookup_read_master: 조회(파일): 마스터 매핑 파일을 열 수 없음 /etc /auto.master
12월 18일 13: 46:09 SRVR_XYZ 자동 마운트[8740]:lookup_read_master:lookup(파일): 마스터 매핑 파일을 열 수 없습니다. /etc/auto.master
12월 18일 13:46:11 SRVR_XYZ 자동 마운트[8740]: lookup_read_master: 조회(파일): 열 수 없습니다. 마스터 매핑 파일 열기 /etc/auto.master
Dec 18 13:46:13 SRVR_XYZ automount[8740]: lookup_read_master: lookup(file): 기본 매핑 파일을 열 수 없습니다. /etc/ auto.master
Dec 18 13:46: 15 SRVR_XYZ 자동 마운트[8740]: lookup_read_master: 조회(파일): 마스터 매핑 파일을 열 수 없습니다. /etc/auto.master
Dec 18 13:46:17 SRVR_XYZ 자동 마운트[8740] :lookup_read_master: 조회(파일): 기본 매핑 파일을 열 수 없습니다. 맵 파일 /etc/auto.master
12월 18일 13:46:19 SRVR_XYZ 자동 마운트 [8740]: 기본 맵을 읽는 중 문제가 발생했습니다. 최대 대기 시간이 초과되었습니다.
12개월 18일 13:46:19 SRVR_XYZ 자동 마운트[8740]: 자동 마운트: 경고: 할 수 없습니다. 최소한 다음 맵 소스를 기다리면서 읽으세요. 계속하세요...
12일 18일 13:46:19 SRVR_XYZ automount[8740]: lookup_read_master: lookup(file): 마스터 맵 파일을 열 수 없습니다. /etc/auto.master
12월 18일 13일: 53:34 SRVR_XYZ automount[9139]: lookup_read_master: 조회(파일): 마스터 맵 파일 /etc/auto를 열 수 없습니다. master
12월 18일 13:53:34 SRVR_XYZ automount[9139]: lookup_read_master: 조회(파일): 불가능 마스터 매핑 파일 열기 /etc/auto.master
Dec 18 13:53:36 SRVR_XYZ 자동 마운트[9139] :lookup_read_master: 조회(파일): 마스터 매핑 파일을 열 수 없습니다. /etc/auto.master
Dec 18 13:53:38 SRVR_XYZ automount [9139] :lookup_read_master: 조회(파일): 마스터 매핑 파일을 열 수 없습니다. /etc /auto.master
Dec 18 13:53:40 SRVR_XYZ automount[9139]: lookup_read_master: 조회(파일): 마스터 매핑 파일을 열 수 없습니다. /etc/auto.master
12월 18일 13:53:42 SRVR_XYZ 자동 마운트 [9139]: lookup_read_master: 조회(파일): 마스터 맵 파일을 열 수 없습니다. /etc/auto.master
12월 18일 13:53:44 SRVR_XYZ 자동 마운트 [9139] : 마스터 맵을 읽는 중 문제가 발생했습니다. 최대값을 초과했습니다. 대기 시간
12월 18일 13:53:44 SRVR_XYZ 자동 마운트 [9139]: 자동 마운트: 경고: 대기 후 하나 이상의 맵 소스를 읽을 수 없습니다. 계속하세요...
12월 18일 13:53:44 SRVR_XYZ 자동 마운트[9139]: lookup_read_master: 조회(파일): 마스터 매핑 파일을 열 수 없습니다. /etc/auto.master
Dec 18 13:54:18 SRVR_XYZ 자동 마운트[9250]: lookup_read_master: 조회(파일): 마스터 매핑 파일을 열 수 없습니다. / 등/자동차. master
12월 18일 13:54:18 SRVR_XYZ automount[9250]:lookup_read_master:lookup(file): 마스터 매핑 파일을 열 수 없습니다. /etc/auto.master
12월 18일 13:54:20 SRVR_XYZ automount[9250]:lookup_read_master :lookup( 파일): 마스터 매핑 파일을 열 수 없습니다. /etc/auto.master
Dec 18 13:54:22 SRVR_XYZ 자동 마운트 [9250]: lookup_read_master: 조회(파일): 마스터 매핑 파일을 열 수 없습니다. /etc/auto .master
Dec 18 13 :54:24 SRVR_XYZ 자동 마운트[9250]: lookup_read_master: 조회(파일): 마스터 매핑 파일을 열 수 없습니다. /etc/auto.master
Dec 18 13:54:26 SRVR_XYZ 자동 마운트[9250]: lookup_read_master: 조회(파일): 비활성화 마스터 맵 파일 열기 /etc/auto.master
Dec 18 13:54:28 SRVR_XYZ automount[9250]: 마스터 맵 읽기 문제, 최대 대기 시간 초과
Dec 18 13:54 :28 SRVR_XYZ automount[9250]: automount: 경고: 기다린 후에 하나 이상의 맵 소스를 읽을 수 없습니다. 계속하십시오...
Dec 18 13:54:28 SRVR_XYZ automount[9250]: lookup_read_master: 조회(파일): 마스터 매핑 파일 /etc/auto.master를 열 수 없습니다.

왜 루트 계정에 대해 적절한 권한(chmod 640)과 /etc/auto.master 소유권을 설정했는지 모르겠습니다.

autofs 서비스가 파티션을 마운트할 수 없는 이유를 모르겠지만 수동으로 automout을 시작하면 제대로 작동합니다.

나는 사용한다:

자동 마운트 버전 5.0.5-133.el6_9
Linux 배포판: CentOS 버전 6.9(최종 버전)

/etc/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/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
#
# 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
/mnt/cifs /etc/auto.cifs-shares --ghost

도움을 주셔서 미리 감사드립니다.

답변1

AutoFS는 2단계 구성 파일 계층 구조를 사용합니다.

  1. 최상위 수준 제어/etc/auto.master

    계층 구조의 최상위 파일은 /etc/auto.masterAutoFS에서 제어하는 ​​디렉터리를 정의하는 디렉터리 트리입니다. 질문의 예제 파일에는 주석이 아닌 세 줄이 포함되어 있습니다.

    /misc   /etc/auto.misc
    /net    -hosts
    +auto.master
    

    이는 /misc가 NFS를 실행하는 알려진 호스트 세트에서 /etc/auto.misc시작된 파일 또는 스크립트에 의해 AutoFS를 통해 관리된다는 것을 의미합니다 . /net마지막 줄은 중앙 지도를 위해 NIS에 문의해야 함을 나타냅니다. NIS를 실행하지 않을 것이므로 이 줄은 중요하지 않습니다.

    /net및 행을 주석 처리 +auto.master하고 /misc /etc/auto.misc정의만 남겨 두는 것이 좋습니다.

  2. 레벨 2 구현

    이제 계층의 두 번째 수준에 대한 파일 하나만 남았습니다 /etc/auto.misc. 새 정의를 포함하도록 편집할 수 있습니다.

    [share_name] -fstype=cifs,[other_options] ://[remote_server]/[remote_share]"
    

    예를 들어, 이 항목은 /misc/myshare공유에 직접 매핑되는 임시 항목을 만듭니다 //CIFSSERVER/ITSSHARE.

    myshare -fstype=cifs,noperm,credentials=/root/.cifscred ://cifsserver/itsshare
    

    명시적인 이름으로 공유에 액세스하지 않으면 에 표시되지 않습니다 /misc. 로거에서 보고된 오류를 볼 수 있습니다( /var/log/syslog예: 내 Debian 버전).


개인적으로 나는 방해가 되지 않도록 이름 /misc/var/autofs/miscin 으로 바꾸고 . 나의 경우에는,/etc/auto.master/autofs/var/autofs/misc

# Prepare the /etc/auto.master file
#
mkdir -p -m755 /var/autofs/misc /autofs
rmdir /misc
sed -i.bak 's!^/misc!/var/autofs/misc!' /etc/auto.master

# Create the symlink
#
cd /autofs
ln -s ../var/autofs/misc/myshare

그런 다음 다음 위치에서 AutoFS 마운트를 참조하겠습니다 /autofs. 특히 파일 시스템을 AutoFS로 마운트하는 것이 느리고 비용이 많이 드는 프로세스인 경우 이 방법이 효과가 없을 수도 있지만 모든 AutoFS 마운트 이름을 기억하지 않아도 됩니다.

관련 정보