Skip to main content
Version: Next(1.7.0)

Shell Engine

This article mainly introduces the installation, usage and configuration of the Shell engine plug-in in Linkis.

1. Preliminary work

1.1 Environment installation

If you want to use the shell engine on your server, you need to ensure that the user's PATH has the executable directory and execution permission of bash.

1.2 Environment verification

echo $SHELL

The following information is output to indicate that the shell environment is available

/bin/bash

or

/bin/sh

2. Engine plugin installation default engine

The Shell engine plugin is included in the binary installation package released by linkis by default, and users do not need to install it additionally.

EngineConnPlugin engine plugin installation

3. Engine usage

3.1 Submit tasks through Linkis-cli

sh ./bin/linkis-cli -engineType shell-1 \
-codeType shell -code "echo \"hello\" " \
-submitUser hadoop -proxyUser hadoop

More Linkis-Cli command parameter reference: Linkis-Cli usage

3.2 Submit tasks through Linkis SDK

Linkis provides SDK for Java and Scala to submit tasks to the Linkis server. For details, please refer to JAVA SDK Manual. For the Shell task you only need to modify the EngineConnType and CodeType parameters in the Demo:

Map<String, Object> labels = new HashMap<String, Object>();
labels.put(LabelKeyConstant.ENGINE_TYPE_KEY, "shell-1"); // required engineType Label
labels.put(LabelKeyConstant.USER_CREATOR_TYPE_KEY, "hadoop-IDE");// required execute user and creator
labels.put(LabelKeyConstant.CODE_TYPE_KEY, "shell"); // required codeType

4. Engine configuration instructions

The shell engine can generally set the maximum memory of the engine JVM.