NAS 云存储

NAS 云存储

#步骤


1.开通购买NAS




tips:地区和可用区域要和你的服务器一样 在同一个地区,我这里是华东 上海  可用区b


2.找到挂载配置命令




sudo mount -t nfs -o vers=3,nolock,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 363e1495d9-yqg71.cn-shanghai.nas.aliyuncs.com:/ /mnt



3.安装nfs组件
yum -y install nfs-utils



4.查看是否挂载成功
df -h

[root@tomcat mnt]# df -h
Filesystem                                       Size  Used Avail Use% Mounted on
devtmpfs                                         214M     0  214M   0% /dev
tmpfs                                            224M     0  224M   0% /dev/shm
tmpfs                                            224M  468K  224M   1% /run
tmpfs                                            224M     0  224M   0% /sys/fs/cgroup
/dev/vda1                                         40G  3.5G   34G  10% /
tmpfs                                             45M     0   45M   0% /run/user/0
363e1495d9-yqg71.cn-shanghai.nas.aliyuncs.com:/   10P     0   10P   0% /mnt


5.实现永久挂载
#tips:可实现永久挂载的方式
vi /etc/rc.local
vi /etc/fstab
vi /etc/inittab



vi /etc/rc.local
	把挂载这条命令直接粘贴进去就可以了	
sudo mount -t nfs -o vers=3,nolock,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 363e1495d9-yqg71.cn-shanghai.nas.aliyuncs.com:/ /mnt


chmod 755 /etc/rc.d/rc.local 


6.测试 开机-是否挂载成功、


reboot

df -h


[root@tomcat ~]# df -h
Filesystem                                       Size  Used Avail Use% Mounted on
devtmpfs                                         214M     0  214M   0% /dev
tmpfs                                            224M     0  224M   0% /dev/shm
tmpfs                                            224M  456K  224M   1% /run
tmpfs                                            224M     0  224M   0% /sys/fs/cgroup
/dev/vda1                                         40G  3.4G   35G   9% /
363e1495d9-yqg71.cn-shanghai.nas.aliyuncs.com:/   10P     0   10P   0% /mnt
tmpfs                                             45M     0   45M   0% /run/user/0
[root@tomcat ~]# 




posted @ 2024-04-02 16:38  三思博客  阅读(21)  评论(0)    收藏  举报