zoukankan      html  css  js  c++  java
  • NFS服务器搭建

    创建NFS共享目录,

    服务端ip192.168.1.11  主机名:hate

    客户端ip192.168.1.10  主机名:love

    [root@hate ~]# mkdir -p /nfs/backup

    [root@hate ~]# chmod -R 777 /nfs

    修改/etc/exports

    /nfs/backup        love(rw,async,nohide,no_subtree_check)

    注意:这里的解析名一定要用hostname,否则会出现权限的问题

    [root@hate ~]# showmount -e

    mount clntudp_create: RPC: Program not registered

    遇到这个问题时解决办法

    [root@hate ~]# /etc/init.d/nfs restart

    [root@hate ~]# showmount -e

    Export list for hate:

    /nfs/backup love
    [root@hate ~]# service nfs restart

    [root@hate ~]# chkconfig nfs on

    客户端192.168.1.10挂载NFS文件系统

    [root@love ~]# mkdir /mynfs

    手动挂载

    [root@love ~]#  mount -o rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600 hate:/nfs/backup /mynfs

    [root@love ~]# df -h

    Filesystem            Size  Used Avail Use% Mounted on

    /dev/mapper/VolGroup00-LogVol00

                           45G  9.3G   33G  23% /

    /dev/sda1              99M   12M   82M  13% /boot

    tmpfs                1014M     0 1014M   0% /dev/shm

    hate:/nfs/backup       45G  6.5G   36G  16% /mynfs

    实现开机自动挂载

    [root@love ~]# vi /etc/rc.local 

    #!/bin/sh

    #

    # This script will be executed *after* all the other init scripts.

    # You can put your own initialization stuff in here if you don't

    # want to do the full Sys V style init stuff.

    touch /var/lock/subsys/local

    添加如下配置:这样还可以支持RMAN备份。

    modprobe hangcheck-timer hangcheck_tick=30 hangcheck_margin=180

    /bin/mount -o rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600  hate:/nfs/backup /mynfs

    重启系统

    [root@love ~]# reboot

    [root@love ~]# df -h

    Filesystem            Size  Used Avail Use% Mounted on

    /dev/mapper/VolGroup00-LogVol00

                           45G  9.3G   33G  23% /

    /dev/sda1              99M   12M   82M  13% /boot

    tmpfs                1014M     0 1014M   0% /dev/shm

    192.168.1.11:/nfs/backup   45G  6.5G   36G  16% /mynfs

     

  • 相关阅读:
    zabbix添加Tomcat监控
    Jenkins发布
    Linux : 从私钥中提取公钥
    记一次拆机除尘换硅脂的经历,第一次拆机幸好没拆坏,心真大-_-!
    超简单让ubuntu开启wifi热点(亲测16.04与14.04可用)
    一起动手打造个人娱乐级linux
    python数据结构之链表(一)
    华为OJ机试题目:两个大整数相乘(纯C语言实现两个大整数相乘,两种方法实现大数相乘)
    C语言学习笔记---好用的函数memcpy与memset
    个人关于python装饰器的白痴理解
  • 原文地址:https://www.cnblogs.com/arcer/p/3632570.html
Copyright © 2011-2022 走看看