存储概述
存储外置的链接方式:
DAS
直连方式
NAS
网络接入存储
SAN
存储区域网络
NAS存储模式搭建
NFS:
[root@nfs-server ~]# yum -y install nfs-utils rpcbind
[root@nfs-client ~]# yum -y install nfs-utils rpcbind
[root@nfs-server ~]# mkdir -p /opt/test
[root@nfs-server ~]# ll /opt/
[root@nfs-server ~]# vi /etc/exports
/opt/test 172.24.3.0/24(rw,no_root_squash,no_all_squash,sync,anonuid=501,anongid=501)
[root@nfs-server ~]# exportfs -r
[root@nfs-server ~]# service rpcbind start
[root@nfs-server ~]# service nfs start
[root@nfs-server ~]# chkconfig rpcbind on
[root@nfs-server ~]# chkconfig nfs on
[root@nfs-server ~]# showmount -e 172.24.3.26
Export list for 172.24.3.26:
/opt/test 172.24.3.0/24
Client操作
[root@nfs-client ~]# mount -t nfs 172.24.3.26:/opt/test /mnt/
[root@nfs-client ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 20G 994M 20G 5% /
devtmpfs 984M 0 984M 0% /dev
tmpfs 1001M 0 1001M 0% /dev/shm
tmpfs 1001M 25M 977M 3% /run
tmpfs 1001M 0 1001M 0% /sys/fs/cgroup
tmpfs 201M 0 201M 0% /run/user/0
172.24.3.26:/opt/test 20G 1.1G 19G 6% /mnt
验证NFS
[root@nfs-client mnt]# touch abc.txt
[root@nfs-client mnt]# ll
total 0
-rw-r--r-- 1 root root 0 May 11 10:31 abc.txt
[root@nfs-client mnt]# md5sum abc.txt
d41d8cd98f00b204e9800998ecf8427e abc.txt
[root@nfs-server ~]# ll /opt/test/
total 0
-rw-r--r-- 1 root root 0 May 11 10:31 abc.txt
[root@nfs-server ~]# md5sum /opt/test/abc.txt
d41d8cd98f00b204e9800998ecf8427e /opt/test/abc.txt
[root@nfs-client mnt]#mount -t nfs 172.24.3.26:/opt/test /mnt -o proto=tcp -o nolock
评论区