Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Namenode ha by zookeeper

Shulou Source: shulou.com Published: 2022-06-03 05:44:12 09月25日 Update

TickTime=2000

InitLimit=10

SyncLimit=5

ClientPort=2181

DataDir=/home/tim/zkdata

Server.1=tim-dn1:2888:3888

Server.2=tim-dn2:2888:3888

Server.3=tim-dn3:2888:3888

Core-site.xml

Fs.defaultFS

Hdfs://mycluster

Hdfs-site.xml

Tim@tim-dn2:~/hadoop/etc/hadoop$ cat hdfs-site.xml

Dfs.replication

three

Dfs.nameservices

Mycluster

Dfs.ha.namenodes.mycluster

Nn1,nn2

Dfs.namenode.rpc-address.mycluster.nn1

Tim-nn:8020

Dfs.namenode.rpc-address.mycluster.nn2

Tim-2nn:8020

Dfs.namenode.http-address.mycluster.nn1

Tim-nn:50070

Dfs.namenode.http-address.mycluster.nn2

Tim-2nn:50070

Dfs.namenode.shared.edits.dir

Qjournal://tim-nn:8485;tim-2nn:8485/mycluster

Dfs.client.failover.proxy.provider.mycluster

Org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider

Dfs.journalnode.edits.dir

/ home/tim/hadoop/journal

After stopping the hdfs cluster

Enable automatic disaster recovery hdfs-site dfs.ha.automatic-failover.enabled true

His specifies that the cluster should be set up for automatic failover. In your core-site.xml file, add:

Ha.zookeeper.quorum zk1.example.com:2181,zk2.example.com:2181,zk3.example.com:2181

Tim@tim-dn2:~/hadoop/etc/hadoop$ nano core-site.xml

GNU nano 2.5.3 File: core-site.xml Modified

->

Fs.defaultFS

Hdfs://mycluster

Ha.zookeeper.quorum

Tim-dn1:2181,tim-dn2:2181,tim-dn3:2181

After starting the zk cluster

Tim@tim-nn:~$ hdfs zkfc-formatZK

Used to create a / hadoop-ha/mycluster directory in a zk cluster

Tags: Cluster directory Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno vpn Redmi Apple NVidia