зеркало из
1
0
Форкнуть 0
azure-quickstart-templates/elasticsearch/data-nodes-2disk-resources....

217 строки
7.3 KiB
JSON

{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUsername": {
"type": "string",
"metadata": {
"Description": "Admin username used when provisioning virtual machines"
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"Description": "Admin password used when provisioning virtual machines"
}
},
"storageAccountName": {
"type": "string",
"metadata": {
"Description": "Unique namespace for the Storage Account where the Virtual Machine's disks will be placed"
}
},
"region": {
"type": "string",
"metadata": {
"Description": "Location where resources will be provisioned"
}
},
"subnet": {
"type": "object",
"metadata": {
"Description": "The name of the subnet to deploy resources into"
}
},
"vmSize": {
"type": "string",
"defaultValue": "Standard_A1",
"metadata": {
"Description": "Size of the Elasticsearch data nodes"
}
},
"dataNodes": {
"type": "int",
"defaultValue": 2,
"metadata": {
"Description": "Number of Elasticsearch data nodes (2 is the minimum)"
}
},
"osSettings": {
"type": "object",
"metadata": {
"Description": "OS settings to deploy on"
}
},
"esSettings": {
"type": "object",
"metadata": {
"Description": "The name of the elasticsearch cluster"
}
},
"dataDiskSize": {
"type": "int",
"defaultValue": 100,
"metadata": {
"Description": "Size of each data disk attached to data nodes in (Gb)"
}
},
"groupName": {
"type": "string",
"metadata": {
"Description": "The group name for this collection of nodes"
}
},
"availabilitySet": {
"type": "string",
"metadata": {
"Description": "The availabilty set to use for the data nodes"
}
},
"lbBackendPools": {
"type": "object",
"metadata": {
"Description": "loadBalancerBackendAddressPools config object"
}
}
},
"variables": {
"vmStorageAccountContainerName": "vhd",
"subnetRef": "[concat(resourceId('Microsoft.Network/virtualNetworks', parameters('subnet').vnet), '/subnets/', parameters('subnet').name)]",
"storageAccountName": "[parameters('storageAccountName')]",
"vmName": "[concat(parameters('groupName'), 'vm')]"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"name": "[concat(parameters('groupName'),parameters('storageAccountName'))]",
"apiVersion": "2015-05-01-preview",
"location": "[parameters('region')]",
"properties": {
"accountType": "Standard_LRS"
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Network/networkInterfaces",
"name": "[concat(parameters('groupName'), 'nic', copyindex())]",
"location": "[parameters('region')]",
"copy": {
"name": "[concat(parameters('groupName'),'nicLoop')]",
"count": "[parameters('dataNodes')]"
},
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[variables('subnetRef')]"
},
"loadBalancerBackendAddressPools": "[parameters('lbBackendPools').backendPools]"
}
}
]
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Compute/virtualMachines",
"name": "[concat(parameters('groupName'), 'vm', copyindex())]",
"location": "[parameters('region')]",
"copy": {
"name": "[concat(parameters('groupName'), 'virtualMachineLoop')]",
"count": "[parameters('dataNodes')]"
},
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('groupName'), 'nic', copyindex())]",
"[concat('Microsoft.Storage/storageAccounts/', concat(parameters('groupName'),parameters('storageAccountName')))]"
],
"properties": {
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets', parameters('availabilitySet'))]"
},
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"osProfile": {
"computername": "[concat(parameters('groupName'), 'vm', copyIndex())]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"storageProfile": {
"imageReference": "[parameters('osSettings').imageReference]",
"osDisk": {
"name": "osdisk",
"vhd": {
"uri": "[concat('http://', parameters('groupName'), variables('storageAccountName'),'.blob.core.windows.net/vhds/', variables('vmName'), copyindex(), '-osdisk.vhd')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
},
"dataDisks": [
{
"name": "datadisk1",
"diskSizeGB": "[parameters('dataDiskSize')]",
"lun": 0,
"vhd": {
"Uri": "[concat('http://', parameters('groupName'), parameters('storageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/', parameters('groupName'),'vm', copyindex(),'dataDisk1' ,'.vhd')]"
},
"caching": "None",
"createOption": "Empty"
},
{
"name": "datadisk2",
"diskSizeGB": "[parameters('dataDiskSize')]",
"lun": 1,
"vhd": {
"Uri": "[concat('http://', parameters('groupName'),parameters('storageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',parameters('groupName'),'vm', copyindex() ,'dataDisk2','.vhd')]"
},
"caching": "None",
"createOption": "Empty"
}
]
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(parameters('groupName'),'nic', copyindex()))]"
}
]
}
}
},
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(parameters('groupName'),'vm', copyindex(), '/installelasticsearch')]",
"apiVersion": "2015-05-01-preview",
"location": "[parameters('region')]",
"copy": {
"name": "[concat(parameters('groupName'), 'virtualMachineExtensionsLoop')]",
"count": "[parameters('dataNodes')]"
},
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', parameters('groupName'), 'vm', copyindex())]"
],
"properties": {
"publisher": "Microsoft.OSTCExtensions",
"type": "CustomScriptForLinux",
"typeHandlerVersion": "1.2",
"settings": {
"fileUris": "[parameters('osSettings').scripts]",
"commandToExecute": "[concat('bash elasticsearch-ubuntu-install.sh -yn ', parameters('esSettings').clusterName, ' -v ', parameters('esSettings').version, ' -d ', parameters('esSettings').discoveryHosts)]"
}
}
}
]
}