Configuring an Autoscaling Denodo Lakehouse Accelerator Cluster in AKS
You can translate the document:Overview
The Denodo Lakehouse Accelerator (formerly known as Denodo Embedded MPP) is a customized version of Presto optimized to behave as Denodo’s Massive Parallel Processing (MPP) engine. Denodo can leverage the processing capabilities of the engine by sending queries to it in situations where doing so can accelerate performance. Therefore it’s important to have a Denodo Lakehouse Accelerator that is appropriately sized to effectively support times of peak load for your Denodo environment.
The Denodo Lakehouse Accelerator includes configuration options that allow it to be deployed in autoscaling mode. This can be useful as it can allow the Denodo Lakehouse Accelerator to handle peak load while also automatically downsizing and saving costs during off-peak hours.
The following article discusses the steps to deploy the Denodo Lakehouse Accelerator in autoscaling mode in Azure’s AKS. This covers both the steps for the Denodo Lakehouse Accelerator to automatically upsize and downsize the number of worker pods based on load, as well as the steps for AKS to automatically adjust the number of instances in response to the number of worker pods. In this way you can ensure the cluster can support high load while minimizing cost.
Prior to following the steps in this article, we would recommend reviewing the Sizing Recommendations for the Denodo Lakehouse Accelerator section of the Virtual DataPort Administration Guide to determine the ideal minimum and maximum sizes for your autoscaling cluster.
Prerequisites
- All software below should be updated to their latest versions.
- A version of Denodo containing the Denodo Lakehouse Accelerator.
- Permissions to create and modify a cluster in AKS.
- Azure CLI.
If running on Windows:
- Cygwin or Git bash to run the cluster.sh script.
- Install the Window Subsystem for Linux with the command "wsl --upgrade" in PowerShell.
- Rancher with dockerd (moby) as the container engine. Rancher as a desktop distribution of Docker for Windows. It already includes Kubectl so no need to install separately
- Check if the environment variable HADOOP_HOME is defined on the computer. To see the list of environment variables, open a command line and execute SET. If HADOOP_HOME is already defined, copy the content of the directory <DENODO_HOME>\dll\vdp\winutils to %HADOOP_HOME%\bin.
If HADOOP_HOME is undefined:
- Create a directory. For example, <DENODO_HOME>\hadoop_win_utils.
- Create a directory called bin within the new directory. For example, <DENODO_HOME>\hadoop_win_utils\bin.
- Define the environment variable HADOOP_HOME to point to <DENODO_HOME>\hadoop_win_utils.
- Copy the content of the directory <DENODO_HOME>\dll\vdp\winutils to %HADOOP_HOME%\bin.
Steps
Create an Autoscaling AKS Service
- Create a resource > choose Azure Kubernetes Service (AKS) > Create
- Fill out the details of the cluster you would like and create. Under the “Node pools” section choose “Add node pool”.
- Configure the details of the node pool you would like to create. Ensure the “Scale method” is set to “Autoscale” and set the minimum and maximum node count to n+1 the number of Presto workers you would like to scale between. For example, in the below screenshot the node pool is being configured for a Presto instance that will scale between 2 and 32 workers.
Prepare the cluster connection
- From Cygwin, login to Azure:
|
az login |
- Configure kubectl to connect to your Kubernetes cluster:
|
az aks get-credentials --resource-group <your_resource_group> --name <your_kubernetes_service_name> |
- Apply the Kubernetes Metrics Server to your cluster. This will allow the Denodo Lakehouse Accelerator engine to measure the CPU usage and determine when to scale up:
|
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml |
Enable the autoscaler in the Denodo Lakehouse Accelerator configuration
- Edit your <denodo_lakehouse_accelerator_home>/prestocluster/values.yaml file and make the following adjustments to enable the Kubernetes autoscaler:
Presto.autoscaling.enabled: true
Make sure that Presto.autoscaling.maxReplicas is within n-1 the range that you have configured in the AKS autoscaler, otherwise you can deploy multiple worker pods in the same machine, which will potentially lead to crashes during execution. By default, targetCPUUtilizationPercentage is set at 80% meaning a new node pod will be created when CPU utilization reaches 80%. This percentage typically works well but could be tuned to be more or less aggressive.
- Configure presto.worker.resources section as shown below. Consider the value you want to set for your presto.worker.resources.requests.cpu. This represents the amount of CPU reserved for the pod. Deploying in AKS, We recommend setting the value to be 80% of the total number of CPUs of an instance as a starting point. This helps ensure enough room is leftover on the instance for other tasks it may need to perform. So for 32 core instances you can set the value to 25.6 or 25600m, each of which represents 25.6 cores:
This can then be fine tuned as needed. The autoscaler will use this value along with the targetCPUUtilizationPercentage in the image above to determine if a new worker is needed.
- You can now start your cluster as normal with:
./cluster.sh deploy
Validate your deployment
After deploying your cluster, you can check to ensure your Horizontal Pod Autoscaler (HPA) is correctly tracking the CPU usage of your cluster with:
kubectl get hpa
Above we can see the HPA is configured for a minimum of 2 pods and a maximum of 32 and will scale up once the average CPU usage reaches And is currently tracking an average CPU usage of 3%. It may take a few minutes after your cluster is deployed before the HPA begins tracking.
As load is applied and CPU usage on the cluster reaches the threshold, the HPA will automatically add more nodes. These will then appear as pending while the await sufficient hardware:
The Cluster Autoscaler will then add additional instances to the cluster allowing the pods to deploy:
Now as Denodo routes queries to your Denodo Lakehouse Accelerator engine, your cluster will be able to upsize and downsize automatically in order to adjust to the level of demand.
References
Denodo Lakehouse Accelerator — Virtual DataPort Administration Guide
Denodo Lakehouse Accelerator Guide
Sizing recommendations for the Denodo Lakehouse Accelerator — Virtual DataPort Administration Guide
Automatically scale a cluster to meet application demands on Azure Kubernetes Service (AKS)
Access and identity options for Azure Kubernetes Service (AKS)
Horizontal Pod Autoscaling | Kubernetes
The information provided in the Denodo Knowledge Base is intended to assist our users in advanced uses of Denodo. Please note that the results from the application of processes and configurations detailed in these documents may vary depending on your specific environment. Use them at your own discretion.
For an official guide of supported features, please refer to the User Manuals. For questions on critical systems or complex environments we recommend you to contact your Denodo Customer Success Manager.
