Using Ambari Blueprint to Provision HDP automatically
2015-10-12 16:23
405 查看
Define the Blueprint
Save the above as a JSON file, say "blueprint.json"
Using curl to post the JSON file to Ambar Server
If the above succeed, it returns status code 201.
Define the host name of nodes
Save above as a JSON file, say "provision.json"
Register the hosts with Ambari Server, and start to provision
If above succeed, it returns
Using the value of href to query the status of provisioning.
The detail configurations can be retrieve by
{ "configurations": [ { "hdfs-site": { "properties_attributes": { "final": { "dfs.namenode.http-address": "true", "dfs.support.append": "true" } }, "properties": { "dfs.namenode.name.dir": "/hadoop/hdfs/namenode", "dfs.datanode.data.dir": "/hadoop/hdfs/data" } } }, { "yarn-site": { "properties_attributes": {}, "properties": { "yarn.nodemanager.local-dirs": "/hadoop/yarn/local", "yarn.nodemanager.log-dirs": "/hadoop/yarn/log" } } }, { "ams-hbase-site" : { "properties_attributes": {}, "properties" : { "hbase.rootdir" : "file:///var/lib/ambari-metrics-collector/hbase" } } } ], "host_groups": [ { "components": [ { "name" : "NODEMANAGER" }, { "name" : "MAPREDUCE2_CLIENT" }, { "name" : "YARN_CLIENT" }, { "name" : "HDFS_CLIENT" }, { "name" : "ZOOKEEPER_SERVER" }, { "name" : "HBASE_REGIONSERVER" }, { "name" : "DATANODE" }, { "name" : "HBASE_CLIENT" }, { "name" : "METRICS_MONITOR" }, { "name" : "ZOOKEEPER_CLIENT" }, { "name" : "PHOENIX_QUERY_SERVER" } ], "configurations": [], "name": "host_group_2", "cardinality": "4" }, { "components": [ { "name" : "SECONDARY_NAMENODE" }, { "name" : "HDFS_CLIENT" }, { "name" : "ZOOKEEPER_SERVER" }, { "name" : "HISTORYSERVER" }, { "name" : "METRICS_MONITOR" }, { "name" : "HBASE_MASTER" }, { "name" : "NAMENODE" }, { "name" : "APP_TIMELINE_SERVER" }, { "name" : "METRICS_COLLECTOR" }, { "name" : "RESOURCEMANAGER" } ], "configurations": [], "name": "host_group_1", "cardinality": "1" } ], "Blueprints": { "stack_name": "HDP", "stack_version": "2.3" } }
Save the above as a JSON file, say "blueprint.json"
Using curl to post the JSON file to Ambar Server
root@master:~# curl -H "X-Requested-By: ambari" -u admin:admin -i -X POST http://${target_ip}:${target_node_port}/api/v1/blueprints/blue?validate_topology=false -d @$BLUEPRINT_PATH/blueprint.json
If the above succeed, it returns status code 201.
Define the host name of nodes
{ "blueprint" : "blue", "configurations" : [ ], "host_groups" :[ { "name" : "host_group_1", "hosts" : [ { "fqdn" : "amb1-svc-dev" } ] }, { "name" : "host_group_2", "hosts" : [ {"fqdn":"amb2-svc-dev"},{"fqdn":"amb3-svc-dev"},{"fqdn":"amb4-svc-dev"} ] } ] }
Save above as a JSON file, say "provision.json"
Register the hosts with Ambari Server, and start to provision
curl -H "X-Requested-By: ambari" -u admin:admin -i -X POST http://${target_ip}:${target_node_port}/api/v1/clusters/cluster -d @$BLUEPRINT_PATH/provision.json
If above succeed, it returns
{ "href" : "http://140.92.25.239:30654/api/v1/clusters/cluster/requests/1", "Requests" : { "id" : 1, "status" : "Accepted" } }
Using the value of href to query the status of provisioning.
The detail configurations can be retrieve by
http://${target_ip}:${target_port}/api/v1/clusters/${cluster_name}?format=blueprint
相关文章推荐
- 详解HDFS Short Circuit Local Reads
- Hadoop_2.1.0 MapReduce序列图
- 使用Hadoop搭建现代电信企业架构
- 单机版搭建Hadoop环境图文教程详解
- hadoop常见错误以及处理方法详解
- hadoop 单机安装配置教程
- hadoop的hdfs文件操作实现上传文件到hdfs
- hadoop实现grep示例分享
- Apache Hadoop版本详解
- linux下搭建hadoop环境步骤分享
- hadoop client与datanode的通信协议分析
- hadoop中一些常用的命令介绍
- Hadoop单机版和全分布式(集群)安装
- 用PHP和Shell写Hadoop的MapReduce程序
- hadoop map-reduce中的文件并发操作
- Hadoop1.2中配置伪分布式的实例
- java结合HADOOP集群文件上传下载
- 用python + hadoop streaming 分布式编程(一) -- 原理介绍,样例程序与本地调试
- Hadoop安装感悟
- hadoop安装lzo