This document provides a lightweight deployment guide for Apache Linkis, using S3 object storage (e.g., MinIO) instead of HDFS to achieve rapid deployment without Hadoop dependencies.
| No. | Item | Description |
|---|---|---|
| 1 | Linkis Package | apache-linkis-x.x.x-bin.tar.gz |
| 2 | MySQL Driver | mysql-connector-java-8.x.x.jar |
| 3 | Server | Linux server, CentOS 7/8 or Ubuntu 18.04+ recommended |
| 4 | MySQL Database | MySQL 5.7+ or 8.0+ |
| 5 | S3 Storage | MinIO or S3-compatible object storage service |
Prepare the following S3/MinIO connection information:
# S3 access credentials access.key=<your-access-key> secret.key=<your-secret-key> # S3 service address endpoint=http://<your-s3-endpoint>:<port> # S3 region and bucket region=<your-region> bucket=<your-bucket-name>
Note: If the bucket does not exist, create it in MinIO/S3 beforehand.
# MySQL connection info MYSQL_HOST=<your-mysql-host> MYSQL_PORT=3306 MYSQL_DB=<your-database-name> MYSQL_USER=<your-mysql-user> MYSQL_PASSWORD=<your-mysql-password>
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 4 cores | 8+ cores |
| Memory | 8 GB | 16+ GB |
| Disk | 50 GB | 100+ GB |
| Software | Version |
|---|---|
| JDK | 1.8.0_141+ |
| MySQL | 5.7+ or 8.0+ |
| MinIO | Any stable version |
| Linux | CentOS 7/8, Ubuntu 18.04+ |
| Service Component | Default Port | Description |
|---|---|---|
| linkis-mg-gateway | 9001 | Gateway service |
| linkis-ps-publicservice | 9105 | Public service |
| linkis-cg-linkismanager | 9101 | Engine manager |
| linkis-cg-entrance | 9104 | Task entrance |
| linkis-cg-engineconnmanager | 9102 | Engine connection manager |
# Create deployment user (using hadoop as example) sudo useradd hadoop -m -s /bin/bash sudo passwd hadoop # Configure sudo without password (optional) sudo visudo # Add the following: hadoop ALL=(ALL) NOPASSWD: ALL
# Switch to deployment user su - hadoop # Create installation directory mkdir -p ~/linkis-install cd ~/linkis-install # Upload and extract package tar -xzf apache-linkis-x.x.x-bin.tar.gz cd apache-linkis-x.x.x-bin
Directory structure after extraction:
apache-linkis-x.x.x-bin/ ├── bin/ # Executable scripts │ └── install.sh # Installation script ├── deploy-config/ # Deployment configuration │ ├── db.sh # Database configuration │ └── linkis-env.sh # Environment variables ├── linkis-package/ # Linkis core package │ ├── lib/ # Dependencies │ ├── conf/ # Configuration templates │ └── sbin/ # System management scripts └── ...
Edit deploy-config/db.sh:
vim deploy-config/db.sh
Configure MySQL connection:
# Linkis metadata database configuration MYSQL_HOST=<your-mysql-host> MYSQL_PORT=3306 MYSQL_DB=<your-database-name> MYSQL_USER=<your-mysql-user> MYSQL_PASSWORD=<your-mysql-password> # Database driver class (MySQL 8.0 uses cj driver) MYSQL_JDBC_DRIVER=com.mysql.cj.jdbc.Driver
Edit deploy-config/linkis-env.sh:
vim deploy-config/linkis-env.sh
Key configuration:
# Deployment user deployUser=hadoop # Linkis installation directory (target directory after installation script execution) LINKIS_HOME=<your-linkis-install-path> # JDK path JAVA_HOME=<your-java-home> # Comment out or remove Hadoop/HDFS related configuration # hadoop.config.dir=xxx # hive.config.dir=xxx # spark.config.dir=xxx # Use local filesystem (lightweight mode) wds.linkis.filesystem.root.path=file:///tmp/linkis/ wds.linkis.filesystem.hdfs.root.path=file:///tmp/linkis
# Execute installation sh bin/install.sh
Installation options:
The installation script will automatically:
Important: Copy the MySQL driver to the following locations:
# Set environment variable (according to actual installation path) export LINKIS_HOME=<your-linkis-install-path> # Copy MySQL driver to service modules cp mysql-connector-java-8.x.x.jar ${LINKIS_HOME}/lib/linkis-spring-cloud-services/linkis-mg-gateway/ cp mysql-connector-java-8.x.x.jar ${LINKIS_HOME}/lib/linkis-commons/public-module/
Edit $LINKIS_HOME/conf/linkis.properties:
vim $LINKIS_HOME/conf/linkis.properties
Add S3 configuration:
# S3 filesystem configuration linkis.storage.s3.access.key=<your-access-key> linkis.storage.s3.secret.key=<your-secret-key> linkis.storage.s3.endpoint=http://<your-s3-endpoint>:<port> linkis.storage.s3.region=<your-region> linkis.storage.s3.bucket=<your-bucket-name> # BML uses S3 storage linkis.bml.filesystem.type=s3 # Disable filesystem permission check (required for S3 mode) wds.linkis.workspace.filesystem.owner.check=false wds.linkis.workspace.filesystem.path.check=false
Edit $LINKIS_HOME/conf/linkis-cg-entrance.properties:
vim $LINKIS_HOME/conf/linkis-cg-entrance.properties
⚠️ Important: S3 path format must use triple slashes (s3:///)
# Log storage path (using S3) wds.linkis.entrance.config.log.path=s3:///log/ # Result set storage path (using S3) wds.linkis.resultSet.store.path=s3:///resultset/
Path format explanation:
- ✅ Correct format:
s3:///log/(three slashes, bucket read from config)- ❌ Wrong format:
s3://bucket-name/log/(causes path parsing errors)Reason: S3FileSystem reads the bucket name from
linkis.storage.s3.bucketconfiguration. The path should not contain bucket information.
cd ${LINKIS_HOME}/sbin # Start all Linkis services sh linkis-start-all.sh
Wait for all services to start (about 1-2 minutes).
# Check service processes jps # You should see these 6 service processes: # - LinkisManagerApplication (linkis-cg-linkismanager) # - LinkisEntranceApplication (linkis-cg-entrance) # - EngineConnManagerApplication (linkis-cg-engineconnmanager) # - LinkisMGGatewayApplication (linkis-mg-gateway) # - PublicServiceApplication (linkis-ps-publicservice) # - LinkisConsumerApplication (linkis-mg-eureka)
View service logs:
# View Entrance service log tail -f ${LINKIS_HOME}/logs/linkis-cg-entrance.log # View Gateway service log tail -f ${LINKIS_HOME}/logs/linkis-mg-gateway.log
cd ${LINKIS_HOME} # Submit a simple Shell test job sh bin/linkis-cli \ -submitUser <your-user> \ -proxyUser <your-user> \ -engineType shell-1 \ -codeType shell \ -code "echo 'Test S3 storage'; date; hostname"
JobId: xxx TaskId: xxx ExecId: xxx [INFO] Job is successfully submitted! ============Result:================ TaskId: xxx ExecId: xxx User: xxx Current job status: SUCCEED ============ RESULT SET 1 ============ Test S3 storage <current date> <hostname> ############Execute Success!!!########
# CentOS/RHEL sudo yum install -y awscli # Ubuntu/Debian sudo apt-get install -y awscli
# Configure S3 credentials export AWS_ACCESS_KEY_ID=<your-access-key> export AWS_SECRET_ACCESS_KEY=<your-secret-key>
# List buckets (replace with your S3 endpoint) aws --endpoint-url http://<your-s3-endpoint>:<port> s3 ls # View bucket contents aws --endpoint-url http://<your-s3-endpoint>:<port> s3 ls s3://<your-bucket-name>/ # View log and result files aws --endpoint-url http://<your-s3-endpoint>:<port> s3 ls s3://<your-bucket-name>/log/result/ --recursive
Browser access: http://<your-server-ip>:8088
Log in with the credentials configured during installation.
Symptom:
java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
Solution: Ensure MySQL driver is copied to all specified locations (see section 3.6), and check file permissions.
Symptom:
Upload BML resource failed, status: 401 Unauthorized
Solution: Check if token configuration is consistent:
# 1. Check token in config file grep "wds.linkis.bml.auth.token.value" ${LINKIS_HOME}/conf/linkis.properties # 2. Check token in database # Query linkis_mg_gateway_auth_token table for token_name='BML-AUTH' # 3. Ensure both are consistent
Symptom:
WorkSpaceException: the path should contain schema
Solution 1: Use correct S3 path format
# Wrong format wds.linkis.entrance.config.log.path=s3://bucket-name/log/ # Correct format (three slashes) wds.linkis.entrance.config.log.path=s3:///log/
Solution 2: Disable path permission check
Add to linkis.properties:
wds.linkis.workspace.filesystem.owner.check=false wds.linkis.workspace.filesystem.path.check=false
Symptom: Job shows success but returns empty result.
Solution:
s3:/// triple slashes)cd ${LINKIS_HOME}/sbin sh linkis-daemon.sh restart cg-entrance
Symptom: BML uploads files using HDFS or local filesystem instead of S3.
Solution: Add to linkis.properties:
linkis.bml.filesystem.type=s3
Troubleshooting steps:
tail -100 ${LINKIS_HOME}/logs/linkis-cg-entrance.log tail -100 ${LINKIS_HOME}/logs/linkis-mg-gateway.log
netstat -tunlp | grep -E "9001|9104|9105|9101|9102"
java -version # Ensure JDK 1.8.0_141 or higher
cd ${LINKIS_HOME}/sbin # Start all services sh linkis-start-all.sh # Stop all services sh linkis-stop-all.sh # Start single service sh linkis-daemon.sh start cg-entrance # Stop single service sh linkis-daemon.sh stop cg-entrance # Restart single service sh linkis-daemon.sh restart cg-entrance
# Real-time log viewing tail -f ${LINKIS_HOME}/logs/linkis-cg-entrance.log # View last 100 lines tail -100 ${LINKIS_HOME}/logs/linkis-cg-entrance.log # Search for error logs grep -i error ${LINKIS_HOME}/logs/linkis-cg-entrance.log # List all service logs ls -lht ${LINKIS_HOME}/logs/*.log
linkis.properties:
# ==================== S3 Storage Configuration ==================== # S3 access credentials linkis.storage.s3.access.key=<your-access-key> linkis.storage.s3.secret.key=<your-secret-key> # S3 service endpoint linkis.storage.s3.endpoint=http://<your-s3-endpoint>:<port> # S3 region linkis.storage.s3.region=<your-region> # S3 Bucket name linkis.storage.s3.bucket=<your-bucket-name> # BML uses S3 filesystem linkis.bml.filesystem.type=s3 # ==================== Filesystem Configuration ==================== # Root path (lightweight mode uses local filesystem) wds.linkis.filesystem.root.path=file:///tmp/linkis/ wds.linkis.filesystem.hdfs.root.path=file:///tmp/linkis # BML does not use HDFS wds.linkis.bml.is.hdfs=false wds.linkis.bml.local.prefix=file:///tmp/linkis # ==================== Permission Configuration ==================== # Disable filesystem permission check (required for S3 mode) wds.linkis.workspace.filesystem.owner.check=false wds.linkis.workspace.filesystem.path.check=false
linkis-cg-entrance.properties:
# ==================== Log and Result Set Storage Paths ==================== # Note: Must use s3:/// triple slash format wds.linkis.entrance.config.log.path=s3:///log/ wds.linkis.resultSet.store.path=s3:///resultset/ # ==================== Engine Reuse Configuration ==================== # Disable executeOnce to enable engine reuse (optional) linkis.entrance.execute.once=false
${LINKIS_HOME}/
├── bin/ # Client tools
│ └── linkis-cli # Command line client
├── conf/ # Configuration files
│ ├── linkis.properties # Global configuration
│ ├── linkis-cg-entrance.properties # Entrance configuration
│ ├── linkis-cg-linkismanager.properties # Manager configuration
│ └── ...
├── lib/ # Dependencies
│ ├── linkis-commons/
│ ├── linkis-computation-governance/
│ ├── linkis-public-enhancements/
│ └── linkis-spring-cloud-services/
├── logs/ # Log files
│ ├── linkis-cg-entrance.log
│ ├── linkis-mg-gateway.log
│ └── ...
└── sbin/ # Service management scripts
├── linkis-start-all.sh
├── linkis-stop-all.sh
└── linkis-daemon.sh
s3://<your-bucket>/ ├── log/ # Log root directory │ ├── <user>/ # User logs │ │ └── log/ │ │ └── <creator>/ │ │ └── <date>/ │ │ └── <jobId>.log │ └── result/ # Result set directory │ └── <date>/ # Organized by date │ └── <creator>/ # Organized by creator │ └── <user>/ # Organized by user │ └── <taskId>/ # Organized by task ID │ └── x_x.dolphin # Result file
Linkis supports various compute engines, which can be added as needed:
For engine installation, refer to the official documentation: Engine Usage Guide
Multiple data sources can be configured:
Through the Web UI you can:
# Service management cd ${LINKIS_HOME}/sbin sh linkis-start-all.sh # Start all services sh linkis-stop-all.sh # Stop all services sh linkis-daemon.sh restart cg-entrance # Restart entrance # Job submission cd ${LINKIS_HOME} sh bin/linkis-cli -engineType shell-1 -codeType shell \ -code "your command" -submitUser <user> -proxyUser <user> # Log viewing tail -f ${LINKIS_HOME}/logs/linkis-cg-entrance.log grep -i error ${LINKIS_HOME}/logs/*.log # Service check jps # View Java processes netstat -tunlp | grep 9001 # Check ports
| Configuration | Config File | Description |
|---|---|---|
| linkis.storage.s3.endpoint | linkis.properties | S3 service address |
| linkis.storage.s3.bucket | linkis.properties | S3 Bucket name |
| wds.linkis.entrance.config.log.path | linkis-cg-entrance.properties | Log storage path |
| wds.linkis.resultSet.store.path | linkis-cg-entrance.properties | Result set storage path |
| linkis.bml.filesystem.type | linkis.properties | BML filesystem type |