277 строки
10 KiB
JSON
277 строки
10 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"
|
|
},
|
|
{
|
|
"name": "datadisk3",
|
|
"diskSizeGB": "[parameters('dataDiskSize')]",
|
|
"lun": 2,
|
|
"vhd": {
|
|
"Uri": "[concat('http://', parameters('groupName'),parameters('storageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',parameters('groupName'),'vm', copyindex() ,'dataDisk3','.vhd')]"
|
|
},
|
|
"caching": "None",
|
|
"createOption": "Empty"
|
|
},
|
|
{
|
|
"name": "datadisk4",
|
|
"diskSizeGB": "[parameters('dataDiskSize')]",
|
|
"lun": 3,
|
|
"vhd": {
|
|
"Uri": "[concat('http://', parameters('groupName'),parameters('storageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',parameters('groupName'),'vm', copyindex() ,'dataDisk4','.vhd')]"
|
|
},
|
|
"caching": "None",
|
|
"createOption": "Empty"
|
|
},
|
|
{
|
|
"name": "datadisk5",
|
|
"diskSizeGB": "[parameters('dataDiskSize')]",
|
|
"lun": 4,
|
|
"vhd": {
|
|
"Uri": "[concat('http://', parameters('groupName'), parameters('storageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/', parameters('groupName'),'vm', copyindex(),'dataDisk5' ,'.vhd')]"
|
|
},
|
|
"caching": "None",
|
|
"createOption": "Empty"
|
|
},
|
|
{
|
|
"name": "datadisk6",
|
|
"diskSizeGB": "[parameters('dataDiskSize')]",
|
|
"lun": 5,
|
|
"vhd": {
|
|
"Uri": "[concat('http://', parameters('groupName'),parameters('storageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',parameters('groupName'),'vm', copyindex() ,'dataDisk6','.vhd')]"
|
|
},
|
|
"caching": "None",
|
|
"createOption": "Empty"
|
|
},
|
|
{
|
|
"name": "datadisk7",
|
|
"diskSizeGB": "[parameters('dataDiskSize')]",
|
|
"lun": 6,
|
|
"vhd": {
|
|
"Uri": "[concat('http://', parameters('groupName'),parameters('storageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',parameters('groupName'),'vm', copyindex() ,'dataDisk7','.vhd')]"
|
|
},
|
|
"caching": "None",
|
|
"createOption": "Empty"
|
|
},
|
|
{
|
|
"name": "datadisk8",
|
|
"diskSizeGB": "[parameters('dataDiskSize')]",
|
|
"lun": 7,
|
|
"vhd": {
|
|
"Uri": "[concat('http://', parameters('groupName'),parameters('storageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',parameters('groupName'),'vm', copyindex() ,'dataDisk8','.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)]"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
} |