未加星标

Ambari使用blueprint部署集群

字体大小 | |
[数据库(综合) 所属分类 数据库(综合) | 发布者 店小二03 | 时间 2018 | 作者 红领巾 ] 0人收藏点击收藏
Blueprint方式部署说明

Blueprint方式部署适用于集群的自动化部署,特别是上云的场景。官方资料请参考 Blueprint参考

部署步骤 环境说明

3台 centos7 ,主机名如下(对应的ip映射都在/etc/hosts中配置好):

t3m1.ecloud.com

t3m2.ecloud.com

t3m3.ecloud.com

创建蓝图

Blueprint Post请求发送的请求体全部采用JSON的格式。

Blueprint模板如下:

blueprint.json

{ "configurations": [ {} ], "Blueprints": { "stack_version": "3.0", "stack_name": "HDP", "blueprint_name": "cc1" }, "host_groups" : [ { "name" : "master", "configurations": [ {} ], "components": [{ "name": "SECONDARY_NAMENODE" }, { "name": "NAMENODE" }, { "name": "METRICS_MONITOR" }, { "name": "METRICS_COLLECTOR" "name": "METRICS_GRAFANA" }, { "name": "HBASE_MASTER" }, { "name": "ZOOKEEPER_SERVER" }, { "name": "DATANODE" }, { "name": "HBASE_REGIONSERVER" }, { "name": "PHOENIX_QUERY_SERVER" }, { "name": "HDFS_CLIENT" }, { "name": "HBASE_CLIENT" }, { "name": "ZOOKEEPER_CLIENT" }], "cardinality" : "1" }, { "name" : "slaves", "configurations": [ {} ], "components": [{ "name": "ZOOKEEPER_SERVER" }, { "name": "METRICS_MONITOR" }, { "name": "DATANODE" }, { "name": "HBASE_REGIONSERVER" }, { "name": "HDFS_CLIENT" }, { "name": "HBASE_CLIENT" }, { "name": "ZOOKEEPER_CLIENT" }], "cardinality" : "1+" } ], "settings": [ { "recovery_settings": [ { "recovery_enabled": "true" } ] }, { "service_settings": [ { "recovery_enabled": "true", "name": "AMBARI_METRICS" } ] }, { "component_settings": [ { "recovery_enabled": "true", "name": "METRICS_COLLECTOR" } ] } ] } 发送post请求 curl -i -H "X-Requested-By: ambari" -X POST -u admin:admin http://localhost:8080/api/v1/blueprints/cc1 -d @blueprint.json 设置本地yum源 请求体如下

vdf.json

{ "VersionDefinition": { "version_url": "http://192.168.0.47/ambari/blueprint/HDP-3.0.0.0-1634.xml" } }

以上 version_url 的值必须能够访问到,HDP-3.0.0.0-1634.xml 内容如下

<?xml version="1.0"?> <repository-version xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="version_definition.xsd"> <release> <type>STANDARD</type> <stack-id>HDP-3.0</stack-id> <version>3.0.0.0</version> <build>1634</build> <compatible-with>3\.\d+\.\d+\.\d+</compatible-with> <release-notes>http://example.com</release-notes> <display>HDP-3.0.0.0</display> </release> <manifest> <service id="SPARK2-231" name="SPARK2" version="2.3.1"/> <service id="HBASE-200" name="HBASE" version="2.0.0"/> <service id="PIG-0160" name="PIG" version="0.16.0"/> <service id="DRUID-0121" name="DRUID" version="0.12.1"/> <service id="ATLAS-100" name="ATLAS" version="1.0.0"/> <service id="OOZIE-431" name="OOZIE" version="4.3.1"/> <service id="HIVE-310" name="HIVE" version="3.1.0"/> <service id="ZEPPELIN-080" name="ZEPPELIN" version="0.8.0"/> <service id="RANGER-110" name="RANGER" version="1.1.0"/> <service id="RANGER_KMS-110" name="RANGER_KMS" version="1.1.0"/> <service id="ZOOKEEPER-346" name="ZOOKEEPER" version="3.4.6"/> <service id="ACCUMULO-170" name="ACCUMULO" version="1.7.0"/> <service id="KAFKA-101" name="KAFKA" version="1.0.1"/> <service id="HDFS-310" name="HDFS" version="3.1.0"/> <service id="YARN-310" name="YARN" version="3.1.0"/> <service id="MAPREDUCE2-310" name="MAPREDUCE2" version="3.1.0"/> <service id="TEZ-091" name="TEZ" version="0.9.1"/> <service id="STORM-121" name="STORM" version="1.2.1"/> <service id="SQOOP-147" name="SQOOP" version="1.4.7"/> <service id="KNOX-100" name="KNOX" version="1.0.0"/> </manifest> <available-services/> <repository-info> <os family="redhat7"> <package-version>3_0_0_0_*</package-version> <repo> <baseurl>http://192.168.0.47/ambari/HDP/centos7/3.0.0.0-1634</baseurl> <repoid>HDP-3.0</repoid> <reponame>HDP</reponame> <unique>true</unique> </repo> <repo> <baseurl>http://192.168.0.47/ambari/HDP-GPL/centos7/3.0.0.0-1634</baseurl> <repoid>HDP-3.0-GPL</repoid> <reponame>HDP-GPL</reponame> <unique>true</unique> <tags> <tag>GPL</tag> </tags> </repo> <repo> <baseurl>http://192.168.0.47/ambari/HDP-UTILS/centos7/1.1.0.22</baseurl> <repoid>HDP-UTILS-1.1.0.22</repoid> <reponame>HDP-UTILS</reponame> <unique>false</unique> </repo> </os> </repository-info> </repository-version> 发送Post请求 curl -i -H "X-Requested-By: ambari" -X POST -u admin:admin http://localhost:8080/api/v1/version_definitions -d @vdf.json 创建集群 集群模板如下

clustertemplate.json

{ "blueprint": "cc1", "repository_version_id": 1, "repository_version": "3.0.0.0-1634", "default_password": "admin", "config_recommendation_strategy": "NEVER_APPLY", "provision_action": "INSTALL_AND_START", "configurations": [ ], "host_groups": [ { "name": "master", "hosts": [ { "fqdn": "t3m1.ecloud.com" } ] }, { "name": "slaves", "hosts": [ { "fqdn": "t3m2.ecloud.com" }, { "fqdn": "t3s3.ecloud.com" } ] } ], "Clusters": { "cluster_name": "cc1" } } 发送post请求 curl -i -H "X-Requested-By: ambari" -X POST -u admin:admin http://localhost:8080/api/v1/clusters/cc1 -d @clustertemplate.json 登录Ambari Web管理界面查看安装和启动进度

发送集群模版的请求后就可以在web后台查看组件安装和启动的进度。

JackerWang 于2018年秋(10月28日)上午广州

Previous

高可用组建配置

本文数据库(综合)相关术语:系统安全软件

代码区博客精选文章
分页:12
转载请注明
本文标题:Ambari使用blueprint部署集群
本站链接:https://www.codesec.net/view/611105.html


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(综合) | 评论(0) | 阅读(188)