文章目录
实现自动挂载-autofs
autofs工具简单使用
#安装autofs工具
[root@rhel82 ~]# yum install -y autofs
#启动autofs服务
[root@rhel82 ~]# systemctl start autofs
#autofs服务启动后会有/misc/cd目录,设置虚拟机连接光盘,实现自动挂载系统光盘
[root@rhel82 ~]# ll /misc/
总用量 0
[root@rhel82 ~]# cd /misc/cd
[root@rhel82 cd]# df -h
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 2.0G 10M 2.0G 1% /run
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/nvme0n1p5 25G 4.4G 21G 18% /
/dev/nvme0n1p2 1014M 208M 807M 21% /boot
tmpfs 392M 1.2M 391M 1% /run/user/42
tmpfs 392M 4.6M 387M 2% /run/user/0
/dev/sr0 7.9G 7.9G 0 100% /misc/cd
[root@rhel82 ~]# rpm -ql autofs
[root@rhel82 ~]# rpm -qc autofs
autofs配置详细说明
自动挂载资源有两种格式:
相对路径挂载法
绝对路径挂载法
优化 Linux 系统性能
安装 Tuned
[root@rhel82 ~]# yum install tuned -y
[root@rhel82 ~]# systemctl status tuned
选择调整配置文件
检查当前活动的调优配置文件:
[root@rhel82 ~]# tuned-adm active
Current active profile: virtual-guest
可以使用更多配置文件,如下:
[root@rhel82 ~]# tuned-adm list
Available profiles:
- accelerator-performance - Throughput performance based tuning with disabled higher latency STOP states
- balanced - General non-specialized tuned profile
- desktop - Optimize for the desktop use-case
- hpc-compute - Optimize for HPC compute workloads
- intel-sst - Configure for Intel Speed Select Base Frequency
- latency-performance - Optimize for deterministic performance at the cost of increased power consumption
- network-latency - Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance
- network-throughput - Optimize for streaming network throughput, generally only necessary on older CPUs or 40G+ networks
- optimize-serial-console - Optimize for serial console use.
- powersave - Optimize for low power consumption
- throughput-performance - Broadly applicable tuning that provides excellent performance across a variety of common server workloads
- virtual-guest - Optimize for running inside a virtual guest
- virtual-host - Optimize for running KVM guests
Current active profile: virtual-guest
tuned-adm配置文件命令用于将活动配置文件切换到其他配置文件,此示例将调整我们的系统以实现最大吞吐量:
[root@rhel82 ~]# tuned-adm profile throughput-performance
确认当前配置文件:
[root@rhel82 ~]# tuned-adm active
Current active profile: throughput-performance
检查系统推荐的调整配置文件
tuned-adm命令还可以建议系统的调整配置文件,这基于各种系统特征,包括系统是否为虚拟机以及在系统安装期间选择的其他预定义类别:
[root@rhel82 ~]# tuned-adm recommend
virtual-guest
然后,可以将个人资料设置为推荐值:
[root@rhel82 ~]# tuned-adm profile virtual-guest
查看配置文件详细信息,请运行:
[root@rhel82 ~]# tuned-adm profile_info virtual-guest
Profile name:
virtual-guest
Profile summary:
Optimize for running inside a virtual guest
Profile description:
关闭已调优的调整活动:
[root@rhel82 ~]# tuned-adm off
[root@rhel82 ~]# tuned-adm active
No current active profile.