debian10 nfs简单搭建
生活随笔
收集整理的這篇文章主要介紹了
debian10 nfs简单搭建
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
需求:
共享/data/share目錄;
用于存儲(chǔ)server01主機(jī)的web數(shù)據(jù);
僅允許service網(wǎng)段(10.1.100.與172.16.100.)訪問該共享。
步驟:
安裝
apt-get install nfs-common nfs-kernel-server
配置
修改
vim /etc/exports
創(chuàng)建共享目錄
mkdir /data/share -p
添加配置
/data/share 10.1.100.* || 172.16.100.*(rw,sync,no_root_squash,insecure)
重啟服務(wù)
systemctl restart nfs-kernel-server
在service安裝客戶端
apt-get install nfs-common
查看可以掛載的文件(我服務(wù)端用的ip是10.1.100.128)
showmount -e 10.1.100.128
創(chuàng)建掛載目錄
mkdir /data/mynfs
掛載
mount 10.1.100.128:/data/share /data/mynfs
開機(jī)自啟動(dòng)(rc.local是debian的開機(jī)自啟動(dòng)項(xiàng))
echo "/usr/bin/mount 192.168.31.228:/data/share /data/mynfs">> /etc/rc.local
完成
總結(jié)
以上是生活随笔為你收集整理的debian10 nfs简单搭建的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: debian10 dhcp简单配置
- 下一篇: debian10 apache2使用ss