ambari HDFS-HA 回滚
查看hdfs的信息 curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://centos1:8080/api/v1/clusters/hadoop1/services/HDFS hadoop1为cluster名字,HDFS为服务名称 查看服务 centos1,datanode,journalnode,namenode centos2,datanode,journalnode,SECONDARY_NAMENODE centos3,datanode,journalnode,namenode 停止hdfs curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo": {"context":"Stop Service"},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' http://centos1:8080/api/v1/clusters/hadoop1/services/HDFS 查看各主机的组件角色 curl -u admin:admin -i http://centos1:8080/api/v1/clusters/hadoop1/host_components?HostRoles/component_name=NAMENODE curl -u admin:admin -i http://centos1:8080/api/v1/clusters/hadoop1/host_components?HostRoles/component_name=SECONDARY_NAMENODE curl -u admin:admin -i http://centos1:8080/api/v1/clusters/hadoop1/host_components?HostRoles/component_name=JOURNALNODE curl -u admin:admin -i http://centos1:8080/api/v1/clusters/hadoop1/host_components?HostRoles/component_name=ZKFC
删除zkfc curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://centos1:8080/api/v1/clusters/hadoop1/hosts/centos1.hadoop/host_components/ZKFC curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://centos1:8080/api/v1/clusters/hadoop1/hosts/centos2.hadoop/host_components/ZKFC
启用SECONDARY_NAMENODE curl -u admin:admin -H "X-Requested-By: ambari" -X POST -d '{"host_components" : [{"HostRoles":{"component_name":"SECONDARY_NAMENODE"}}] }' http://centos1:8080/api/v1/clusters/hadoop1/hosts?Hosts/host_name=centos2.hadoop curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"Enable Secondary NameNode"},"Body":{"HostRoles":{"state":"INSTALLED"}}}' http://centos1:8080/api/v1/clusters/hadoop1/hosts/centos2.hadoop/host_components/SECONDARY_NAMENODE curl -u admin:admin -H "X-Requested-By: ambari" -X GET "http://centos1:8080/api/v1/clusters/hadoop1/host_components?HostRoles/component_name=SECONDARY_NAMENODE&fields=HostRoles/state" 删除journalnode curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://centos1:8080/api/v1/clusters/hadoop1/host_components?HostRoles/component_name=JOURNALNODE curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://centos1:8080/api/v1/clusters/hadoop1/hosts/centos1.hadoop/host_components/JOURNALNODE curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://centos1:8080/api/v1/clusters/hadoop1/hosts/centos2.hadoop/host_components/JOURNALNODE curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://centos1:8080/api/v1/clusters/hadoop1/hosts/centos3.hadoop/host_components/JOURNALNODE
删除额外的namenode: curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://centos1:8080/api/v1/clusters/hadoop1/host_components?HostRoles/component_name=NAMENODE curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://centos1:8080/api/v1/clusters//hadoop1/hosts/centos2.hadoop/host_components/NAMENODE 在ambari的页面上将 hdfs的配置版本信息改为HA之前的版本v2 HDFS->Configs