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

     

  • 相关阅读:
    mysql更新语句中的safe_mode
    MySQL数据类型详解
    刚更新完版本就炸了:java.lang.NoClassDefFoundError: org/apache/commons/io/output/UnsynchronizedByteArrayOutputStream
    微信支付分创建支付分订单+签名+验签
    根据序列号加密生产4*4的密码,如:X9PL-TERY-NOZN-GMF1
    对称加密:AES
    MySQL按中文排序
    腾讯云COS分片上传
    Linux中jar包指定端口、配置文件启动并记录日志
    Java8新特性两个关联集合合并成父子级
  • 原文地址:https://www.cnblogs.com/arcer/p/3632570.html
Copyright © 2011-2022 走看看