当前位置:网站首页>RHCSA 08 - automount配置
RHCSA 08 - automount配置
2022-07-04 03:51:00 【王万林 Ben】
前言
目录按需挂载,空闲时自动卸载,可以采用automount技术。尤其是在大型HPC环境,成千上万的用户家目录,使用automount降低seek time,提高dentry缓存命中率,可大大节省内存资源。
环境
RHEL 8
实践
安装nfs-utils,它提供nfs server,
[[email protected] ~]# dnf install -y nfs-utils
Rocky Linux 8 - AppStream 14 kB/s | 4.8 kB 00:00
Rocky Linux 8 - AppStream 20 MB/s | 8.8 MB 00:00
Rocky Linux 8 - BaseOS 17 kB/s | 4.3 kB 00:00
Rocky Linux 8 - BaseOS 8.7 MB/s | 3.6 MB 00:00
Rocky Linux 8 - Extras 14 kB/s | 3.5 kB 00:00
Rocky Linux 8 - Extras 39 kB/s | 11 kB 00:00
Dependencies resolved.
====================================================================================================================
Package Architecture Version Repository Size
====================================================================================================================
Installing:
nfs-utils x86_64 1:2.3.3-51.el8 baseos 503 k
Installing dependencies:
gssproxy x86_64 0.8.0-20.el8 baseos 118 k
keyutils x86_64 1.5.10-9.el8 baseos 65 k
libverto-libevent x86_64 0.3.0-5.el8 baseos 15 k
python3-pyyaml x86_64 3.12-12.el8 baseos 192 k
quota x86_64 1:4.04-14.el8 baseos 213 k
quota-nls noarch 1:4.04-14.el8 baseos 94 k
rpcbind x86_64 1.2.5-8.el8 baseos 69 k
Transaction Summary
====================================================================================================================
Install 8 Packages
Total download size: 1.2 M
Installed size: 3.8 M
Downloading Packages:
(1/8): libverto-libevent-0.3.0-5.el8.x86_64.rpm 333 kB/s | 15 kB 00:00
(2/8): gssproxy-0.8.0-20.el8.x86_64.rpm 2.3 MB/s | 118 kB 00:00
(3/8): keyutils-1.5.10-9.el8.x86_64.rpm 1.2 MB/s | 65 kB 00:00
(4/8): python3-pyyaml-3.12-12.el8.x86_64.rpm 16 MB/s | 192 kB 00:00
(5/8): nfs-utils-2.3.3-51.el8.x86_64.rpm 23 MB/s | 503 kB 00:00
(6/8): quota-nls-4.04-14.el8.noarch.rpm 10 MB/s | 94 kB 00:00
(7/8): rpcbind-1.2.5-8.el8.x86_64.rpm 11 MB/s | 69 kB 00:00
(8/8): quota-4.04-14.el8.x86_64.rpm 10 MB/s | 213 kB 00:00
--------------------------------------------------------------------------------------------------------------------
Total 4.5 MB/s | 1.2 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: rpcbind-1.2.5-8.el8.x86_64 1/8
Installing : rpcbind-1.2.5-8.el8.x86_64 1/8
Running scriptlet: rpcbind-1.2.5-8.el8.x86_64 1/8
Installing : quota-nls-1:4.04-14.el8.noarch 2/8
Installing : quota-1:4.04-14.el8.x86_64 3/8
Installing : python3-pyyaml-3.12-12.el8.x86_64 4/8
Installing : libverto-libevent-0.3.0-5.el8.x86_64 5/8
Installing : gssproxy-0.8.0-20.el8.x86_64 6/8
Running scriptlet: gssproxy-0.8.0-20.el8.x86_64 6/8
Installing : keyutils-1.5.10-9.el8.x86_64 7/8
Running scriptlet: nfs-utils-1:2.3.3-51.el8.x86_64 8/8
Installing : nfs-utils-1:2.3.3-51.el8.x86_64 8/8
Running scriptlet: nfs-utils-1:2.3.3-51.el8.x86_64 8/8
Verifying : gssproxy-0.8.0-20.el8.x86_64 1/8
Verifying : keyutils-1.5.10-9.el8.x86_64 2/8
Verifying : libverto-libevent-0.3.0-5.el8.x86_64 3/8
Verifying : nfs-utils-1:2.3.3-51.el8.x86_64 4/8
Verifying : python3-pyyaml-3.12-12.el8.x86_64 5/8
Verifying : quota-1:4.04-14.el8.x86_64 6/8
Verifying : quota-nls-1:4.04-14.el8.noarch 7/8
Verifying : rpcbind-1.2.5-8.el8.x86_64 8/8
Installed:
gssproxy-0.8.0-20.el8.x86_64 keyutils-1.5.10-9.el8.x86_64 libverto-libevent-0.3.0-5.el8.x86_64
nfs-utils-1:2.3.3-51.el8.x86_64 python3-pyyaml-3.12-12.el8.x86_64 quota-1:4.04-14.el8.x86_64
quota-nls-1:4.04-14.el8.noarch rpcbind-1.2.5-8.el8.x86_64
Complete!
创建目录并导出,启动nfs server,
[[email protected] ~]# mkdir -p /users/nfs/{lisa,linda,anna}
[[email protected] ~]# echo "/users *(rw,no_root_squash)" > /etc/exports
[[email protected] ~]# systemctl enable --now nfs-server
Created symlink /etc/systemd/system/multi-user.target.wants/nfs-server.service → /usr/lib/systemd/system/nfs-server.service.
[[email protected] ~]# showmount -e localhost
Export list for localhost:
/users *
在客户端,安装autofs,
[[email protected] ~]# dnf install -y autofs
Last metadata expiration check: 0:00:19 ago on Sat 02 Jul 2022 07:14:43 AM CEST.
Dependencies resolved.
====================================================================================================================
Package Architecture Version Repository Size
====================================================================================================================
Installing:
autofs x86_64 1:5.1.4-82.el8 baseos 706 k
Transaction Summary
====================================================================================================================
Install 1 Package
Total download size: 706 k
Installed size: 2.8 M
Downloading Packages:
autofs-5.1.4-82.el8.x86_64.rpm 9.6 MB/s | 706 kB 00:00
--------------------------------------------------------------------------------------------------------------------
Total 2.6 MB/s | 706 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : autofs-1:5.1.4-82.el8.x86_64 1/1
Running scriptlet: autofs-1:5.1.4-82.el8.x86_64 1/1
Verifying : autofs-1:5.1.4-82.el8.x86_64 1/1
Installed:
autofs-1:5.1.4-82.el8.x86_64
Complete!
参考/misc配置项,对家目录进行配置,并启动autofs服务,
[[email protected] ~]# grep '^/misc' /etc/auto.master
/misc /etc/auto.misc
[[email protected] ~]# echo "/home/nfs /etc/auto.nfs" >> /etc/auto.master
[[email protected] ~]# grep -i linux /etc/auto.misc
#linux -ro,soft ftp.example.org:/pub/linux
[[email protected] ~]# echo "* -rw localhost:/users/nfs/&" > /etc/auto.nfs
[[email protected] ~]# systemctl enable --now autofs
Created symlink /etc/systemd/system/multi-user.target.wants/autofs.service → /usr/lib/systemd/system/autofs.service.
检查/home/nfs目录,没有任何文件(夹),
[[email protected] ~]# ls -al /home/nfs
total 0
drwxr-xr-x. 2 root root 0 Jul 2 07:15 .
drwxr-xr-x. 4 root root 31 Jul 2 07:15 ..
触发一下其中一个子目录,可以看到挂载上了,
[[email protected] ~]# cd /home/nfs/linda
[[email protected] linda]# pwd
/home/nfs/linda
[[email protected] linda]# mount | tail -5
nfsd on /proc/fs/nfsd type nfsd (rw,relatime)
/etc/auto.misc on /misc type autofs (rw,relatime,fd=5,pgrp=10818,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=41624)
-hosts on /net type autofs (rw,relatime,fd=11,pgrp=10818,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=41636)
/etc/auto.nfs on /home/nfs type autofs (rw,relatime,fd=17,pgrp=10818,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=41640)
/dev/mapper/rl-root on /home/nfs/linda type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)
后记
在大型HPC环境,一般在LDAP里配置好不同location的AUTOMOUNT,实现统一配置。
边栏推荐
- Programmers' telecommuting is mixed | community essay solicitation
- postgresql 用户不能自己创建表格配置
- Configuration and hot update of nocturnal simulator in hbuildx
- hbuildx中夜神模拟器的配置以及热更新
- *. No main manifest attribute in jar
- STM32 external DHT11 display temperature and humidity
- 一位毕业生的自我分享
- pytest多进程/多线程执行测试用例
- [book club issue 13] packaging format of video files
- Katalon使用script实现查询List大小
猜你喜欢
Graduation project: design seckill e-commerce system
mysql数据库的存储
Global exposure and roller shutter exposure of industrial cameras
Katalon framework test web (XXVI) automatic email
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
10 reasons for not choosing to use free virtual hosts
2022-07-03: there are 0 and 1 in the array. Be sure to flip an interval. Flip: 0 becomes 1, 1 becomes 0. What is the maximum number of 1 after turning? From little red book. 3.13 written examination.
图解网络:什么是热备份路由器协议HSRP?
Exercises in quantum mechanics
The maximum expiration time of client secret in azure ad application registration is modified to 2 years
随机推荐
idea修改主体颜色
Deep thinking on investment
How was my life in 2021
【愚公系列】2022年7月 Go教学课程 002-Go语言环境安装
毕业三年,远程半年 | 社区征文
LNK2038 检测到“RuntimeLibrary”的不匹配项: 值“MD_DynamicRelease”不匹配值“MDd_DynamicDebug”(main.obj 中)
如何有效远程办公之我见 | 社区征文
RHCSA 07 - 用户与群组管理
vim正确加区间注释
Katalon中控件的参数化
Katalon framework test web (XXVI) automatic email
Katalon uses script to query list size
I was tortured by my colleague's null pointer for a long time, and finally learned how to deal with null pointer
Distributed system: what, why, how
VIM mapping command
新型数据中心,助力加快构建以数据为关键要素的数字经济
Flink学习6:编程模型
STM32外接DHT11显示温湿度
Msgraphmailbag - search only driveitems of file types
[microservice openfeign] use openfeign to remotely call the file upload interface