hadoop2.x 将namenode 与 SecondaryNameNode 分开部署

修改方法

在hadoop namenode节点上修改hadoop2.7.7 目录 

cd ~/hadoop-2.7.7/etc/hadoop/

配置

[hadoop@namenodeyw hadoop]$ cat masters 

datenodeyw1     #说明 SecondaryNameNode 服务将再这台节点上启动

[hadoop@namenodeyw hadoop]$ cat hdfs-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<!-- #红色部门为将namenode 与  SecondaryNameNode 分开部署 -->
  <property>
     <name>dfs.http.address</name>
     <value>namenodeyw:50070</value>
     <description>
     The address and the base port where the dfs namenode web ui will listen on. If the port is 0 then the server will start on a free port.
     </description>
  </property>
  <property>
     <name>dfs.namenode.secondary.http-address</name>
     <value>datanodeyw1:50090</value>
  </property>
  <property>
     <name>dfs.name.dir</name>
     <value>/opt/hadoop/dfs/name</value>
     <description>Path on the local filesystem where theNameNode stores the namespace and transactions logs persistently.</description>
  </property>
  <property>
     <name>dfs.data.dir</name>
     <value>/opt/hadoop/dfs/data</value>
     <description>Comma separated list of paths on the localfilesystem of a DataNode where it should store its blocks.</description>
  </property>
  <property>
     <name>dfs.replication</name>
     <value>3</value>
  </property>
  <property>
    <name>dfs.permissions</name>
    <value>false</value>
    <description>need not permissions</description>
  </property>
</configuration>


[hadoop@namenodeyw hadoop]$ cat core-site.xml

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
   <property>
        <name>hadoop.tmp.dir</name>
        <value>/opt/hadoop/tmp</value>
        <description>Abase for other temporary directories.</description>
   </property>
   <property>
        <name>fs.default.name</name>
        <value>hdfs://namenodeyw:9000</value>
   </property>
<! -- #红色部门为将namenode 与  SecondaryNameNode 分开部署 -->
   <property>
       <name>fs.checkpoint.period</name>
       <value>3600</value>
       <description>The number of seconds between two periodic checkpoints.</description>
   </property>
   <property>
       <name>fs.checkpoint.size</name>
       <value>67108864</value>
   </property>
</configuration>

然后将改配置文件目录分别同步到其他节点。

依次重启服务。

先重启hadoop机器  ./start-all.sh 

再重启 zookeeper    ./zkSever.sh  start

再到配置hbase主节点上启动habase     ./start-hbase.sh

在namenode上启动

./start-all.sh 启动后进程截图

[hadoop@namenodeyw sbin]$ jps

8017 NodeManager

8389 Jps

7498 NameNode

7642 DataNode

7900 ResourceManager

[hadoop@datanodeyw1 hadoop]$ jps

16529 DataNode

16305 Main

16770 NodeManager

17238 Jps

16639 SecondaryNameNode


[hadoop@datanodeyw2 bin]$ jps

13139 DataNode

13400 Jps

13257 NodeManager

在namenode上启动 start-yarn.sh  提示已经启动。

[hadoop@namenodeyw sbin]$ ./start-yarn.sh

starting yarn daemons

resourcemanager running as process 7900. Stop it first.

namenodeyw: nodemanager running as process 8017. Stop it first.

datanodeyw2: nodemanager running as process 13257. Stop it first.

datanodeyw1: nodemanager running as process 16770. Stop it first.


猜你喜欢

转载自blog.51cto.com/531117978/2311628