在 RedHat/CentOS 6 系统上安装 Talend CommandLine - 7.1

Talend Data Integration 安装与升级指南 (Linux)

EnrichVersion
7.1
EnrichProdName
Talend Data Integration
task
数据治理
EnrichPlatform
Talend Activity Monitoring Console
Talend Administration Center
Talend Artifact Repository
Talend CommandLine
Talend Data Preparation
Talend Data Stewardship
Talend Identity and Access Management
Talend Installer
Talend JobServer
Talend Log Server
Talend Runtime
Talend Studio

过程

  1. 创建以下脚本并将其复制到 /etc/init.d/commandline 文件:
    #!/bin/sh
    ### BEGIN INIT INFO
    # Default-Start:     2 3 4 5
    # Default-Stop:      S 0 1 6
    # Short-Description: Example initscript
    # Description:       This file should be used to construct scripts to be placed in /etc/init.d.
    ### END INIT INFO
    
    # Author: jsd03
    
    # Do NOT "set -e"
    
    # PATH should only include /usr/* if it runs after the mountnfs.sh script
    PATH=/usr/sbin:/usr/bin:/sbin:/bin
    COMMANDLINE=/oa/talend/commandline303
    CMD_WORKSPACE=$COMMANDLINE"/commandline-workspace"
    STARTUP=commandline.sh
    USER=cxp
    NAME=commandline
    PORT=10004
    
    
    # Read configuration variable file if present
    [ -r /etc/default/$NAME ] && . /etc/default/$NAME
    
    # Load the VERBOSE setting and other rcS variables
    [ -f /etc/default/rcS ] && . /etc/default/rcS
    
    # Define LSB log_* functions.
    # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
    . /lib/lsb/init-functions
    
    #
    # Function that starts the daemon/service
    #
    do_start()
    {
    echo -n $"Starting commandline service: "
     su - $USER -c "rm -Rf $CMD_WORKSPACE"
     su - $USER -c "cd $COMMANDLINE && screen -dmS cmdLine ./$STARTUP"
    #screen -dmS cmdLine $DAEMON_START
     RETVAL=$?
     echo
    
    }
    
    #
    # Function that stops the daemon/service
    #
    do_stop()
    {
     echo -n $"Stopping commandline service: "
     su - $USER -c "( echo 'stopServer' ; sleep 2 ) | telnet localhost $PORT"
     RETVAL=$?
     echo
    
    }
    
    case "$1" in
    start)
    do_start
     ;;
    stop)
     do_stop
     ;;
    *)
     echo $"Usage: $0 {start|stop}"
     exit 1
    esac
    
    exit 0
  2. 编辑脚本中的 USERCOMMANDLINE 变量值 (分别使用专用于运行 Talend CommandLine 的用户和 Talend CommandLine 路径)。
  3. 通过键入以下命令确保该脚本可执行:
    chmod 0755 /etc/init.d/commandline
  4. 键入以下命令以将该服务添加到您的系统:
    chkconfig --list
    chkconfig --add commandline