zoukankan      html  css  js  c++  java
  • ambari HDFS-HA 回滚

    curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://zwshen86:8080/api/v1/clusters/bigdata/services/STORM

    命令中的 zwshen86 为 Ambari Server 的机器名(端口默认为 8080),bigdata 为 cluster 名字,STORM 为 Service 的名字。

    查看hdfs的信息

    curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://node01:8080/api/v1/clusters/ocdp/services/HDFS

    主机角色

    node01,datanode,journalnode,
    node02,datanode,journalnode,SECONDARY_NAMENODE
    node03,datanode,journalnode
    node04,namenode,
    node05,namenode,

     停止hdfs

    curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo": {"context":"Stop Service"},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' http://node01:8080/api/v1/clusters/ocdp/services/HDFS
    

     查看各主机的组件角色

    curl -u admin:admin -i http://node01:8080/api/v1/clusters/ocdp/host_components?HostRoles/component_name=NAMENODE
    
    curl -u admin:admin -i http://node01:8080/api/v1/clusters/ocdp/host_components?HostRoles/component_name=SECONDARY_NAMENODE
    
    
    curl -u admin:admin -i http://node01:8080/api/v1/clusters/ocdp/host_components?HostRoles/component_name=JOURNALNODE
    
    curl -u admin:admin -i  http://node01:8080/api/v1/clusters/ocdp/host_components?HostRoles/component_name=ZKFC

    删除zkfc

    curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE  http://node01:8080/api/v1/clusters/ocdp/hosts/node05/host_components/ZKFC
    curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE  http://node01:8080/api/v1/clusters/ocdp/hosts/node04/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://node01:8080/api/v1/clusters/ocdp/hosts?Hosts/host_name=node02
    
    
    curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"Enable Secondary NameNode"},"Body":{"HostRoles":{"state":"INSTALLED"}}}' http://node01:8080/api/v1/clusters/ocdp/hosts/node02/host_components/SECONDARY_NAMENODE
    
    curl -u admin:admin -H "X-Requested-By: ambari" -X GET "http://node01:8080/api/v1/clusters/ocdp/host_components?HostRoles/component_name=SECONDARY_NAMENODE&fields=HostRoles/state"

    删除journalnode

    curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://node01:8080/api/v1/clusters/ocdp/host_components?HostRoles/component_name=JOURNALNODE
    curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://node01:8080/api/v1/clusters/ocdp/hosts/node01/host_components/JOURNALNODE
    curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://node01:8080/api/v1/clusters/ocdp/hosts/node02/host_components/JOURNALNODE
    curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://node01:8080/api/v1/clusters/ocdp/hosts/node03/host_components/JOURNALNODE

    删除额外的namenode:

    curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://node01:8080/api/v1/clusters/ocdp/host_components?HostRoles/component_name=NAMENODE
    curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://node01:8080/api/v1/clusters/ocdp/hosts/node05/host_components/NAMENODE

    在ambari的页面上将 hdfs的配置版本信息改为HA之前的版本v3


  • 相关阅读:
    module.exports = $; $ is not defined
    npm run build 时 报 __webpack_public_path__ = window.webpackPublicPath; 中的windows未定义
    TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
    windows package.json设置多个环境变量
    点击劫持ClickJacking
    判断数组的方法/判断JS数据类型的四种方法
    时间操作
    Ado调用存储过程
    layui表格增删改查与上传图片+Api
    layui表单与上传图片
  • 原文地址:https://www.cnblogs.com/zwgblog/p/6490988.html
Copyright © 2011-2022 走看看