Shell Engine

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

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. echo $SHELL

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

  1. /bin/bash

or

  1. /bin/sh

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

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

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

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:

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

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