标签:oat sync app color size 虚拟化 oca emc emctl
nfs配置
随着虚拟化的不可逆地推进,BCC之间的文件传输会越来越少,取而代之的是共享。
smb 与 nfs 相比,前者需要权限设置,后者相对更简单一点。
[[服务器端]]
rpm -qa | grep nfs
rpm -qa | grep rpcbind
yum -y install nfs-utils rpcbind
mkdir -p /usr/local/bhnc/images
chmod 666 /usr/local/bhnc/images
vi /etc/exports
**********************************************************
/usr/local/bhnc/images 172.16.0.0/20(rw,no_root_squash,no_all_squash,sync)
**********************************************************
#这里是另一种配置,供参考
cat >> /etc/exports <<EOF
/data/osg-file *(ro,sync)
/data/OpenSceneGraph-Data-3.0.0 *(ro,sync)
/data/osg-earth-cache 192.168.0.0/16(rw,sync,no_all_squash,no_root_squash)
EOF
#bhnc用的是
/usr/local/bhnc/images 172.16.0.0/20(rw,no_root_squash,no_all_squash,sync)
exportfs -r
或增加看现有的列表
exportfs -rv
for SERVICE in rpcbind nfs; do
systemctl enable $SERVICE
systemctl start $SERVICE
systemctl status $SERVICE
done
rpcinfo -p localhost
[[客户器端]]
yum -y install nfs-utils
mkdir -p /usr/local/bhnc/images
showmount -e 172.16.0.6
showmount -e db1
#mount -t nfs 10.10.103.80:/export/nfs /testnfs
mount -t nfs 172.16.0.6:/usr/local/bhnc/images /usr/local/bhnc/images
#这样手工 mount,可以,但出了意外后,要 umount 了才能重连。
[root@ ~]# ls /usr/local/bhnc/images
ls: cannot access /usr/local/bhnc/images: Stale file handle
[root@ ~]# umount /usr/local/bhnc/images
[root@ ~]# mount -t nfs 172.16.0.6:/usr/local/bhnc/images /usr/local/bhnc/images
[root@ ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 40G 5.1G 33G 14% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 57M 3.9G 2% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
tmpfs 799M 0 799M 0% /run/user/0
172.16.0.6:/usr/local/bhnc/images 493G 5.0G 463G 2% /usr/local/bhnc/images
#开机自启动
vi /etc/fstab
*****************************************************************
172.16.0.6:/usr/local/bhnc/images /usr/local/bhnc/images nfs default 0 0
或者
172.16.0.6:/usr/local/bhnc/images /usr/local/bhnc/images nfs auto,nodev,noatime,bg,soft,intr,rw,rsize=32768,wsize=32768 0 0
*****************************************************************
#所以,这里用 autofs 。
#转为 autofs 前,要先 umount 掉原有的
#另外要说明的是,autofs 是按需请求的,没需求,df 命令是看不到连接的。
#还有一件事,autofs 配置文件的分隔符是 TAB ,不是空格,不是空格,不是空格
yum -y install autofs
vi /etc/auto.master
*****************************************************************
/data
*****************************************************************
vi /etc/auto.misc
*****************************************************************
image -fstype=nfs,rw
*****************************************************************
[[测试]]
[root]#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root 18G 1.1G 16G 7% /
tmpfs 112M 0 112M 0% /dev/shm
/dev/sda1 477M 54M 398M 12% /boot
10.10.103.80:/export/nfs 18G 1.1G 16G 7% /lys
标签:oat sync app color size 虚拟化 oca emc emctl
原文地址:https://www.cnblogs.com/timer705/p/12215105.html