-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredisAzuredeploy.json
273 lines (265 loc) · 9.07 KB
/
redisAzuredeploy.json
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountName": {
"type": "string",
"metadata": {
"description": "Unique namespace for the Storage Account where the Virtual Machine's disks will be placed"
}
},
"adminUsername": {
"type": "string",
"metadata": {
"description": "Administrator user name used when provisioning virtual machines"
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Administrator password used when provisioning virtual machines"
}
},
"location": {
"type": "string",
"allowedValues": [
"East US 2",
"West US",
"East US",
"East Asia",
"Southeast Asia",
"West Europe"
],
"metadata": {
"description": "Location where resources will be provisioned"
}
},
"virtualNetworkName": {
"type": "string",
"defaultValue": "geometricSearchServiceVnet",
"metadata": {
"description": "The arbitrary name of the virtual network provisioned for the Redis cluster"
}
},
"addressPrefix": {
"type": "string",
"defaultValue": "10.0.0.0/16",
"metadata": {
"description": "The network address space for the virtual network"
}
},
"subnetName": {
"type": "string",
"defaultValue": "RedisSubnet",
"metadata": {
"description": "Subnet name for the virtual network that resources will be provisioned in to"
}
},
"subnetPrefix": {
"type": "string",
"defaultValue": "10.0.0.0/24",
"metadata": {
"description": "Address space for the virtual network subnet"
}
},
"nodeAddressPrefix": {
"type": "string",
"defaultValue": "10.0.0.1",
"metadata": {
"description": "The IP address prefix that will be used for constructing a static private IP address for each node in the cluster"
}
},
"redisVersion": {
"type": "string",
"defaultValue": "stable",
"metadata": {
"description": "The version of the Redis package to be deployed on the cluster (or use 'stable' to pull in the latest and greatest)"
}
},
"vmSizeMember": {
"type": "string",
"defaultValue": "Standard_A4",
"allowedValues": [
"Standard_A0",
"Standard_A1",
"Standard_A2",
"Standard_A3",
"Standard_A4",
"Standard_A5"
],
"metadata": {
"description": "The size of the virtual machines that will host redis"
}
},
"redisAvailabilitySet": {
"type": "string",
"defaultValue": "asRedisCache",
"metadata": {
"description": "The name of the redis cache machine availability set"
}
},
"NumberOfSlaves": {
"type": "int",
"defaultValue": 0,
"metadata": {
"description": "The number of slave redis instances"
}
},
"NumberOfMasters": {
"type": "int",
"defaultValue": 1,
"metadata": {
"description": "The number of master redis instances"
}
},
"TotalNumberOfNodes": {
"type": "int",
"defaultValue": 1,
"metadata": {
"description": "The total number of redis instances"
}
},
"RedisInstancesNumber":{
"type": "int",
"defaultValue": 4,
"metadata": {
"description": "The number of instances to deploy on each Redis Node"
}
}
},
"variables": {
"_comment1": "/* ReDefine the origin of the script Url */",
"scriptUrl": "C:/Users/omsaaf.3DSEMANTIX/Source/Repos/azure-quickstart-templates/redis-high-availability/Redis-3DSemantix/",
"templateBaseUrl": "[variables('scriptUrl')]",
"vmTemplate": "[concat(variables('templateBaseUrl'), 'redisAzurenode-resources.json')]",
"osFamilyUbuntu": {
"imagePublisher": "Canonical",
"imageOffer": "UbuntuServer",
"imageSKU": "14.04.2-LTS"
},
"vmStorageAccountContainerName": "vhd-redis",
"vmStorageAccountDomain": ".blob.core.windows.net",
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]",
"jumpboxTemplateDisabled": "redisAzureEmpty-resources.json",
"sharedTemplateUrl": "[concat(variables('templateBaseUrl'), 'redisAzureShared-resources.json')]",
"_comment2": "/* Define the fiels of the objet commonSettings which was declared in the file redisAzureEmpty-resources.json Settings common to all redis virtual machines */",
"commonSettings": {
"availabilitySetName": "[parameters('redisAvailabilitySet')]",
"location": "[parameters('location')]"
},
"_comment3": "/* Storage account settings*/",
"storageSettings": {
"vhdStorageAccountName": "[parameters('storageAccountName')]",
"vhdContainerName": "[variables('vmStorageAccountContainerName')]",
"destinationVhdsContainer": "[concat('https://', parameters('storageAccountName'), variables('vmStorageAccountDomain'), '/', variables('vmStorageAccountContainerName'), '/')]"
},
"networkSettings": {
"virtualNetworkName": "[parameters('virtualNetworkName')]",
"addressPrefix": "[parameters('addressPrefix')]",
"subnetName": "[parameters('subnetName')]",
"subnetPrefix": "[parameters('subnetPrefix')]",
"subnetRef": "[concat(variables('vnetID'), '/subnets/', parameters('subnetName'))]",
"machineIpPrefix": "[parameters('nodeAddressPrefix')]"
},
"machineSettings": {
"adminUsername": "[parameters('adminUsername')]",
"machineNamePrefix": "redisnode-",
"osImageReference": {
"publisher": "[variables('osFamilyUbuntu').imagePublisher]",
"offer": "[variables('osFamilyUbuntu').imageOffer]",
"sku": "[variables('osFamilyUbuntu').imageSKU]",
"version": "latest"
}
},
"installCommand": "[concat('redis-cluster-install.sh ', ' -v ', parameters('redisVersion'), ' -c ', parameters('TotalNumberOfNodes'), ' -m ', parameters('NumberOfMasters'), ' -s ', parameters('NumberOfSlaves'), ' -p ', variables('networkSettings').machineIpPrefix, ' -n ', parameters('RedisInstancesNumber'))]",
"vmScripts": {
"scriptsToDownload": [
"[concat(variables('scriptUrl'), 'redis-install.sh')]",
"[concat(variables('scriptUrl'), 'redis-setup.sh')]",
"[concat(variables('scriptUrl'), 'redis-sentinel-startup.sh')]"
],
"installCommand": "[concat('bash ', variables('installCommand'))]",
"setupCommand": "[concat('bash ', variables('installCommand'), ' -l')]"
},
"TotalNumberOfNodes":"[parameters('TotalNumberOfNodes')]"
},
"resources": [
{
"name": "shared-resources",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2015-01-01",
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[variables('sharedTemplateUrl')]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"commonSettings": {
"value": "[variables('commonSettings')]"
},
"storageSettings": {
"value": "[variables('storageSettings')]"
},
"networkSettings": {
"value": "[variables('networkSettings')]"
}
}
}
},
{
"type": "Microsoft.Resources/deployments",
"name": "[concat('node-resources', copyindex())]",
"apiVersion": "2015-01-01",
"dependsOn": [
"[concat('Microsoft.Resources/deployments/', 'shared-resources')]"
],
"copy": {
"name": "memberNodesLoop",
"count": "[variables('TotalNumberOfNodes')]"
},
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[variables('vmTemplate')]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"commonSettings": {
"value": "[variables('commonSettings')]"
},
"storageSettings": {
"value": "[variables('storageSettings')]"
},
"networkSettings": {
"value": "[variables('networkSettings')]"
},
"machineSettings": {
"value": {
"adminUsername": "[variables('machineSettings').adminUsername]",
"machineNamePrefix": "[variables('machineSettings').machineNamePrefix]",
"osImageReference": "[variables('machineSettings').osImageReference]",
"vmSize": "[variables('vmSizeMember')]",
"machineIndex": "[copyindex()]",
"vmScripts": "[variables('vmScripts').scriptsToDownload]",
"commandToExecute": "[concat(variables('vmScripts').installCommand, ' -i ', copyindex())]"
}
},
"adminPassword": {
"value": "[parameters('adminPassword')]"
}
}
}
}
],
"outputs": {
"installCommand": {
"value": "[variables('vmScripts').installCommand]",
"type": "string"
},
"setupCommand": {
"value": "[variables('vmScripts').setupCommand]",
"type": "string"
}
}
}