Created on 07-26-2016 04:09 AM
Ambari Blueprints are definition of your HDP cluster in “JSON” format, it contents information about all the hosts in your cluster, their components, mapping of stack components with each hosts or hostgroups and other cool stuff. Using Blueprints we can call Ambari APIs to completely automate HDP installation process. Interesting stuff, isn’t it ?
Lets get started with single node cluster installation. Below are the steps to setup single-node HDP cluster with Ambari Blueprints.
.
.
http://docs.hortonworks.com/HDPDocuments/Ambari-2.1.2.1/bk_Installing_HDP_AMB/content/_download_the_...
.
Install ambari-agent package on all the nodes in the cluster and modify hostname to ambari server host(fqdn) in /etc/ambari-agent/conf/ambari-agent.ini
.
Please follow below steps to create Blueprints
{ "blueprint" : "single-node-hdp-cluster", "default_password" : "admin", "host_groups" :[ { "name" : "host_group_1", "hosts" : [ { "fqdn" : "<fqdn-of-single-node-cluster-machine>" } ] } ] }
.
{ "configurations" : [ ], "host_groups" : [ { "name" : "host_group_1", "components" : [ { "name" : "NAMENODE" }, { "name" : "SECONDARY_NAMENODE" }, { "name" : "DATANODE" }, { "name" : "HDFS_CLIENT" }, { "name" : "RESOURCEMANAGER" }, { "name" : "NODEMANAGER" }, { "name" : "YARN_CLIENT" }, { "name" : "HISTORYSERVER" }, { "name" : "APP_TIMELINE_SERVER" }, { "name" : "MAPREDUCE2_CLIENT" }, { "name" : "ZOOKEEPER_SERVER" }, { "name" : "ZOOKEEPER_CLIENT" } ], "cardinality" : "1" } ], "Blueprints" : { "blueprint_name" : "single-node-hdp-cluster", "stack_name" : "HDP", "stack_version" : "2.3" } }
.
curl -H "X-Requested-By: ambari" -X POST -u admin:admin http://<ambari-hostname>:8080/api/v1/blueprints/<blueprint-name>; -d @cluster_configuration.json
.
curl -H "X-Requested-By: ambari" -X POST -u admin:admin http://<ambari-host>:8080/api/v1/clusters/<new-cluster-name>; -d @hostmapping.json
.
curl -H "X-Requested-By: ambari" -X GET -u admin:admin http://<ambari-hostname>:8080/api/v1/clusters/mycluster/requests/
curl -H "X-Requested-By: ambari" -X GET -u admin:admin http://<ambari-hostname>:8080/api/v1/clusters/mycluster/requests/<request-number>;
.
.
Created on 10-10-2016 01:17 PM
In Step 2, do remember to restart ambari-agent.
$ sudo ambari-agent restart
Regards,
Wendell
Created on 07-19-2017 04:51 PM
Hi Kuldeep.
I actually did a restore from the backup and was able to preserve the cluster this way. I will keep the information you sent me in case I have a similar problem moving forward.
Thanks,
Created on 12-13-2017 12:32 PM
Can you please elaborate step 4?
How do you created blueprint?
Where need to put this file "api/v1/blueprints" from this url "http://<ambari-hostname>:8080/api/v1/blueprints/<blueprint-name" ?
Created on 12-14-2017 02:28 PM
I followed the steps given above but getting below error. 8080 port is not listening as ambari-server service is not running. I tried to start the service but it fails. Please suggest
curl -H "X-Requested-By: ambari" -X POST -u admin:admin http://192.168.10.10:8080/api/v1/blueprints/single-node-hdp-cluster -d @cluster_configuration.json curl: (7) Failed connect to 192.168.10.10:8080; Connection refused
Created on 12-19-2017 01:55 AM
Hi Kuldeep
I'm having issues in setting up multi node ambari cluster using rest api. I will provide the screenshot very soon.But on the higher note the issue is that ambari UI doesn't register the new cluster and looks like its referencing the old clusters blueprint name
Let me know your thoughts
Thanks
Venkat
Created on 04-03-2018 12:03 PM
Hello Kuldeep Kulkarni,
I have made all the step which you mentioned in Article, but HDP installation will take a long time after one-hour installation is still in processes.
Thanks
Ansari Faheem Ahmed
Created on 08-01-2018 03:53 AM
Hi Kuldeep
I have ambari 2.6 local repositroy map as below but during installation, public repository being invoked by components and not using local repository which I have registered using Rest API. Please help me I am new to the ambari-blueprint
curl -i -H "X-Requested-By: ambari" -u admin:admin -X PUT \
-d'{ "Repositories" : {"repo_name":"HDP-2.5.0.0","base_url":"http://192.168.56.104/HDP/centos6", "verify_base_url":true }}' \ http://master.zdp.com:8080/api/v1/stacks/HDP/versions/2.5/operating_systems/redhat6/repositories/HDP...
curl -i -H "X-Requested-By: ambari" -u admin:admin -X PUT \
-d'{ "Repositories" : {"repo_name":"HDP-UTILS-1.1.0.21","base_url":"http://192.168.56.104/hdpu", "verify_base_url":true }}' \ http://master.zdp.com:8080/api/v1/stacks/HDP/versions/2.5/operating_systems/redhat6/repositories/HDP...
[root@master aut]# more hostmapping.json
{
"blueprint" : "single-node-hdp-cluster",
"repository_version_id": 1,
"default_password" : "admin",
"host_groups" :[
{
"name" : "host_group_1",
"hosts" : [
{
"fqdn" : "master.zdp.com"
}
]
}
]
}
[root@master aut]# cat /etc/yum.repos.d/ambari-hdp-1.repo
[HDP-2.5-repo-1]
name=HDP-2.5-repo-1
baseurl=http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos6/2.x/BUILDS/2.5.0.0-1245
path=/
enabled=1
gpgcheck=0
[HDP-UTILS-1.1.0.21-repo-1]
name=HDP-UTILS-1.1.0.21-repo-1
baseurl=http://s3.amazonaws.com/dev.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos6
path=/
enabled=1
Created on 08-01-2018 03:57 AM
Hi @Kalyan Das ,
I think its better to create a new community thread for the issue you are facing .
it will be easily viewable by other community users for which they are willing to help .
Comments here wont allow posting screenshots and other things.