• Linux中kettle自动化部署脚本


    自己写的一个自动化在Linux中部署kettle的脚本,包括一些遇到的问题在脚本中都有涉及。

    kettle是官网最新版本pdi-ce-6.1.0.1-196.zip

    目前最新版本下载地址:https://sourceforge.net/projects/pentaho/files/latest/download?source=top3_dlp_t5

    脚本:

     1 #!/bin/bash
     2 #Record the current directory!
     3 mulu=`pwd`
     4 #The output of JAVA_HOME number of bytes
     5 c=`echo $JAVA_HOME|wc -c`
     6 echo "Tips:Install JDK!Configuration JAVA_HOME"
     7 #Please install JDK if JAVA_HOME bytes is equal to 1
     8 
     9 if [ $c -eq 1 ];then
    10 echo "Please install JDK!"
    11 #If Already configured JAVA_HOME,continue!Otherwise, the exit!
    12 elif [ $? != 0 ];then
    13 echo "Already configured JAVA_HOME!"
    14 cd ~/.kettle/
    15 #If there is a file .spoonrc,continue!
    16 
    17 if [ -f .spoonrc ];then
    18 echo "Exist .spoonrc file!"
    19 aa=`cat ~/.kettle/.spoonrc |grep ShowWelcomePageOnStartup |awk -F '=' '{print $2}'`
    20 #If the ShowWelcomePageOnStartup command file is empty,continue!
    21 
    22 if [ ! $aa ];then
    23 echo "Without ShowWelcomePageOnStartup=N, appended to the file!"
    24 echo "ShowWelcomePageOnStartup=N" >> ~/.kettle/.spoonrc
    25 #If the file in this command ShowWelcomePageOnStartup is not equal to N,continue!
    26 elif [ $aa != "N" ];then
    27 echo "ShowWelcomePageOnStartup is not equal to N, to modify ShowWelcomePageOnStartup is equal to N!"
    28 sed -i "s/$aa/N/g" ~/.kettle/.spoonrc
    29 fi
    30 
    31 #If there is no file .spoonrc
    32 else
    33 echo "There is no file .spoonrc,Created .spoonrc file and add command!"
    34 echo "ShowWelcomePageOnStartup=N" > ~/.kettle/.spoonrc
    35 fi
    36 #Switch to the original directory!
    37 cd $mulu
    38 #If there is a directory "data-integration", enter the directory, otherwise unzip the package!
    39 if [ -d "data-integration" ];then
    40 echo "Directory exists, into the directory!"
    41 cd data-integration
    42 else
    43 echo "Directory does not exist, unzip the package!"
    44 unzip pdi-ce-6.1.0.1-196.zip
    45 cd data-integration
    46 fi
    47 #Install graphical interface
    48 yum -y groupinstall "X Window System"
    49 #Open the graphical interface!
    50 echo "Open the graphical interface!"
    51 sh spoon.sh
    52 fi

    注:脚本和pdi-ce-6.1.0.1-196.zip压缩包放到同一目录下。直接sh这个脚本。此脚本直接启动图形化界面。

  • 相关阅读:
    ecplise自动提示失效,使用补全自动提示快捷键(Alt+/),但只显示“No Default Proposals”
    maven构建ssh工程
    pom.xml中坐标的组成
    依赖传递的规则
    maven中导入包版本冲突的解决
    maven工程的拆分与聚合
    maven的生命周期
    maven的常用命令
    在pom.xml中引入jar包坐标的依赖范围
    【stl的神奇操作】用集合搞定区间相交
  • 原文地址:https://www.cnblogs.com/zeppelin/p/5737327.html
Copyright © 2020-2023  润新知