-
Notifications
You must be signed in to change notification settings - Fork 6
/
blueprint-1-node.sh
78 lines (74 loc) · 1.59 KB
/
blueprint-1-node.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
AMBARI_URL=localhost:49154
########################
# create the BLUEPRINT
########################
curl -H "X-Requested-By: ambari" -u admin:admin http://$AMBARI_URL/api/v1/blueprints/single-node-hdfs-yarn -d @- <<EOF
{
"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" : "MAPREDUCE2_CLIENT"
},
{
"name" : "ZOOKEEPER_SERVER"
},
{
"name" : "ZOOKEEPER_CLIENT"
}
],
"cardinality" : "1"
}
],
"Blueprints" : {
"blueprint_name" : "single-node-hdfs-yarn",
"stack_name" : "HDP",
"stack_version" : "2.0"
}
}
EOF
########################
# create the cluster
########################
curl -H "X-Requested-By: ambari" -u admin:admin http://$AMBARI_URL/api/v1/clusters/MySingleNodeCluster -d @- <<EOF
{
"blueprint" : "single-node-hdfs-yarn",
"host-groups" :[
{
"name" : "host_group_1",
"hosts" : [
{
"fqdn" : "ambari.vmati.com"
}
]
}
]
}
EOF
## check status
curl -s -u admin:admin -H "X-Requested-By: ambari" "http://$AMBARI_URL/api/v1/clusters/MySingleNodeCluster/requests/1?fields=tasks/Tasks/*"|jq ".tasks[].Tasks| [.id, .status, .command_detail] " -c