配置NFS作为HDFS高可用的共享存储系统

所有命令或步骤:

首先,在各个节点上安装nfs服务

  yum install -y nfs

  service rpcbind start

  service nfs start

配置开机自启动服务

  chkconfig rpcbind on

  chkconfig nfs on

编辑/etc/exports文件,添加下面一行

  /mnt/share hadoop1(rw,no_root_squash,async) hadoop2(rw,no_root_squash,async) hadoop6(rw,no_root_squash,async) hadoop7(rw,no_root_squash,async)

  表示后面四台主机对共享目录/mnt/share具有读写权限.

  在hdfs-site.xml中添加下面几行

  

     <property>
                <name>dfs.namenode.shared.edits.dir.ns1</name>
                <value>file:///root/softs/hadoop-2.7.3/sharelogs/eidts_ns1</value>
        </property>
        <property>
                <name>dfs.namenode.shared.edits.dir.ns2</name>
                <value>file:///root/softs/hadoop-2.7.3/sharelogs/eidts_ns2</value>
        </property>

  在需要使用共享目录的节点上挂载共享目录

  mount -t nfs hadoop1:/mnt/share sharelogs/

其他具体配置参照hadoop官方文档

原文地址:https://www.cnblogs.com/cqdxwjd/p/9812765.html