自动挂载
autofs
设置开机自起
/etc/auto.master #主配置文件
左边为挂载点,右边为映射文件名(绝对路径)
/mnt /etc/auto.cc --timeout=5 #设置自动卸载时间(单位秒)
/etc/auto.XXX #建立映射文件
触发点 选项 挂载资源
redhat -fstype=ext4 192.168.0.2:/dev/sda5
读写,软,可中断 :为本地资源
最后挂载点为 /mnt/redhat
ls /opt/redhat #触发触发点
/etc/auto.misc #映射文件示范文件
vim /etc/auto.master /etc/auto.XXX -o #同时打开
-O 垂直分割
-o 水平分割
普通模式ctrl + 两次w 切换文件
qall! #退出多个文件
NFS
设置开机自启
文件共享服务,映射端口(111)
netstat -tpln #查看端口
关闭防火墙:
systemctl stop firewalld
/etc/exports #nfs配置文件
资源 可访问客户端和选项
/opt/jinlabs 192.168.0.0/255.255.255.0(rw,ro,sync,root_squash,no_root_squash,all_squash)
#sync数据同步,(数据写入先到内存等到一点量才写入硬盘,保证硬盘的使用率控制)
#root_squash(当你使用root创建文件或文件夹,则他们的属于所属主为nobody)
#no_root_squash(哪一个用户创建,他的所属用户就是谁)
#all_squash(无论你使用寿命用户创建,所以所属用户都为nobody)
showmount -e 192.168.0.2 #查看是否共享
挂载使用NFS:
mount -t nfs 192.168.0.2:/opt/joinlabs /mnt/nfs
可选选项
报错解决:
[root@localhost ~]# showmount -e 192.168.0.155
clnt_create: RPC: Program not registered
解决方法:
systemctl restart rpcbind.service
systemctl restart nfs.service
#他们两个的启动顺序需要注意!!!
NTP
网络时钟同步
安装 NTP 服务
controller 和 compute 节点
#yum -y install ntp
配置 controller 节点 #客户端
编辑/etc/ntp.conf 文件
到主配置文件22行里删除server4行 再添加以下内容
server 127.127.1.0
fudge 127.127.1.0 stratum 10
保存并退出
启动 ntp 服务器
#service ntpd start / 7:systemctl start ntpd.service
#chkconfig ntpd on / 7:systemctl enable ntp.service
配置 compute 节点 #计算
#ntpdate controller
#chkconfig ntpdate on / 7:systemctl enable ntpdate.service
安装包
system-config-date #图形化配置
GUI特用:
system-config-date
视频链接:
链接: http://pan.baidu.com/s/1c29yXna 密码: rehs