Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

CDAP 3.x

CDAP 3.0 through CDAP 3.6 releases use multiple scripts to interface with different CDAP functionality.

ScriptLocationFunctionExample Use
cdap.bat$CDAP_HOME/bin (SDK)Manage CDAP Standalone on Windowscdap.bat start
cdap.sh$CDAP_HOME/bin (SDK)Manage CDAP Standalone on MacOS/Linuxcdap.sh start
cdap-cli.bat$CDAP_HOME/bin (SDK)Execute the CDAP CLI on Windowscdap-cli.bat list artifacts
cdap-cli.sh

$CDAP_HOME/bin (SDK)

$CDAP_HOME/cli/bin (Distributed)

Execute the CDAP CLI on MacOS/Linuxcdap-cli.sh list artifacts
common.sh$CDAP_HOME/*/bin (Distributed)Functions for distributed CDAPsource $CDAP_HOME/master/common.sh
common-env.sh$CDAP_HOME/*/bin (Distributed)Default environment variables for distributed CDAPsource $CDAP_HOME/master/common-env.sh
service$CDAP_HOME/*/bin (Distributed)Distributed CDAP start scriptn/a (script cannot be directly executed)
config-tool$CDAP_HOME/ui/bin (Distributed)Convert CDAP XML configuration files to JSONconfig-tool --cdap
auth-server-env.sh$CDAP_HOME/security/conf (Distributed)Environment variables for CDAP Auth Serversource $CDAP_HOME/security/conf/auth-server-env.sh
kafka-server-env.sh$CDAP_HOME/kafka/conf (Distributed)Environment variables for CDAP Kafka Serversource $CDAP_HOME/kafka/conf/kafka-server-env.sh
master-env.sh$CDAP_HOME/master/conf (Distributed)Environment variables for CDAP Mastersource $CDAP_HOME/master/conf/master-env.sh
router-env.sh$CDAP_HOME/gateway/conf (Distributed)Environment variables for CDAP Routersource $CDAP_HOME/gateway/conf/router-env.sh
ui-env.sh$CDAP_HOME/ui/conf (Distributed)Environment variables for CDAP UIsource $CDAP_HOME/ui/conf/ui-env.sh
svc-auth-server$CDAP_HOME/security/bin (Distributed)Symlink to manage CDAP Auth Server$CDAP_HOME/security/bin/svc-auth-server start
svc-kafka-server$CDAP_HOME/kafka/bin (Distributed)Symlink to manage CDAP Kafka Server$CDAP_HOME/kafka/bin/svc-kafka-server start
svc-master$CDAP_HOME/master/bin (Distributed)Symlink to manage CDAP Master$CDAP_HOME/master/bin/svc-master run \ co.cask.cdap.data.tools.UpgradeTool upgrade
svc-router$CDAP_HOME/gateway/bin (Distribtued)Symlink to manage CDAP Router$CDAP_HOME/gateway/bin/svc-router start
svc-ui$CDAP_HOME/ui/bin (Distributed)Symlink to manage CDAP UI$CDAP_HOME/ui/bin/svc-ui start
tx-debugger.bat$CDAP_HOME/bin (SDK)Execute Transaction Debugger on Windowstx-debugger.bat
tx-debugger.sh$CDAP_HOME/bin (SDK)Execute Transaction Debugger on MacOS/Linuxtx-debugger.sh

Functionality is spread across the file-system and it is difficult to know which script to use for which functionality. The service script, while not run directly, changes its functionality based on the way it is run, rather than arguments. This makes the script rather fragile and difficult to modify without knowing how it will possibly effect other services. Each distributed component also has a copy of the common.sh and common-env.sh files, making them identical, but not common across the components.

CDAP 4.x

CDAP 4.0 introduces a single script which unifies and simplifies the interface with CDAP. Rather than multiple scripts, the cdap script should support all of the necessary functionality for running CDAP in either distributed mode or standalone mode within the CDAP SDK. This reduces the maintenance cost of these scripts while providing a single location for end users to perform CDAP actions.

The entirety of the scripts above have been rolled into a small set of scripts.

ScriptLocationFunctionExample Use
cdap.bat$CDAP_HOME/bin (SDK)Interface with CDAP on Windowscdap.bat sdk start
cdap

$CDAP_HOME/bin (SDK),

$CDAP_HOME/*/bin (Distributed)

Interface with CDAP on MacOS/Linuxcdap sdk start
functions.sh

$CDAP_HOME/bin (SDK),

$CDAP_HOME/*/bin (Distributed)

Provide shell functions for MacOS/Linux (SDK) or Linux (Distributed)source $CDAP_HOME/bin/function.sh

CDAP does not provide a set of usable functions on Windows due to the limitations of the BAT file format.

Using the cdap script

The cdap script is merely a wrapper which takes certain arguments and passes them to the correct functions in the function.sh shell function library. Any commands which are not recognized by the script are passed to the CDAP CLI and executed. The table below shows some common uses which will mirror the previous functionality. However, it is not intended to be exhaustive and will not include every command or option.

CommandContextOld CommandNotes
cdap sdk start --foregroundSDKcdap.sh start --foregroundCDAP SDK command arguments remain unchanged
cdap sdk --helpSDKcdap.sh --help 
cdap cli list artifactsDistributed, SDKcdap-cli.sh list artifacts 
cdap list artifactsDistributed, SDKcdap-cli.sh list artifactsArguments not directly recognized by the script are passed to the CDAP CLI
cdap auth-server startDistributed$CDAP_HOME/security/bin/svc-auth-server start 
cdap classpathDistributed$CDAP_HOME/master/bin/svc-master classpathAlways returns the CDAP Master CLASSPATH
cdap config-tool --cdapDistributed$CDAP_HOME/ui/bin/config-tool --cdap 
cdap run co.cask.cdap.data.tools.UpgradeTool upgradeDistributed$CDAP_HOME/master/bin/svc-master run \ co.cask.cdap.data.tools.UpgradeTool upgradeUsing run from a service script other than svc-master would result in an invalid CLASSPATH
cdap tx-debuggerDistributed, SDK$CDAP_HOME/bin/tx-debugger.sh (SDK only)Previously, the script was only available on SDK

Shell function library

All CDAP functions are provided in a library shell file, which can be sourced to easily interact with CDAP from the command line, especially useful for integrating CDAP into new deployment or management systems.

 

  • No labels