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
hdfs-site.xml
tim@tim-dn2:~/hadoop/etc/hadoop$ cat hdfs-site.xml
停掉hdfs集群后
启用自动容灾hdfs-sitedfs.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
-->
启动zk集群后
tim@tim-nn:~$ hdfs zkfc -formatZK
用于在zk集群创建/hadoop-ha/mycluster目录