namenode hdfs_如何将新的HDFS NameNode元数据目录添加到现有集群?

namenode hdfs

We have a running HDFS cluster. Currently, the NameNode metadata data directory has only one directory configured in hdfs-site.xml:

我们有一个正在运行的HDFS集群。 当前,NameNode元数据数据目录只有在hdfs-site.xml中配置的一个目录:

<property>
    <name>dfs.namenode.name.dir</name>
    <value>file:///home/hadoop/hdfs/</value>
    <description>NameNode directory for namespace and transaction logs storage.</description>
</property>

We would like to add a new directory for dfs.namenode.name.dir to make replicas of the metadata on a separated disk for higher data reliability.

我们想为dfs.namenode.name.dir添加一个新目录,以在分离的磁盘上复制元数据,以提高数据可靠性。

How to safely add the new directory?

如何安全地添加新目录?

Backup first as the NameNode metadata directory contains critical data for the HDFS cluster.

首先备份为NameNode元数据目录,其中包含HDFS群集的关键数据。

Then following these steps.

然后按照以下步骤。

First, shutdown the NameNode.

首先, 关闭NameNode。

Second, copy the files from the old NameNode metadata directory to the new metadata directory. Such as to /home/hadoop/hdfs2,

其次,将文件从旧的NameNode元数据目录复制到新的元数据目录。 例如到/ home / hadoop / hdfs2,

cp -r /home/hadoop/hdfs/* /home/hadoop/hdfs2/

Third, add the new metadata directory to hdfs-site.xml:

第三,将新的元数据目录添加到hdfs-site.xml中:

<property>
    <name>dfs.namenode.name.dir</name>
    <value>file:///home/hadoop/hdfs/, file:///home/hadoop/hdfs2/</value>
    <description>NameNode directory for namespace and transaction logs storage.</description>
</property>

Last, restart the NameNode.

最后,重新启动NameNode。

Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自: https://www.systutorials.com/how-to-add-a-new-hdfs-namenode-metadata-directory-to-an-existing-cluster/

namenode hdfs

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值