зеркало из
1
0
Форкнуть 0
azure-quickstart-templates/hortonworks-on-centos/data-node.json

134 строки
5.2 KiB
JSON

{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dnsNamePrefix": {
"type": "string"
},
"region": {
"type": "string"
},
"scriptsUri": {
"type": "string"
},
"nodeTemplateUri": {
"type": "string"
},
"storageAccount" : {
"type": "object"
},
"vmSize": {
"type": "string"
},
"vmCount": {
"type": "int"
},
"vmSpec": {
"type": "object"
},
"networkSpec": {
"type": "object"
},
"clusterSpec": {
"type": "object"
},
"nodeTemplateUri": {
"type": "string"
}
},
"variables": {
"vmName": "[concat(parameters('dnsNamePrefix'), '-wn-')]",
"storageAccountName": "[concat(parameters('storageAccount').prefix, 'wn')]"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"name": "[concat(variables('storageAccountName'), copyIndex(1))]",
"apiVersion": "2015-05-01-preview",
"location": "[parameters('region')]",
"copy": {
"name": "storageAccountLoop",
"count": "[parameters('vmCount')]"
},
"properties": {
"accountType": "[parameters('storageAccount').type]"
}
},
{
"name": "[concat(variables('vmName'), copyIndex(1))]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2015-01-01",
"copy": {
"name": "nameNodeNicLoop",
"count": "[parameters('vmCount')]"
},
"dependsOn": [
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'), copyIndex(1))]"
],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[parameters('nodeTemplateUri')]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"vmName": {
"value": "[concat(variables('vmName'), copyIndex(1))]"
},
"region": {
"value": "[parameters('region')]"
},
"availabilitySet": {
"value": "[parameters('vmSpec').workerNodeASName]"
},
"storageAccountName" : {
"value": "[concat(variables('storageAccountName'), copyIndex(1))]"
},
"subnetResourceId": {
"value": "[concat(resourceId('Microsoft.Network/virtualNetworks',parameters('networkSpec').virtualNetworkName), '/subnets/', parameters('networkSpec').virtualNetworkSubnetName)]"
},
"dnsName": {
"value": "[concat(parameters('dnsNamePrefix'), '-wn-', copyIndex(1))]"
},
"ipAddress": {
"value": "[concat(parameters('networkSpec').privateIPPrefix, copyIndex(parameters('networkSpec').dataNodeAddressStart))]"
},
"vmSize": {
"value": "[parameters('vmSize')]"
},
"vmSpec": {
"value": "[parameters('vmSpec')]"
}
}
}
},
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(variables('vmName'), copyIndex(1), '/prepareDisks')]",
"apiVersion": "2015-05-01-preview",
"location": "[parameters('region')]",
"copy": {
"name": "nameNodeNicLoop",
"count": "[parameters('vmCount')]"
},
"dependsOn": [
"[concat('Microsoft.Resources/deployments/', variables('vmName'), copyIndex(1))]"
],
"properties": {
"publisher": "Microsoft.OSTCExtensions",
"type": "CustomScriptForLinux",
"typeHandlerVersion": "1.2",
"settings": {
"fileUris": [
"[concat(parameters('scriptsUri'), '/scripts/initialize-node.sh')]",
"[concat(parameters('scriptsUri'), '/scripts/mountDisk.sh')]",
"[concat(parameters('scriptsUri'), '/scripts/vm-bootstrap.py')]"
],
"commandToExecute": "[concat('sh initialize-node.sh \"', parameters('networkSpec').privateIPPrefix, '\" \"', parameters('dnsNamePrefix'), '\" \"', reference(concat(variables('vmName'), copyIndex(1))).outputs.fqdn.value ,'\" ', parameters('clusterSpec').nameNodeCount, ' ', parameters('clusterSpec').dataNodeCount)]"
}
}
}
]
}