在不同的机器上配置secondarynamenode

只需要修改namenode那台主机的配置文件即可:

修改hdfs-site.xml:

<configuration>
<property>
    <name>dfs.replication</name>
    <value>3</value>
</property>
<property>
    <name>dfs.http.address</name>
    <value>hadoop102: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>hadoop104:50090</value>
</property>
</configuration>

其中hadoop102是namenode那台主机,hadoop104是配置有secondarynamenode的那台主机。

然后在配有namenode那台主机上输入start-dfs.sh,发现hadoop104的那台机器上面的secondarynamenode也启动了。

猜你喜欢

转载自blog.csdn.net/qq_37076742/article/details/83104395