云服务器内容精选

  • 操作步骤 以root用户登录本地服务器。 挂载前,查看本地服务器系统是否安装NFS客户端。 表1 查询和安装NFS客户端 操作系统 查询命令 回显信息(已安装) 安装命令 Red Hat、Fedora或Oracle Enterprise Linux、Euler OS 2.3 rpm -qa|grep nfs libnfsidmapnfs-utils sudo yum -y install nfs-utils SUSE或OpenSUSE rpm -qa|grep nfs nfsidmap nfs-client zypper install nfs-client Debian或Ubuntu dpkg -l nfs-common nfs-common sudo apt-get install nfs-common 不同操作系统回显信息不同,若回显表1信息,说明已经成功安装NFS客户端,则执行步骤3;若未回显表中信息,则需执行表中安装命令安装NFS客户端。 登录客户端执行如下命令,创建本地挂载路径。 mkdir /本地路径 执行如下命令,挂载文件共享。 mount -t nfs -o vers=3,timeo=600,nolock 网关IP:/共享名称 /本地路径 执行如下命令,查看文件共享挂载结果。 df –h 在/etc/rc.local中追加如下加粗部分,确保操作系统重启时,能够自动挂载文件共享。 #!/bin/bash# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES## It is highly advisable to create own systemd services or udev rules# to run scripts during boot instead of using this file.## In contrast to previous versions due to parallel execution during boot# this script will NOT be run after all other services.## Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure# that this script will be executed during boot.touch /var/lock/subsys/localmount -t nfs -o vers=3,timeo=600,nolock 网关IP:/共享名称 /本地路径 挂载成功后,用户可以在客户端使用CSG提供的NFS文件共享服务,进行相应的文件共享操作。