BigData_Off1/리눅스2

Autofs 2(① autofs 2nd, ② 실습1)

오정oI 2018. 1. 29. 12:50
반응형
SMALL

* 쌤 정리 강의 노트 :

1월29일_13평일리2.txt

* 쌤 정리 실습:

2018.01.29_쌤 실습.txt

 * 수업 끝난 후 실습 리뷰:

08.01.29_nfs_pc2_review.txt

 

* 자동서비스

1> 개념

- 시스템을 재부팅하면 서버가 자동 서비스로 설정한 서비스를 딱 한 번 시작 해줌

- 자주 사용하는 서비스를 설정

- 별도로 해당 서비스를 작업시 본인이 서비스를 껏다가 다시 시작해야 함

 

2> 명령어

centOS 6(이하) 

centOS 7 

chkconfig service(daemon) on

 systemctl enable service(daemon) 

 chkconfig service(daemon) off

 systemctl disable service(daemon) 

 chkconfig --list service(daemon) 

 

 systemctl is-enabled service(daemon) 

 systemctl list-dependencies --before service(daemon)

 systemctl list-dependencies --after service(daemon)

 chkconfig --list

 systemctl list-unit-files --type service(daemon) 

 

 

// client

[root@localhost ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda6        13G  7.4G  5.6G  57% /
devtmpfs        474M     0  474M   0% /dev
tmpfs           488M     0  488M   0% /dev/shm
tmpfs           488M  7.1M  481M   2% /run
tmpfs           488M     0  488M   0% /sys/fs/cgroup
/dev/sdb1        97M  5.2M   92M   6% /auto/sharedir
/dev/sdb3       297M   16M  282M   6% /server_auto
/dev/sda5       197M   16M  181M   9% /home
/dev/sda1       997M  194M  803M  20% /boot
/dev/sda3       2.0G  456M  1.5G  23% /var
tmpfs            98M  4.0K   98M   1% /run/user/42
tmpfs            98M   16K   98M   1% /run/user/0
/dev/sr0        8.1G  8.1G     0 100% /run/media/root/CentOS 7 x86_64
[root@localhost ~]# ls -l /server_auto/
합계 0
-rw-r--r-- 1 root root 0  1월 26 14:44 testfile1
-rw-r--r-- 1 root root 0  1월 26 15:09 testfile2
[root@localhost ~]# systemctl restart nfs.service
[root@localhost ~]#
[root@localhost ~]# ifconfig | head -2
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.46.85  netmask 255.255.255.0  broadcast 192.168.46.255
[root@localhost ~]#

// server

[root@localhost ~]# systemctl restart autofs.service
[root@localhost ~]#
[root@localhost ~]# ls -l /misc
합계 0
dr-xr-xr-x 2 root root 0  1월 29 12:43 cd
dr-xr-xr-x 2 root root 0  1월 29 12:43 test_autofs
[root@localhost ~]#
[root@localhost ~]# ls -l /misc/test_autofs/
합계 0
-rw-r--r-- 1 root root 0  1월 26 14:44 testfile1
-rw-r--r-- 1 root root 0  1월 26 15:09 testfile2
[root@localhost ~]#
[root@localhost ~]# tail -1 /etc/auto.misc
test_autofs   -rw,intr  192.168.46.85:/server_auto

// client

# systemctl enable nfs.service

# systemctl is-enabled nfs.service

# systemctl enable nfs.service

// server

# systemctl enable autofs.service

# systemctl is-enabled autofs.service

# systemctl enable autofs.service

 

// client

// server

=> 스냅샷 : ~ _마지막으로    Go To

 

<실습1>

nfs service와 autofs service 최종 실습

서버와 클라이언트를 스냅샷 돌리고 진행(총 2대)

 

nfs server

HDD(SCSI, 1GB) partition은 5개 설정, 용량은 자유롭게

nfs service 작업할 때

첫번째 호스트가 읽고 쓰기가 가능하며 nfs client의 root를 무시하지 않고 인정

두번째 네트워크 대역으로 읽고 쓰기가 가능하며 nfs client의 root를 무시

세번째 모든 네트워크가 읽기 전용으로 가능하며 nfs client의 root를 무시

auto mount

nfs service를 자동 서비스로 등록

 

nfs client

nfs server가 공유한 파일 시스템을 nfs service를 이용하여 설정한 뒤에 nfs server와 공유되는지 확인

nfs server가 공유한 파일 시스템을 autofs service를 이용하여 설정한 뒤에 nfs server와 공유되는지 확인

nfs server가 공유한 파일 시스템을 nfs service 또는 autofs service를 이용하여 설정한 뒤에 nfs server와

공유되는지 확인(이 때, autofs service로 설정을 했으면 반드시 재부팅하여 nfs server와 공유되는지 확인)

 

 

 

======================================

// [server]

// ① partition

[root@junga ~]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000caf70

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200     6293503     2097152   82  Linux swap / Solaris
/dev/sda3         6293504    41943039    17824768   83  Linux

Disk /dev/sdb: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@junga ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x6c545c73.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-2097151, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151): +100M
Partition 1 of type Linux and of size 100 MiB is set

Command (m for help): p

Disk /dev/sdb: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x6c545c73

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048      206847      102400   83  Linux

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (2-4, default 2): 2
First sector (206848-2097151, default 206848):
Using default value 206848
Last sector, +sectors or +size{K,M,G} (206848-2097151, default 2097151): +100M
Partition 2 of type Linux and of size 100 MiB is set

Command (m for help): p

Disk /dev/sdb: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x6c545c73

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048      206847      102400   83  Linux
/dev/sdb2          206848      411647      102400   83  Linux

Command (m for help): n
Partition type:
   p   primary (2 primary, 0 extended, 2 free)
   e   extended
Select (default p): p
Partition number (3,4, default 3): 3
First sector (411648-2097151, default 411648):
Using default value 411648
Last sector, +sectors or +size{K,M,G} (411648-2097151, default 2097151): +200M
Partition 3 of type Linux and of size 200 MiB is set

Command (m for help): p

Disk /dev/sdb: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x6c545c73

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048      206847      102400   83  Linux
/dev/sdb2          206848      411647      102400   83  Linux
/dev/sdb3          411648      821247      204800   83  Linux

Command (m for help): n
Partition type:
   p   primary (3 primary, 0 extended, 1 free)
   e   extended
Select (default e): p
Selected partition 4
First sector (821248-2097151, default 821248):
Using default value 821248
Last sector, +sectors or +size{K,M,G} (821248-2097151, default 2097151): +200M
Partition 4 of type Linux and of size 200 MiB is set

Command (m for help): p

Disk /dev/sdb: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x6c545c73

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048      206847      102400   83  Linux
/dev/sdb2          206848      411647      102400   83  Linux
/dev/sdb3          411648      821247      204800   83  Linux
/dev/sdb4          821248     1230847      204800   83  Linux

Command (m for help): n
If you want to create more than four partitions, you must replace a
primary partition with an extended partition first.

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   g   create a new empty GPT partition table
   G   create an IRIX (SGI) partition table
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): n
If you want to create more than four partitions, you must replace a
primary partition with an extended partition first.

Command (m for help): d
Partition number (1-4, default 4): 4
Partition 4 is deleted

Command (m for help): p

Disk /dev/sdb: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x6c545c73

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048      206847      102400   83  Linux
/dev/sdb2          206848      411647      102400   83  Linux
/dev/sdb3          411648      821247      204800   83  Linux

Command (m for help): p

Disk /dev/sdb: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x6c545c73

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048      206847      102400   83  Linux
/dev/sdb2          206848      411647      102400   83  Linux
/dev/sdb3          411648      821247      204800   83  Linux

Command (m for help): n
Partition type:
   p   primary (3 primary, 0 extended, 1 free)
   e   extended
Select (default e): e
Selected partition 4
First sector (821248-2097151, default 821248):
Using default value 821248
Last sector, +sectors or +size{K,M,G} (821248-2097151, default 2097151): +300M
Partition 4 of type Extended and of size 300 MiB is set

Command (m for help): p

Disk /dev/sdb: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x6c545c73

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048      206847      102400   83  Linux
/dev/sdb2          206848      411647      102400   83  Linux
/dev/sdb3          411648      821247      204800   83  Linux
/dev/sdb4          821248     1435647      307200    5  Extended

Command (m for help): n
All primary partitions are in use
Adding logical partition 5
First sector (823296-1435647, default 823296):
Using default value 823296
Last sector, +sectors or +size{K,M,G} (823296-1435647, default 1435647): +150M
Partition 5 of type Linux and of size 150 MiB is set

Command (m for help): p

Disk /dev/sdb: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x6c545c73

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048      206847      102400   83  Linux
/dev/sdb2          206848      411647      102400   83  Linux
/dev/sdb3          411648      821247      204800   83  Linux
/dev/sdb4          821248     1435647      307200    5  Extended
/dev/sdb5          823296     1130495      153600   83  Linux

Command (m for help): n
All primary partitions are in use
Adding logical partition 6
First sector (1132544-1435647, default 1132544):
Using default value 1132544
Last sector, +sectors or +size{K,M,G} (1132544-1435647, default 1435647):
Using default value 1435647
Partition 6 of type Linux and of size 148 MiB is set

Command (m for help): p

Disk /dev/sdb: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x6c545c73

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048      206847      102400   83  Linux
/dev/sdb2          206848      411647      102400   83  Linux
/dev/sdb3          411648      821247      204800   83  Linux
/dev/sdb4          821248     1435647      307200    5  Extended
/dev/sdb5          823296     1130495      153600   83  Linux
/dev/sdb6         1132544     1435647      151552   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

// ② format

[root@junga ~]# fdisk -l /dev/sdb

Disk /dev/sdb: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x6c545c73

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048      206847      102400   83  Linux
/dev/sdb2          206848      411647      102400   83  Linux
/dev/sdb3          411648      821247      204800   83  Linux
/dev/sdb4          821248     1435647      307200    5  Extended
/dev/sdb5          823296     1130495      153600   83  Linux
/dev/sdb6         1132544     1435647      151552   83  Linux
[root@junga ~]#
[root@junga ~]# mkfs -t xfs /dev/sdb1
meta-data=/dev/sdb1              isize=512    agcount=4, agsize=6400 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=25600, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=855, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@junga ~]#
[root@junga ~]# mkfs -t xfs /dev/sdb3
meta-data=/dev/sdb3              isize=512    agcount=4, agsize=12800 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=51200, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=855, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@junga ~]# mkfs.xfs /dev/sdb4
mkfs.xfs: /dev/sdb4 appears to contain a partition table (dos).
mkfs.xfs: Use the -f option to force overwrite.
[root@junga ~]# mkfs -t xfs /dev/sdb4
mkfs.xfs: /dev/sdb4 appears to contain a partition table (dos).
mkfs.xfs: Use the -f option to force overwrite.
[root@junga ~]#
[root@junga ~]# blkid /dev/sdb1 /dev/sdb2 /dev/sdb4
/dev/sdb1: UUID="4dc153b2-466b-4203-b351-13423d424b07" TYPE="xfs"
/dev/sdb4: PTTYPE="dos"
[root@junga ~]#
[root@junga ~]# blkid /dev/sdb1 /dev/sdb3 /dev/sdb4
/dev/sdb1: UUID="4dc153b2-466b-4203-b351-13423d424b07" TYPE="xfs"
/dev/sdb3: UUID="d245d92f-fdfe-41de-8fac-91c22f684e72" TYPE="xfs"
/dev/sdb4: PTTYPE="dos"
[root@junga ~]#
[root@junga ~]# mkfs.xfs /dev/sdb5
meta-data=/dev/sdb5              isize=512    agcount=4, agsize=9600 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=38400, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=855, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@junga ~]#
[root@junga ~]# blkid /dev/sdb1 /dev/sdb3 /dev/sdb5
/dev/sdb1: UUID="4dc153b2-466b-4203-b351-13423d424b07" TYPE="xfs"
/dev/sdb3: UUID="d245d92f-fdfe-41de-8fac-91c22f684e72" TYPE="xfs"
/dev/sdb5: UUID="d6fb29c5-06e0-4b8c-a297-dffe6eee7519" TYPE="xfs"

// ③ mount, automount (/etc/fstab)

[root@junga ~]# vi /etc/fstab

     12 /dev/sdb1       /test2/nfsServer1        xfs defaults 0 0
     13 /dev/sdb3       /test2/nfsServer2        xfs defaults 0 0
     14 /dev/sdb5       /test2/nfsServer3        xfs defaults 0 0
[root@junga ~]# mkdir -p /test2/nfsServer1 /test2/nfsServer2 /test2/nfsServer3
[root@junga ~]#
[root@junga ~]# ls -l /test2
합계 0
drwxr-xr-x 2 root root 6  1월 29 13:34 nfsServer1
drwxr-xr-x 2 root root 6  1월 29 13:34 nfsServer2
drwxr-xr-x 2 root root 6  1월 29 13:34 nfsServer3
[root@junga ~]#
[root@junga ~]# mount -a
[root@junga ~]# df -h | tail -4
/dev/sr0        8.1G  8.1G     0 100% /run/media/root/CentOS 7 x86_64
/dev/sdb1        97M  5.2M   92M   6% /test2/nfsServer1
/dev/sdb3       197M   11M  187M   6% /test2/nfsServer2
/dev/sdb5       147M  7.7M  139M   6% /test2/nfsServer3
[root@junga ~]#
[root@junga ~]# mount | tail -4
/dev/sr0 on /run/media/root/CentOS 7 x86_64 type iso9660 (ro,nosuid,nodev,relatime,uid=0,gid=0,iocharset=utf8,mode=0400,dmode=0500,uhelper=udisks2)
/dev/sdb1 on /test2/nfsServer1 type xfs (rw,relatime,attr2,inode64,noquota)
/dev/sdb3 on /test2/nfsServer2 type xfs (rw,relatime,attr2,inode64,noquota)
/dev/sdb5 on /test2/nfsServer3 type xfs (rw,relatime,attr2,inode64,noquota)

// ④ nfs mount (/etc/exports)

// nfs 패키지 설치(portmap도 확인)

[root@junga ~]# rpm -qa | grep nfs
libnfsidmap-0.25-17.el7.x86_64
nfs-utils-1.3.0-0.48.el7.x86_64
[root@junga ~]# rpm -qa | grep portmap
[root@junga ~]#
[root@junga ~]# yum install nfs*
Is this ok [y/d/N]: y
Downloading packages:

Updated:
  nfs-utils.x86_64 1:1.3.0-0.48.el7_4.1                                       

Complete!

// /etc/exports

[root@junga ~]# ls -l /etc/exports
-rw-r--r--. 1 root root 0  6월  7  2013 /etc/exports
[root@junga ~]#
[root@junga ~]# vi /etc/exports
      1 /test2/nfsServer1 192.168.46.90(rw,no_root_squash,sync)
      2 /test2/nfsServer2 192.168.46.0(rw,root_squash,sync)
      3 /test2/nfsServer3 *(ro,root_squash,sync)

 

// nfs service 재시작 및 자동 서비스로 등록

[root@junga ~]# systemctl is-active nfs.service
unknown
[root@junga ~]#
[root@junga ~]# systemctl restart nfs.service
[root@junga ~]#
[root@junga ~]# systemctl -l status nfs.servicew
Unit nfs.servicew.service could not be found.
[root@junga ~]# systemctl -l status nfs.service
● nfs-server.service - NFS server and services
   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)
   Active: active (exited) since 월 2018-01-29 13:47:11 KST; 21s ago
  Process: 3943 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)
  Process: 3938 ExecStartPre=/bin/sh -c /bin/kill -HUP `cat /run/gssproxy.pid` (code=exited, status=0/SUCCESS)
  Process: 3937 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
 Main PID: 3943 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/nfs-server.service

 1월 29 13:47:11 junga.kgitbank systemd[1]: Starting NFS server and services...
 1월 29 13:47:11 junga.kgitbank systemd[1]: Started NFS server and services.
[root@junga ~]#
[root@junga ~]#
[root@junga ~]# systemctl enable nfs.service
Created symlink from /etc/systemd/system/multi-user.target.wants/nfs-server.service to /usr/lib/systemd/system/nfs-server.service.
[root@junga ~]#
[root@junga ~]# systemctl is-enabled nfs.service
enabled
[root@junga ~]# systemctl enable nfs.service
[root@junga ~]# systemctl enable nfs.service
[root@junga ~]#
[root@junga ~]#

// nfs service 확인

[root@junga ~]# exportfs -v
/test2/nfsServer1
  192.168.46.90(rw,sync,wdelay,hide,no_subtree_check,sec=sys,secure,no_root_squash,no_all_squash)
/test2/nfsServer2
  192.168.46.0(rw,sync,wdelay,hide,no_subtree_check,sec=sys,secure,root_squash,no_all_squash)
/test2/nfsServer3
  <world>(ro,sync,wdelay,hide,no_subtree_check,sec=sys,secure,root_squash,no_all_squash)
[root@junga ~]# exportfs -ra

 

[client]

// ⑤ autofs 관련

// autofs 설치

[root@junga ~]# rpm -qa | grep autofs
[root@junga ~]#
[root@junga ~]# yum install autofs*
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp.nara.wide.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Resolving Dependencies
--> Running transaction check
---> Package autofs.x86_64 1:5.0.7-70.el7_4.1 will be installed
--> Processing Dependency: libhesiod.so.0()(64bit) for package: 1:autofs-5.0.7-70.el7_4.1.x86_64
--> Running transaction check
---> Package hesiod.x86_64 0:3.2.1-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================
 Package       Arch          Version                      Repository      Size
===============================================================================
Installing:
 autofs        x86_64        1:5.0.7-70.el7_4.1           updates        809 k
Installing for dependencies:
 hesiod        x86_64        3.2.1-3.el7                  base            30 k

Transaction Summary
===============================================================================
Install  1 Package (+1 Dependent package)

Total download size: 839 k
Installed size: 5.1 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): hesiod-3.2.1-3.el7.x86_64.rpm                      |  30 kB   00:00    
(2/2): autofs-5.0.7-70.el7_4.1.x86_64.rpm                 | 809 kB   00:00    
-------------------------------------------------------------------------------
Total                                             1.0 MB/s | 839 kB  00:00    
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : hesiod-3.2.1-3.el7.x86_64                                   1/2
  Installing : 1:autofs-5.0.7-70.el7_4.1.x86_64                            2/2
  Verifying  : 1:autofs-5.0.7-70.el7_4.1.x86_64                            1/2
  Verifying  : hesiod-3.2.1-3.el7.x86_64                                   2/2

Installed:
  autofs.x86_64 1:5.0.7-70.el7_4.1                                            

Dependency Installed:
  hesiod.x86_64 0:3.2.1-3.el7                                                 

Complete!
[root@junga ~]#

// autofs 관련 설정

[root@junga ~]# ls -l /etc/autofs.conf
-rw-r--r-- 1 root root 14392 12월  1 04:17 /etc/autofs.conf
[root@junga ~]#
[root@junga ~]# vi /etc/autofs.conf
45 browse_mode = yes

[root@junga ~]# vi /etc/auto.misc
test_nfs_c1 -rw,intr 192.168.46.90:/test2/nfsServer1
test_nfs_c2 -rw,intr 192.168.46.0:/test2/nfsServer2
test_nfs_c3 -rw,intr *:/test2/nfsServer3

[root@junga ~]#

// autofs service 재시작 및 자동 서비스 등록

[root@localhost ~]# systemctl is-active autofs.service
unknown
[root@localhost ~]#
[root@localhost ~]# systemctl restart autofs.service
[root@localhost ~]#
[root@localhost ~]# systemctl is-active autofs.service
active
[root@localhost ~]#
[root@localhost ~]# systemctl -l status autofs.service
● autofs.service - Automounts filesystems on demand
   Loaded: loaded (/usr/lib/systemd/system/autofs.service; disabled; vendor preset: disabled)
   Active: active (running) since 월 2018-01-29 14:06:11 KST; 15s ago
  Process: 2632 ExecStart=/usr/sbin/automount $OPTIONS --pid-file /run/autofs.pid (code=exited, status=0/SUCCESS)
 Main PID: 2634 (automount)
   CGroup: /system.slice/autofs.service
           └─2634 /usr/sbin/automount --pid-file /run/autofs.pid

 1월 29 14:06:01 localhost.localdomain automount[2634]: open_sss_lib:78: lookup(sss): failed to open /usr/lib64/sssd/modules/libsss_autofs.so: /usr/lib64/sssd/modules/libsss_autofs.so: cannot open shared object file: No such file or directory
 1월 29 14:06:01 localhost.localdomain automount[2634]: open_sss_lib:78: lookup(sss): failed to open /usr/lib64/sssd/modules/libsss_autofs.so: /usr/lib64/sssd/modules/libsss_autofs.so: cannot open shared object file: No such file or directory
 1월 29 14:06:03 localhost.localdomain automount[2634]: open_sss_lib:78: lookup(sss): failed to open /usr/lib64/sssd/modules/libsss_autofs.so: /usr/lib64/sssd/modules/libsss_autofs.so: cannot open shared object file: No such file or directory
 1월 29 14:06:05 localhost.localdomain automount[2634]: open_sss_lib:78: lookup(sss): failed to open /usr/lib64/sssd/modules/libsss_autofs.so: /usr/lib64/sssd/modules/libsss_autofs.so: cannot open shared object file: No such file or directory
 1월 29 14:06:07 localhost.localdomain automount[2634]: open_sss_lib:78: lookup(sss): failed to open /usr/lib64/sssd/modules/libsss_autofs.so: /usr/lib64/sssd/modules/libsss_autofs.so: cannot open shared object file: No such file or directory
 1월 29 14:06:09 localhost.localdomain automount[2634]: open_sss_lib:78: lookup(sss): failed to open /usr/lib64/sssd/modules/libsss_autofs.so: /usr/lib64/sssd/modules/libsss_autofs.so: cannot open shared object file: No such file or directory
 1월 29 14:06:11 localhost.localdomain automount[2634]: problem reading master map, maximum wait exceeded
 1월 29 14:06:11 localhost.localdomain automount[2634]: /usr/sbin/automount: warning: could not read at least one map source after waiting, continuing ...
 1월 29 14:06:11 localhost.localdomain automount[2634]: open_sss_lib:78: lookup(sss): failed to open /usr/lib64/sssd/modules/libsss_autofs.so: /usr/lib64/sssd/modules/libsss_autofs.so: cannot open shared object file: No such file or directory
 1월 29 14:06:11 localhost.localdomain systemd[1]: Started Automounts filesystems on demand.
[root@localhost ~]# test_nfs_c1 -rw,intr 192.168.46.90:/test2/nfsServer1
bash: test_nfs_c1: 명령을 찾을 수 없습니다...
[root@localhost ~]# test_nfs_c2 -rw,intr 192.168.46.0:/test2/nfsServer2
bash: test_nfs_c2: 명령을 찾을 수 없습니다...
[root@localhost ~]# test_nfs_c3 -rw,intr *:/test2/nfsServer3
bash: test_nfs_c3: 명령을 찾을 수 없습니다...
[root@localhost ~]#

// 자동 서비스 등록

[root@localhost ~]# systemctl is-enabled autofs.service
disabled
[root@localhost ~]#
[root@localhost ~]# systemctl enable autofs.service
Created symlink from /etc/systemd/system/multi-user.target.wants/autofs.service to /usr/lib/systemd/system/autofs.service.
[root@localhost ~]#
[root@localhost ~]# systemctl is-enabled autofs.service
enabled

// autofs 확인

 

// 방화벽 내가 한거 어디감 ? -.,-

반응형
LIST