共有元サーバ(192.168.0.1)

# yum install -y nfs-utils
# vi /etc/exports
  /www/temp 192.168.0.2(rw,sync,no_root_squash)
  ###ここの192.168.0.2を192.168.0.0/24のようなアドレスに設定してもいい

# vi /etc/sysconfig/nfs (NFSのサービスポート設定)
 MOUNTD_PORT=892

# rpcinfo -p
    program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp  57554  status
    100024    1   tcp  46995  status
    100005    1   udp    892  mountd
    100005    1   tcp    892  mountd
    100005    2   udp    892  mountd
    100005    2   tcp    892  mountd
    100005    3   udp    892  mountd
    100005    3   tcp    892  mountd
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100227    3   tcp   2049  nfs_acl
    100003    3   udp   2049  nfs
    100003    4   udp   2049  nfs
    100227    3   udp   2049  nfs_acl
    100021    1   udp  54284  nlockmgr
    100021    3   udp  54284  nlockmgr
    100021    4   udp  54284  nlockmgr
    100021    1   tcp  47434  nlockmgr
    100021    3   tcp  47434  nlockmgr
    100021    4   tcp  47434  nlockmgr

# systemctl restart nfs
共有元のiptables設定
# vi /etc/sysconfig/iptables
 -A INPUT -p tcp -s 192.168.0.0/24 --dport 111 -j ACCEPT
 -A INPUT -p tcp -s 192.168.0.0/24 --dport 2049 -j ACCEPT
 -A INPUT -p udp -s 192.168.0.0/24 --dport 111 -j ACCEPT
 -A INPUT -p udp -s 192.168.0.0/24 --dport 2049 -j ACCEPT
 -A INPUT -p udp -s 192.168.0.0/24 --dport 892 -j ACCEPT
 -A INPUT -p udp -s 192.168.0.0/24 --dport 892 -j ACCEPT

# systemctl restart iptables

共有先サーバ(192.168.0.2)

# mkdir /www/temp
# mount -t nfs 192.168.0.1:/www/temp /www/temp

###起動するときにマウント
# vi /etc/fstab
 192.168.0.1:/www/temp /www/temp nfs auto,rw,vers=3,hard,intr,tcp,rsize=32768,wsize=32768  0 0

# mount -a ###fstabに書いた内容をすぐに反映させる

results matching ""

    No results matching ""