Get Started with Spark Yun on Alibaba Cloud ECS

This guide walks through deploying Spark Yun on a preemptible Alibaba Cloud ECS instance and exploring users, tenants, clusters, data sources, and jobs. It is intended for trials, demonstrations, and non-production testing.

This example uses CentOS 7.9, four CPU cores, and 8 GB of memory, and runs Spark Yun in Docker. Adapt production deployments to your resource, security, and availability requirements.

1. Create a preemptible ECS instance

Log in to the Alibaba Cloud ECS console:

https://ecs.console.aliyun.com/

20251016173049

Select Preemptible Instance and choose at least four CPU cores and 8 GB of memory.

20250813102303

Select CentOS 7.9 64-bit for the operating system.

20250813102406

Choose network bandwidth appropriate for your trial environment.

20251016173437

Configure the security group to allow the required ports. This example maps host port 80 to container port 8080, so allow access to port 80.

20250813102638

Set the root user password.

20250813102834

Set the preemption duration and create a server instance.

20250813102924

After creating the instance, record its private and public IP addresses.

20251017155830

The sample server information in this article is as follows:

Configuration itemsExample value
operating systemCentOS 7.9
Resource specification4 cores 8 GB
Public IP47.100.8.119
Intranet IP172.19.73.181
Login accountroot
Login passwordZhiqingyun123..

2. Log in to the server

Log in to the ECS server using a local terminal:

ssh root@47.100.8.119

20250813103252

Set the maximum number of open files to 65535 to avoid file descriptor limits affecting job execution.

# Set temporarily for the current session
ulimit -n 65535

3. Install Java environment

Install OpenJDK 17 using the following command:

yum install java-17-openjdk-devel java-17-openjdk -y

20241101180421

4. Install Docker

Configure the Docker repository and install Docker:

yum install -y yum-utils
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
systemctl start docker

20251016175856

5. Deploy Spark Yun service

Create the data directory and start the Spark Yun container through Docker:

mkdir -p /var/lib/zhiqingyun
docker run \
    --restart=always \
    --name zhiqingyun \
    -e ADMIN_PASSWORD=admin123 \
    -v /var/lib/zhiqingyun:/var/lib/zhiqingyun \
    -p 80:8080 \
    -d registry.cn-shanghai.aliyuncs.com/isxcode/zhiqingyun:latest-amd64
docker logs -f zhiqingyun

Parameter description:

parametersDescription
ADMIN_PASSWORDBackend administrator initial password
/var/lib/zhiqingyunSpark Yun data persistence directory
-p 80:8080Map server 80 port to container 8080 port

6. Visit Spark Yun platform

Once the container is running, open the server’s public address in a browser:

  • Access address: http://47.100.8.119
  • Backend administrator account: admin
  • Default password: admin123

If the server bandwidth is 1 Mbps, the first load may take about 40 seconds, please wait patiently for the page resources to load.

20241101181443

7. Create users and tenants

In the administration console, create a user and tenant to explore the platform:

  • Create user: zhiqingyun
  • Create a tenant: Experience Tenant

See the product manual for instructions on managing users and tenants.

8. Upload license (optional)

If you only want to experience basic functions, you can skip the license upload. If you want to experience commercial functions, you can obtain a free trial license at the bottom of the official website.

Trial version license download address:

https://zhiqingyun-saas.isxcode.com/tools/open/file/license.lic

20241101181637

9. Add a computing cluster

Exit the backend management interface and log in to the platform using the zhiqingyun account.

20241101181813

20241101181829

20241101181846

Select StandAlone as the cluster type.

20241101181911

Click the cluster name to enter the cluster details and add server nodes.

20241101181923

An example node configuration is as follows:

Configuration itemsExample value
Host172.19.73.181
Usernameroot
PasswordZhiqingyun123..
Install SparkCheck
Install FlinkCheck

It is recommended to use the server's internal IP when adding nodes to avoid public network fluctuations affecting component deployment and job running.

20241101182039

20241101182056

20241101182118

20241101182151

10. Add data source

Create an H2 data source for subsequent job execution and data synchronization experience.

Configuration itemsExample value
TypeH2
connection addressjdbc:h2:file:/var/lib/zhiqingyun/h2/data_test;AUTO_SERVER=TRUE
Usernameroot
Passwordzhiqingyun123

20250428114946

20250428115037

20250428115102

11. Create a new Spark query job

Create a Spark query job in job management, select the added computing cluster and execute sample SQL to verify the Spark job submission and running capabilities.

20241101183016

20241101183042

20241101183120

20241101183235

20241101183248

12. Create a new JDBC execution job

Create a JDBC execution job, select the H2 data source, and initialize the original and result tables required for the experience.

-- Source table
create table users(
    username varchar(100),
    sex int,
    birth datetime
);

-- Result table
create table users_result(
    username varchar(100),
    sex int,
    birth varchar(100)
);

-- Insert a row into the source table
insert into users values('张三',13,now());

20241101183356

20241101183429

13. Create a new JDBC query job

Create JDBC query jobs, query original table data, and verify data source connections and query capabilities.

select * from users;

20241101183455

20241101183511

14. Create a new data synchronization job

Create a data synchronization job to synchronize original table data to the result table.

20250428124718

After synchronization completes, use a JDBC query job to view the result table.

select * from users_result;

20250312163313

15. Create a new Spark custom job

Create a Spark custom job to verify the platform's ability to submit and run custom Jar jobs. The example in this article uses the Spark official sample program to calculate the Pi value.

For customized job templates, please refer to:

https://github.com/ispong/spark-job-template

Sample Jar download address:

https://zhiqingyun-saas.isxcode.com/tools/open/file/spark-examples_2.12-3.4.1.jar

Upload the Jar to the resource center and select the resource type as job.

20241101184740

20241101184813

The job parameters are configured as follows:

Configuration itemsExample value
Application namepi-demo
Main Classorg.apache.spark.examples.SparkPi
Request parameters10

20241101184903

20241101184941

After the job completes, view the returned data to see the result.

20250312182142

Further reading

You have now deployed Spark Yun on Alibaba Cloud ECS and explored its core features. See the product manual for more information.