zoukankan      html  css  js  c++  java
  • OS + Centos 7 NFS Server

    S

    10.0.0.0/8 是10.x.x.x
    10.0.0.0/16 是10.0.x.x
    10.0.0.0/24 是10.0.0.x

    问题1 :jboss 1 NFS Client / jboss2 NFS Client + NFS Server ,当NFS 共享文件账户非nfsnodoy,则如下解决

    解决1:

    NSF Server创建jboss机器启动xxx.war的用户jbossuser

    JBOSS1 机器 NFS Client jbossuser账户

    JBOSS2 机器 NFS Client jbossuser账户

    三方同有账户jbossuser,且id号一样。

    Centos7安装配置NFS服务和挂载

    https://www.cnblogs.com/lixiuran/p/7117000.html

    现在有3台服务器 s1(主),s2(从), s3(从)需要实现文件实时同步,我们可以安装Nfs服务端和客户端来实现!
    一、安装 NFS 服务器所需的软件包:
    yum install -y nfs-utils
    二、编辑exports文件,添加从机

    vim /etc/exports
    /home/nfs/ 192.168.248.0/24(rw,sync,fsid=0)
    同192.168.248.0/24一个网络号的主机可以挂载NFS服务器上的/home/nfs/目录到自己的文件系统中
    rw表示可读写;sync表示同步写,fsid=0表示将/data找个目录包装成根目录
    三、启动nfs服务
    先为rpcbind和nfs做开机启动:(必须先启动rpcbind服务)

    systemctl enable rpcbind.service
    systemctl enable nfs-server.service
    然后分别启动rpcbind和nfs服务:

    systemctl start rpcbind.service
    systemctl start nfs-server.service
    确认NFS服务器启动成功:

    rpcinfo -p
    检查 NFS 服务器是否挂载我们想共享的目录 /home/nfs/:
    exportfs -r
    #使配置生效
    exportfs
    #可以查看到已经ok
    /home/nfs 192.168.248.0/24
    四、在从机上安装NFS 客户端
    首先是安裝nfs,同上,然后启动rpcbind服务
    先为rpcbind做开机启动:
    systemctl enable rpcbind.service
    然后启动rpcbind服务:
    systemctl start rpcbind.service
    注意:客户端不需要启动nfs服务
    检查 NFS 服务器端是否有目录共享:showmount -e nfs服务器的IP
    showmount -e 192.168.248.208
    Export list for 192.168.248.208:
    /home/nfs 192.168.248.0/24
    在从机上使用 mount 挂载服务器端的目录/home/nfs到客户端某个目录下:
    cd /home && mkdir /nfs
    mount -t nfs 192.168.248.208:/home/nfs /home/nfs
    df -h 查看是否挂载成功。

    http://blog.csdn.net/taiyang1987912/article/details/41696319
    http://www.linuxidc.com/Linux/2015-05/117378.htm


    复制代码
    [root@localhost ~]# showmount -e 172.19.162.102
    clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host) 解决方法: [root@pro-www-m root]# rpcinfo -p 172.19.162.102
    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
    100005 1 udp 20048 mountd
    100005 1 tcp 20048 mountd
    100005 2 udp 20048 mountd
    100005 2 tcp 20048 mountd
    100005 3 udp 20048 mountd
    100005 3 tcp 20048 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 31206 nlockmgr
    100021 3 udp 31206 nlockmgr
    100021 4 udp 31206 nlockmgr
    100021 1 tcp 31241 nlockmgr
    100021 3 tcp 31241 nlockmgr
    100021 4 tcp 31241 nlockmgr
    iptables -I INPUT -p tcp -s 172.19.162.100 --dport 111 -j ACCEPT
    iptables -I INPUT -p udp -s 172.19.162.100 --dport 111 -j ACCEPT
    iptables -I INPUT -p tcp -s 172.19.162.100 --dport 2049 -j ACCEPT
    iptables -I INPUT -p udp -s 172.19.162.100 --dport 2049 -j ACCEPT
    iptables -I INPUT -p tcp -s 172.19.162.100 --dport 20048 -j ACCEPT
    iptables -I INPUT -p udp -s 172.19.162.100 --dport 20048 -j ACCEPT
    iptables -I INPUT -p tcp -s 172.19.162.100 --dport 31206 -j ACCEPT
    iptables -I INPUT -p udp -s 172.19.162.100 --dport 31206 -j ACCEPT

    END

    NSF Server创建jboss机器启动xxx.war的用户jbossuser

  • 相关阅读:
    综合布线系统工程招标文件简述
    Python3 深浅拷贝
    Python3 使用基本循环实现多级目录(思路)
    Python3 列表,元组,字典,字符串知识小结
    Python3 适合初学者学习的银行账户登录系统
    Python3乘法口诀表(由上至下+由下至上)
    VBox on 14.04: Kernel driver not installed (rc=-1908) [duplicate]
    javaee+tomcat新特性,乱码问题
    javaee+tomcat新特性,乱码问题
    RecyclerView下拉加载集合越界问题
  • 原文地址:https://www.cnblogs.com/lindows/p/12161267.html
Copyright © 2011-2022 走看看