美文网首页
阿里云ECS开机自动挂载NAS失败解决办法

阿里云ECS开机自动挂载NAS失败解决办法

作者: 非常强壮的蚂蚁 | 来源:发表于2018-06-05 17:48 被阅读0次

需求说明:

            在阿里云上购买了一个NAS系统,现在希望将NAS文件系统挂载到ECS上,ECS系统为Centos7.2。

准备情况:

            1、先在阿里云上购买NAS文件系统,并创建挂载点(获取挂载点地址)。
            2、在centos 上安装nfs, (yum -y install nfs-utils)

操作步骤:

            3、通过在服务器shell界面手动操作: mount -t nfs -o vers=4.0 014544bbf6-wdt41.cn-hangzhou.nas.aliyuncs.com:/ /local/mntdir  挂载成功。
            4、将该命令写入到/etc/rc.local上,同时设置chmod +x /etc/rc.d/rc.local,并重启服务器。

报错信息:

            5、重启后发现挂载不成功,在/var/log/message中发现错误信息:  mount.nfs: Failed to resolve server 0e0d849bee-brc88.cn-hangzhou.nas.aliyuncs.com: Name or service not known

错误原因:

            6、初步判断为阿里云的nas文件系统的url地址,是依赖于某个阿里云的服务,必须在该服务启动后才能够正常解析到nas文件系统的url地址。有人说是这个服务cloud-final.target

解决办法:

             7、在/etc/rc.local 文件中mount nfs命令前加个sleep 5。然后重启服务器,自动挂载成功。
             8、具体信息如下
                    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/local
                    sleep 5
                    mount -t nfs -o vers=4.0 0e0d849bee-brc88.cn-hangzhou.nas.aliyuncs.com:/ /fonova_nas_disk

相关文章

网友评论

      本文标题:阿里云ECS开机自动挂载NAS失败解决办法

      本文链接:https://www.haomeiwen.com/subject/zalmsftx.html