台州市建设厅网站外包做网站的会给你什么
- 作者: 五速梦信息网
- 时间: 2026年04月20日 08:25
当前位置: 首页 > news >正文
台州市建设厅网站,外包做网站的会给你什么,wordpress用户名密码注册,广告设计与制作需要学什么文章目录 访问网络附加存储一、网络附加存储1.1、存储类型1.3、通过NFS挂载NAS1.4、NFS挂载过程服务端客户端 二、实验#xff1a;搭建NFS服务端及挂载到nfs客户端服务端客户端测试命令合集服务端客户端 访问网络附加存储
一、网络附加存储
1.1、存储类型 DAS#xff1a;Di… 文章目录 访问网络附加存储一、网络附加存储1.1、存储类型1.3、通过NFS挂载NAS1.4、NFS挂载过程服务端客户端 二、实验搭建NFS服务端及挂载到nfs客户端服务端客户端测试命令合集服务端客户端 访问网络附加存储
一、网络附加存储
1.1、存储类型 DASDirect Attached Storage直连附加存储将存储设备通过总线SCSI、PCI、 IDE等接口直接连接到一台服务器上使用。 NASNetwork Attached Storage网络附加存储将设备通过TCP/IP网络共享 提供文件存储。 SANStorage Area Network存储区域网络将设备通过光纤通道或者TCP/IP网 络共享出去提供块设备。SAN存储可以进一步划分为FC-SAN和IP-SAN。 存储类型 ### 1.2、RPC通信介绍
NFS 支持的功能相当的多而不同的功能都会使用不同的程序来启动每启动一个功能就会启用一些端口来传输数据因此NFS的功能所对应的端口没有固定住而是随机取用一些未被使用的小于1024的端口提供服务。但如此一来客户端如何获得服务器端的相关端口呢
此时我们就得需要远程过程调用(RPC)的服务RPC最主要的功能是注册每个NFS功能所对应的端口并且汇报给客户端让客户端可以连结到正确的端口。 RPC通信原理 1.3、通过NFS挂载NAS
NFS是Network File System的缩写即网络文件系统。最早由Sun公司开发用来在UNIXLinux系统间实现磁盘文件共享的一种方法。它的主要功能是通过网络让不同的主机系统之间可以共享文件或目录。NFS客户端一般为应用服务器例如web可以通过挂载mount的方式将NFS服务端共享的数据目录挂载到NFS客户端本地系统中就是某一个挂载点下。从NFS客户端的机器本地看NFS服务端共享的目录就好像是客户自己的磁盘分区或者目录一样而实际上确是远端的NFS服务端的目录。
在企业集群架构的工作场景中NFS网络文件系统一般被用来存储共享视频、图片、附件等静态资源文件。一般是把网站用户上传的文件都放在NFS共享里例如BBS产品的图片、附件、头像特别是中小网站公司应用频率更高。
NFS服务器导出共享目录NFS客户端将导出的共享挂载到本地。
挂载NFS共享方式 使用mount命令手动挂载。 使用/etc/fstab条目在启动时自动挂载。 按需挂载使用autofs服务或systemd. automount功能。
1.4、NFS挂载过程
服务端 安装环境依赖包 rpm -q rpcbind nfs-utils oryum -y install nfs-utils rpcbind设置共享目录 mkdir -p /opt/nfs
chmod 777 /opt/nfsvim /etc/exports/opt/nfs .../(rw,sync,no_root_squash)客户机地址可以是主机名、IP 地址、网段地址允许使用“”、“?”通配符。 “rw” 表示允许读写“ro” 表示为只读。 sync 表示同步写入到内存与硬盘中。 no_root_squash 表示当客户机以root身份访问时赋予本地root权限默认是root_squash。 root_squash 表示客户机用root用户访问该共享目录时将root用户映射成匿名用户。 all_squash 所有访问用户都映射为匿名用户或用户组。
async 将数据先保存在内存缓冲区中必要时才写入磁盘。
subtree_check默认若输出目录是一个子目录则nfs服务器将检查其父目录的权限。
no_subtree_check 即使输出目录是一个子目录nfs服务器也不检查其父目录的权限这样可以提高效率。
anonuidxxx 指定NFS服务器/etc/passwd文件中匿名用户的UID
anongidxxx 指定NFS服务器/etc/group文件中匿名用户的GID 关闭防火墙启动 NFS 服务程序
手动加载NFS共享服务时应该先启动rpcbind再启动nfs
systemctl stop firewalld
systemctl start rpcbind
systemctl start nfs
systemctl enable rpcbind
systemctl enable nfsnetstat -anptu | grep 111 ##rpcbind默认使用端口111
netstat -anptu | grep 2049 ##nfs默认使用端口2049查看本机发布的 NFS 共享目录
exportfs -rv #发布共享
showmount -e客户端 安装环境依赖包 rpm -q rpcbind nfs-utils oryum -y install nfs-utils rpcbind启动 NFS 服务程序
手动加载NFS共享服务时应该先启动rpcbind再启动nfs
bash
systemctl stop firewalld
systemctl start rpcbind
systemctl start nfs
systemctl enable rpcbind
systemctl enable nfsnetstat -anptu | grep 111 ##rpcbind默认使用端口111
netstat -anptu | grep 2049 ##nfs默认使用端口2049挂载点:使用 mkdir 在合适的位置创建挂载点。 mkdir -p /opt/test挂载:与分区上的文件系统一样NFS共享必须先进行挂载才可用。 无论在哪种情况下您都必须作为root用户登录或使用sudo 命令以超级用户身份运行这些命令。 临时挂载 mount -t nfs -o rw,sync nfs-serverIP:/opt/nfs /opt/test-t nfs选项是NFS共享的文件系统类型默认值。-o sync选项使mount立即与NFS服务器同步写操作默认值为async。下一次系统启动时此NFS共享将不可用 可用于在持久提供共享之前对挂载NFS共享进行测试。永久挂载 vim /etc/fstab…nfs-serverIP:/opt/nfs /opt/test nfs rw,sync 0 0卸载 umount nfs-serverIP:/opt/nfsorumount mountpoint二、实验搭建NFS服务端及挂载到nfs客户端
服务端 安装环境依赖包 设置共享目录 关闭防火墙启动 NFS 服务程序 查看本机发布的 NFS 共享目录
客户端
安装环境依赖包 启动 NFS 服务程序 创建挂载点 挂载 测试
在nfs服务端/opt/nfs下创建“wl.txt”文件内容为“wl love to bath point 88 technician”;在nfs客户端查看是否有“wl.txt”文件,并检查文件内容是否与服务端一致。 命令合集
服务端
[rootnfs-server ~]#yum -y install nfs-utils rpcbind
已加载插件fastestmirror, langpacks
Determining fastest mirrors
local | 3.6 kB 00:00:00
软件包 1:nfs-utils-1.3.0-0.68.el7.2.x86_64 已安装并且是最新版本
软件包 rpcbind-0.2.0-49.el7.x86_64 已安装并且是最新版本
无须任何处理[rootnfs-server ~]#mkdir -p /opt/nfs[rootnfs-server ~]#chmod 777 /opt/nfs[rootnfs-server ~]#vim /etc/exports/opt/nfs 10.190.33.0/24(rw,sync,no_root_squash)[rootnfs-server ~]#systemctl stop firewalld[rootnfs-server ~]#systemctl start rpcbind[rootnfs-server ~]#systemctl start nfs[rootnfs-server ~]#systemctl enable rpcbind[rootnfs-server ~]#systemctl enable nfs
Created symlink from /etc/systemd/system/multi-user.target.wants/nfs-server.service to /usr/lib/systemd/system/nfs-server.service.[rootnfs-server ~]#netstat -anptu | grep 111
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 713/rpcbind
tcp6 0 0 :::111 :::* LISTEN 713/rpcbind
udp 0 0 0.0.0.0:111 0.0.0.0:* 713/rpcbind
udp6 0 0 :::111 :::* 713/rpcbind [rootnfs-server ~]#netstat -anptu | grep 2049
tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN -
tcp6 0 0 :::2049 :::* LISTEN -
udp 0 0 0.0.0.0:2049 0.0.0.0:* -
udp6 0 0 :::2049 :::* - [rootnfs-server ~]#exportfs -rv
exporting 10.190.33.0/24:/opt/nfs[rootnfs-server ~]#showmount -e
Export list for nfs-server:
/opt/nfs 10.190.33.0/24[rootnfs-server ~]#echo wl love to bath point 88 technician /opt/nfs/wl.txt[rootnfs-server ~]#cat /opt/nfs/wl.txt
wl love to bath point 88 technician客户端
[rootnfs-client- ~]#yum -y install nfs-utils rpcbind
已加载插件fastestmirror, langpacks
Loading mirror speeds from cached hostfile
local | 3.6 kB 00:00:00
软件包 1:nfs-utils-1.3.0-0.68.el7.2.x86_64 已安装并且是最新版本
软件包 rpcbind-0.2.0-49.el7.x86_64 已安装并且是最新版本
无须任何处理[rootnfs-client- ~]# systemctl start rpcbind[rootnfs-client- ~]# systemctl stop firewalld[rootnfs-client- ~]# systemctl start rpcbind[rootnfs-client- ~]# systemctl start nfs[rootnfs-client- ~]# systemctl enable rpcbind[rootnfs-client- ~]# systemctl enable nfs
Created symlink from /etc/systemd/system/multi-user.target.wants/nfs-server.service to /usr/lib/systemd/system/nfs-server.service.[rootnfs-client- ~]# mkdir -p /opt/test[rootnfs-client- ~]# mount -t nfs -o rw,sync 10.190.33.10:/opt/nfs /opt/test[rootnfs-client- ~]# mount -a[rootnfs-client- ~]# df
文件系统 1K-块 已用 可用 已用% 挂载点
devtmpfs 480736 0 480736 0% /dev
tmpfs 497816 0 497816 0% /dev/shm
tmpfs 497816 8508 489308 2% /run
tmpfs 497816 0 497816 0% /sys/fs/cgroup
/dev/mapper/centos-root 38770180 4585544 34184636 12% /
/dev/sda1 1038336 177468 860868 18% /boot
/dev/sr0 4635056 4635056 0 100% /mnt/sr
tmpfs 99564 12 99552 1% /run/user/42
tmpfs 99564 0 99564 0% /run/user/0
10.190.33.10:/opt/nfs 38770304 4584960 34185344 12% /opt/test[rootnfs-client- ~]# vim /etc/fstab…10.190.33.10:/opt/nfs /opt/test nfs rw,sync 0 0[rootnfs-client- ~]# mount -a[rootnfs-client- ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 470M 0 470M 0% /dev
tmpfs 487M 0 487M 0% /dev/shm
tmpfs 487M 8.4M 478M 2% /run
tmpfs 487M 0 487M 0% /sys/fs/cgroup
/dev/mapper/centos-root 37G 4.4G 33G 12% /
/dev/sda1 1014M 174M 841M 18% /boot
/dev/sr0 4.5G 4.5G 0 100% /mnt/sr
tmpfs 98M 12K 98M 1% /run/user/42
tmpfs 98M 0 98M 0% /run/user/0
10.190.33.10:/opt/nfs 37G 4.4G 33G 12% /opt/test[rootnfs-client- ~]# ll /opt/test/
总用量 4
-rw-r–r–. 1 root root 36 5月 6 01:44 wl.txt[rootnfs-client- ~]# cat /opt/test/wl.txt
wl love to bath point 88 technician
- 上一篇: 台州市建设监理协会网站数码类网站名称
- 下一篇: 台州市椒江建设工程机械厂网站东莞网站设计制作网站
相关文章
-
台州市建设监理协会网站数码类网站名称
台州市建设监理协会网站数码类网站名称
- 技术栈
- 2026年04月20日
-
台州市建设规划局路桥分局网站在上海做钟点工的网站
台州市建设规划局路桥分局网站在上海做钟点工的网站
- 技术栈
- 2026年04月20日
-
台州模板网建站电子商务网站建设知识
台州模板网建站电子商务网站建设知识
- 技术栈
- 2026年04月20日
-
台州市椒江建设工程机械厂网站东莞网站设计制作网站
台州市椒江建设工程机械厂网站东莞网站设计制作网站
- 技术栈
- 2026年04月20日
-
台州市临海建设局网站php网站开发机试题目
台州市临海建设局网站php网站开发机试题目
- 技术栈
- 2026年04月20日
-
台州市临海建设局网站网站开发杭州
台州市临海建设局网站网站开发杭州
- 技术栈
- 2026年04月20日
