Going for scale

While it is nice to be able to create local prototypes, the limitations ensure that we need to deploy the service elsewhere for production. In this case, this means deploying the KES to Microsoft Azure.

We will now look at the steps required to deploy the KES to Microsoft Azure.

Hooking into Microsoft Azure

The first step is to download the Azure publish settings file. This needs to be saved as AzurePublishSettings.xml and stored in the directory in which kes.exe runs.

Note

You can find the Azure publish settings file at https://manage.windowsazure.com/publishsettings/.

There are two ways to build and host the KES without restrictions. The first way is to boot up a Windows virtual machine in Azure. On this VM, you should follow the same steps that we took locally. This allows for rapid prototyping, but without any restrictions.

The second way is to run kes.exe locally, but adding --remote as a parameter. This will create a temporary Azure VM, build the index, and upload the index to a specified target blob storage. An example command could look as follows:

kes.exe build_index
http://<account>.blob.core.windows.net/<container>/Academic.schema http://<account>.blob.core.windows.net/<container>/Academic.full.data http://<account>.blob.core.windows.net/<container>/Academic.full.index
--remote Large

This process can take up to 10 minutes, so ideally, prototyping should be done locally, or through an Azure VM.

Deploying the service

With the grammar and index in place and prototyping done, we can deploy the service to a Microsoft Azure cloud service.

Note

To learn how to create a Microsoft Azure cloud service, head over to https://azure.microsoft.com/en-us/documentation/articles/cloud-services-how-to-create-deploy/.

To deploy the service to a staging slot, run the following command:

kes.exe deploy_service
http://<account>.blob.core.windows.net/<container>/Academic.grammar
http://<account>.blob.core.windows.net/<container>/Academic.index
<serviceName> large --slot Staging

This will allow us to perform basic tests before deploying the service to a production slot. When the testing is done, we can deploy it to production by running the same command again, specifying Production as the last parameter.

When the service is deployed, we can test it by visiting http://<serviceName>.cloudapp.net in a browser.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.244.250