千家信息网

namenode ha by zookeeper

发表于:2025-01-23 作者:千家信息网编辑
千家信息网最后更新 2025年01月23日,tickTime=2000initLimit=10syncLimit=5clientPort=2181dataDir=/home/tim/zkdataserver.1=tim-dn1:2888:388
千家信息网最后更新 2025年01月23日namenode ha by zookeeper

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

3

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

停掉hdfs集群后

启用自动容灾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




启动zk集群后

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

用于在zk集群创建/hadoop-ha/mycluster目录

0