209数据库服务器磁盘空间不够,想临时从另外一台服务器上借点空间,想到了用NFS共享文件。操作如下:
共享文件系统108:
--新建一个文件夹
[root@fina7-108 EAS70]# mkdir oradata
--检测下刚创建的文件夹
- [root@fina7-108 EAS70]# ls
- aa.txt easdeploy.sh kingdee70-2011-11-08.tar kingdee70-bak lost+found tmp
- backup java.txt kingdee70-2011-11-10 kingdee70.rar net.png upload
- easdeploy.bak.sh kingdee70 kingdee70-2011-11-14.tar.gz kingdee70.tar.gz oradata
- [root@fina7-108 EAS70]# cd oradata/
- [root@fina7-108 oradata]# pwd
- /EAS70/oradata
--编辑 /etc/exports 文件,在文件末尾加上/EAS70/oradata 192.168.17.209(rw,no_root_squash)
- [root@fina7-108 oradata]# vi /etc/exports
- [root@fina7-108 oradata]# cat /etc/exports
- /opt 192.168.17.182(rw,no_root_squash)
- /EAS70/oradata 192.168.17.209(rw,no_root_squash)
- [root@fina7-108 oradata]# /etc/rc.d/init.d/portmap start
- Starting portmap: [ OK ]
- [root@fina7-108 oradata]# service nfs restart
- Shutting down NFS mountd: [FAILED]
- Shutting down NFS daemon: [FAILED]
- Shutting down NFS quotas: [FAILED]
- Shutting down NFS services: [ OK ]
- Starting NFS services: [ OK ]
- Starting NFS quotas: [ OK ]
- Starting NFS daemon: [ OK ]
- Starting NFS mountd: [ OK ]
- [root@fina7-108 oradata]# showmount -a
- All mount points on fina7-108:
--查看防火墙状态,如果没关闭就把他关了
- [root@fina7-108 oradata]# service iptables status
- Firewall is stopped.
--touch一个文件测试用
[root@fina7-108 oradata]# touch test.txt
客户机2.209:
- [root@testmachine mnt]# cd /
- [root@testmachine /]# cd oraData/
- [root@testmachine oraData]# ls
- dataDump dipdb erpdatafile lost+found oracle_single.tar.gz
--在该目录下创建一个 fin-data文件夹用于挂载NFS文件
- [root@testmachine oraData]# mkdir fin-data
- [root@testmachine oraData]# mount -t nfs 192.168.17.108:/EAS70/oradata /oraData/fin-data
- [root@testmachine oraData]# vi /etc/fstab
添加一行:
- LABEL=/oraData/fin-data /oraData/fin-data ext3 defaults 1 2
- [root@testmachine oraData]# df -h
- 文件系统 容量 已用 可用 已用% 挂载点
- /dev/sda1 9.7G 6.6G 2.7G 71% /
- /dev/sda8 3.0G 698M 2.1G 25% /var
- /dev/sda7 3.9G 3.3G 467M 88% /usr
- /dev/sda6 3.9G 3.7G 75M 99% /home
- /dev/sda5 3.9G 73M 3.7G 2% /tmp
- /dev/sda3 3.9G 2.8G 911M 76% /opt
- /dev/sda9 19G 12G 6.5G 64% /oracle
- /dev/sda10 94G 81G 8.5G 91% /backups
- /dev/sda11 236G 185G 39G 83% /oraData
- tmpfs 7.9G 0 7.9G 0% /dev/shm
- 192.168.17.108:/EAS70/oradata
- 161G 70G 83G 46% /oraData/fin-data
- [root@testmachine oraData]# cd /oraData/fin-data/
- [root@testmachine fin-data]# ls
- test.txt
OK,可以看到刚才创建的文件啦!