千家信息网

hadoop2.x 将namenode 与 SecondaryNameNode 分开部署

发表于:2025-12-01 作者:千家信息网编辑
千家信息网最后更新 2025年12月01日,修改方法在hadoop namenode节点上修改hadoop2.7.7 目录cd ~/hadoop-2.7.7/etc/hadoop/配置[hadoop@namenodeyw hadoop]$ ca
千家信息网最后更新 2025年12月01日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       dfs.http.address     namenodeyw:50070          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.              dfs.namenode.secondary.http-address     datanodeyw1:50090         dfs.name.dir     /opt/hadoop/dfs/name     Path on the local filesystem where theNameNode stores the namespace and transactions logs persistently.         dfs.data.dir     /opt/hadoop/dfs/data     Comma separated list of paths on the localfilesystem of a DataNode where it should store its blocks.         dfs.replication     3        dfs.permissions    false    need not permissions  


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

           hadoop.tmp.dir        /opt/hadoop/tmp        Abase for other temporary directories.              fs.default.name        hdfs://namenodeyw:9000             fs.checkpoint.period       3600       The number of seconds between two periodic checkpoints.             fs.checkpoint.size       67108864   

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

依次重启服务。

先重启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.


0