在 RedHat/CentOS 6 和 Ubuntu 系统上安装服务 - 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/tomcat 文件:
    # chkconfig: 345 91 10
    # description: Starts and stops the Tomcat daemon.
    #
    
    # Source function library.
    . /etc/rc.d/init.d/functions
    
    # Get config.
    . /etc/sysconfig/network
    
    # Check that networking is up.
    [ "${NETWORKING}" = "no" ] && exit 0
    
    user=cxp
    tomcat=/u/bin/Tomcat/apache-tomcat-8.0.33/
    startup=$tomcat/bin/startup.sh
    shutdown=$tomcat/bin/shutdown.sh
    #export JAVA_HOME=/usr/local/java
    
    status(){
    ps ax --width=1000 | grep "[o]rg.apache.catalina.startup.Bootstrap start"
    | awk '{printf $1 " "}' | wc | awk
    '{print $2}' > /tmp/tomcat_process_count.txt
    read line < /tmp/tomcat_process_count.txt
    if [ $line -gt 0 ]; then
    echo -n "tomcat ( pid "
    ps ax --width=1000 | grep "[o]rg.apache.catalina.startup.Bootstrap start"
    | awk '{printf $1 " "}'
    echo -n ") is running..."
    echo
    else
    echo "Tomcat is stopped"
    fi
    }
    
    start(){
     echo -n $"Starting Tomcat service: "
     #daemon -c
     su - $user -c "$startup" 
     RETVAL=$?
     echo
    }
    
    stop(){
     action $"Stopping Tomcat service: " su - $user "$shutdown"
     RETVAL=$?
     echo
    }
    
    restart(){
      stop
      start}
    
    # See how we were called.
    case "$1" in
    start)
     start
     ;;
    stop)
     stop
     ;;
    status)
          
     status tomcat
     ;;
    restart)
     restart
     ;;
    *)
     echo $"Usage: $0 {start|stop|status|restart}"
     exit 1
    esac
    
    exit 0
  2. 编辑该脚本中的 usertomcat 变量以匹配您的配置。
  3. 要确保该脚本可执行,请键入:
    # chmod 0755 /etc/init.d/tomcat
  4. 键入以下命令以将该服务添加到您的系统:
    chkconfig --list
    chkconfig --add tomcat