Alibaba Cloud ACK

This guide describes how to install and configure Alluxio on Alibaba Cloud Container Service for Kubernetes (ACK).

Prerequisites

  • ACK version >= 1.12.6

Install Alluxio in ACK

This section introduces how to install Alluxio on Alibaba Cloud Container Service for Kubernetes (ACK) in a few steps.

Specify Which Nodes to Install Alluxio

Before installing Alluxio components, you need to label the target Kubernetes nodes with "alluxio=true", the steps are as follows:

Select cluster

Login to Container Service - Kubernetes Console. Under the Kubernetes menu, click "Clusters" > "Nodes" in the left navigation bar to enter the node list page. Select the specific cluster and click the "Manage Labels" in the upper right corner of the page.

Select nodes

In the node list, select nodes in batches, and then click "Add Label".

Add label

Fill in the label name as "alluxio" and the value as "true", click "OK".

Install Alluxio Using App Catalog

Login to Container Service - Kubernetes Console. Select "Marketplace" > "App Catalog" on the left navigation bar, and select Alluxio on the right. On the "App Catalog" > "Alluxio" page, select the cluster and namespace created in the prerequisites in the creation panel on the right, and click "Create".

Verify Installation

Use kubectl to check whether the Alluxio pods are running:

Use kubectl to log in to the Alluxio master pod and check the health of this Alluxio cluster:

Example: Running Spark Jobs

Install spark-operator

Go to Container Service Application Catalog, search for "ack-spark-operator" in the search box in the upper right: image-4.png

Choose to install "ack-spark-operator" on the target cluster (the cluster in this document is "ack-create-by-openapi-1"), and then click "create", as shown in the figure: image-5.png

Build Spark docker image

Download the required Spark version from Spark download page. The Spark version used in this example is 2.4.6. Run the following command to download Spark:

After the download is complete, unzip the package and set env "SPARK_HOME":

The spark docker image is the image we used when submitting the Spark task. This image needs to include the Alluxio client jar package. You can obtain the Alluxio client jar package as follows:

After the Alluxio client jar package is ready, start building the image:

You can find more details about running Alluxio with Spark on Kubernetes here.

After the image is built, there are two ways to distribute the image:

  • If there is a private image warehouse, push the image to the private image warehouse, and ensure that the K8s cluster node can pull the image.

  • If there is no private image warehouse, you need to use the docker save command to export the image, then scp the image to each node of the K8s cluster, use the docker load command on each node to load the image.

Upload files to Alluxio

As mentioned at the beginning: In this experiment we will submit a Spark job to K8s. The Spark job will perform a word count calculation on a certain file. Before we kick off the Spark job, we need to upload the file to the Alluxio storage. Here, for convenience, we directly upload the file /opt/alluxio-2.9.5/LICENSE from the Alluxio master node (the file path may be slightly different due to the Alluxio version) to the Alluxio namespace.

Use kubectl exec to enter the Alluxio master pod, and upload the LICENSE file from the current directory to the root directory in Alluxio:

Then check which workers store the blocks of file LICENSE.

As shown, this LICENSE file has only one block whose id is 16777216, placed on the K8s node 192.168.8.17.

We use kubectl to identify that the node name is cn-beijing.192.168.8.17:

Submit Spark job

The following steps will submit a Spark job to the K8s cluster. The job is mainly to count the number of occurrences of each word in the /LICENSE file in Alluxio.

In the previous step, we see that the blocks contained in the LICENSE file are all on the node cn-beijing.192.168.8.17. In this experiment, we specify the node selector to let the Spark driver and Spark executor run on the node cn-beijing. 192.168.8.17. Then we verify that the communication between the Spark executor and the Alluxio worker is completed through the domain socket when Alluxio's short-circuit function is turned on.

  • Description: If Alluxio short-circuit is enabled, and the block of the spark executor and the file it wants to access (/LICENSE in this experiment) are on the same k8s node, then the communication between the Alluxio client and the Alluxio worker on the K8s node is done through domain socket.

First generate a YAML file for submitting the Spark job. Note that you should update the variables in the below example YAML file in your test.

Then, use sparkctl to submit the Spark job:

  • Description: if sparkctl is not installed, please refer to sparkctl to install it.

Check Results

After submitting the task, use kubectl to check the Spark driver status:

When the status is Completed, it means the job has finished. Now read the spark driver log to find the result:

Finally, we login to the Alluxio master and check the statistics on the relevant indicators:

From the metrics above, BytesReadRemote and BytesReadRemoteThroughput represent data transmission via the network stack; BytesReadDomain and BytesReadDomainThroughput represent data transmission via domain socket. You can observe that all data is transferred via the domain socket.

Last updated