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

176 строки
5.6 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": "string",
"metadata": {
"Description": "Admin password used when provisioning virtual machines"
}
},
"storageAccountName": {
"type": "string",
"defaultValue": "uniqueStorageAccountName",
"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": "Reference to the VNET Subnet to deploy the nodes in to"
}
},
"vmSize": {
"type": "string",
"defaultValue": "Standard_A0",
"metadata": {
"Description": "Size of the Elasticsearch master nodes"
}
},
"esSettings": {
"type": "object",
"metadata": {
"Description": "Elasticsearch settings - cluster name, version, discovery hosts"
}
},
"osSettings": {
"type": "object",
"metadata": {
"Description": "Elasticsearch deployment platform settings"
}
},
"vmCount": {
"type": "int",
"metadata": {
"Description": "Number of instances to create"
}
},
"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": "clientVm",
"nicName": "clientNic"
},
"resources": [
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Compute/availabilitySets",
"name": "elasticsearchClient",
"location": "[parameters('region')]",
"properties": {}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Network/networkInterfaces",
"name": "[concat(variables('nicName'), copyindex())]",
"location": "[parameters('region')]",
"copy": {
"name": "clientNodesNicLoop",
"count": "[parameters('vmCount')]"
},
"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('clientVm', copyindex())]",
"location": "[parameters('region')]",
"copy": {
"name": "clientVmLoop",
"count": "[parameters('vmCount')]"
},
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'), copyindex())]",
"[concat('Microsoft.Compute/availabilitySets/', 'elasticsearchClient')]"
],
"properties": {
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets', 'elasticsearchClient')]"
},
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"osProfile": {
"computername": "[concat('esClient', copyIndex())]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"storageProfile": {
"imageReference": "[parameters('osSettings').imageReference]",
"osDisk": {
"name": "osdisk",
"vhd": {
"uri": "[concat('http://',variables('storageAccountName'),'.blob.core.windows.net/vhds/', variables('vmName'), copyindex(), '-osdisk.vhd')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('nicName'), copyindex()))]"
}
]
}
}
},
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat('clientVm', copyindex(), '/installelasticsearch')]",
"apiVersion": "2015-05-01-preview",
"location": "[parameters('region')]",
"copy": {
"name": "clientVMExtensionsLoop",
"count": "[parameters('vmCount')]"
},
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', 'clientVm', copyindex())]",
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'), 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)]"
}
}
}
]
}