centos6使用rpm方式安装nfs
背景
1、是这样的,已有nfs存储服务器,要把几台机器也加入nfs挂载,正常来说就是一条命令解决:
mount -t nfs -o nolock 192.168.1.13:/disk/xiaodai /home/xiaodai/disk1
但是报错了,报错内容就是客户端服务器没安装nfs,如图:
[root@localhost nfs_rpm]# mount -t nfs -o nolock 192.168.1.13:/disk/xiaodai /home/xiaodai/disk1
mount: wrong fs type, bad option, bad superblock on 192.168.1.13:/disk/xiaodai,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so
2、行吧,知道了是没有nfs那就安装吧
常规就命令安装就完了
yum -y install nfs-utils
但是事实没那么简单,还是报错了哈,先人板板
就是找不到包,让你尝试其他镜像源,我换了阿里163都不能通过yum命令调用资源,报错如图:
就一条命令的事咋那么费劲,我去,原来是centos6老古董,我尝试安装 yum install tree -y 也是爆404行吧,
CentoS6 停止维护更新日期:2020年11月30日
CentoS7 停止维护更新日期: 2024年6月
CentoS8 停止维护更新日期: 2029年5月
2020年12月2日,centos官方停止了对centos6的所有更新,并且下架了包括官方
所有的centos6源,目前阿里、163、清华等centos6源已无法使用。
解决方法
2、将资源包上传到服务器,并解压,得到以下rpm包,执行安装这些包有步骤顺序哈。如图:
[ ]
[ ]
logs nacos nfs_rpm.zip
[ ]
Archive: nfs_rpm.zip
creating: nfs_rpm/
inflating: nfs_rpm/keyutils-1.4-4.el6.x86_64.rpm
inflating: nfs_rpm/keyutils-libs-1.4-4.el6.x86_64.rpm
inflating: nfs_rpm/libevent-1.4.13-4.el6.x86_64.rpm
inflating: nfs_rpm/libgssglue-0.1-11.el6.x86_64.rpm
inflating: nfs_rpm/libtirpc-0.2.1-5.el6.x86_64.rpm
inflating: nfs_rpm/nfs-utils-1.2.3-26.el6.x86_64.rpm
inflating: nfs_rpm/nfs-utils-lib-1.1.5-4.el6.x86_64.rpm
inflating: nfs_rpm/rpcbind-0.2.0-9.el6.x86_64.rpm
[ ]
logs nacos nfs_rpm nfs_rpm.zip
[ ]
[ ]
keyutils-1.4-4.el6.x86_64.rpm libevent-1.4.13-4.el6.x86_64.rpm libtirpc-0.2.1-5.el6.x86_64.rpm nfs-utils-lib-1.1.5-4.el6.x86_64.rpm
keyutils-libs-1.4-4.el6.x86_64.rpm libgssglue-0.1-11.el6.x86_64.rpm nfs-utils-1.2.3-26.el6.x86_64.rpm rpcbind-0.2.0-9.el6.x86_64.rpm
[ ]
3-26.el6.x86_64.rpm --nodeps --forcewarning: libgssglue-0.1-11.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...
1:libgssglue
[ ]
[ ]
warning: libtirpc-0.2.1-5.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...
1:libtirpc
[ ]
[ ]
warning: rpcbind-0.2.0-9.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...
1:rpcbind
[ ]
[ ]
warning: libevent-1.4.13-4.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...
1:libevent
[ ]
[ ]
warning: nfs-utils-lib-1.1.5-4.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...
1:nfs-utils-lib
[ ]
[ ]
warning: nfs-utils-1.2.3-26.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...
1:nfs-utils
[ ]
Starting rpcbind: [ OK ]
[ ]
Starting NFS services: [ OK ]
Starting NFS mountd: [ OK ]
Starting NFS daemon: [ OK ]
如上图其实就已经安装好了nfs,剩下的就是挂载nfs存储了
3、创建目录挂载
至此挂载完成,活干完了差不多
[ ]
[ ]
[ ]
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
91G 29G 57G 34% /
tmpfs 7.8G 0 7.8G 0% /dev/shm
/dev/sda1 190M 29M 151M 16% /boot
192.168.1.13:/disk/xiaodai
72T 39T 34T 54% /home/xiaodai/disk1
4、设置服务开机自启动
将上面那个挂载的命令写入/etc/rc.local
[root@risk58 ~]# tail -1f /etc/rc.local
mount -t nfs -o nolock 192.168.1.13:/disk/xiaodai /home/xiaodai/disk1
然后服务自启动
[root@risk57 nfs_rpm]# chkconfig --level 345 nfs on
[root@risk57 nfs_rpm]# chkconfig --level 345 rpcbind on
最后
就是centos6不支持维护了啊,连源都没了,每次都这么找包去安装不方便的,建议大家还是酌情升级啊!