Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Run PDI remotely on linux from Powershell

  1. #1
    Join Date
    Feb 2011
    Posts
    840

    Question Run PDI remotely on linux from Powershell

    ok, I know it's Friday and it's late, but I've been banging my head against a wall on this the whole day...

    I'm trying to migrate a process with PDI from a "local" (next room) Windows server to a remote (really far away) Debian server. I found out this way to use SSH on Powershell, but when I try to use it to run kitchen.sh I get a "java not found" error... =(

    Code:
    PS C:\Users\my-user> $SshSessions.'linux-server'.RunCommand('/opt/data-integration/kitchen.sh')
    CommandText          : /opt/data-integration/kitchen.sh
    CommandTimeout       : -00:00:00.0010000
    ExitStatus           : 0
    OutputStream         : Renci.SshNet.Common.PipeStream
    ExtendedOutputStream : Renci.SshNet.Common.PipeStream
    Result               :
    Error                : /opt/data-integration/spoon.sh: 209: /opt/data-integration/spoon.sh: java: not found
    But I have no idea why, since I've added this on kitchen.sh:
    Code:
    PENTAHO_JAVA_HOME=/opt/jdk/jdk1.7.0_65/bin
    When I try it on PuTTY, it works as it should...
    Code:
    my-user@linux-server:~$ /opt/data-integration/kitchen.sh
    Options:
      -rep            = Repository name
      -user           = Repository username
      -pass           = Repository password
      -job            = The name of the job to launch
      -dir            = The directory (dont forget the leading /)
      -file           = The filename (Job XML) to launch
      -level          = The logging level (Basic, Detailed, Debug, Rowlevel, Error, Nothing)
      -logfile        = The logging file to write to
      -listdir        = List the directories in the repository
      -listjobs       = List the jobs in the specified directory
      -listrep        = List the available repositories
      -norep          = Do not log into the repository
      -version        = show the version, revision and build date
      -param          = Set a named parameter <NAME>=<VALUE>. For example -param:FILE=customers.csv
      -listparam      = List information concerning the defined parameters in the specified job.
      -export         = Exports all linked resources of the specified job. The argument is the name of a ZIP file.
      -custom         = Set a custom plugin specific option as a String value in the job using <NAME>=<Value>, for example: -custom:COLOR=Red
      -maxloglines    = The maximum number of log lines that are kept internally by Kettle. Set to 0 to keep all rows (default)
      -maxlogtimeout  = The maximum age (in minutes) of a log line while being kept internally by Kettle. Set to 0 to keep all rows indefinitely (default)
    A better description of what's going on here:
    - the process is, as of now, on a batch file. I'm migrating it to Powershell.
    - I'm not the only one who must be able to run it.
    - Using that SSH over Powershell solution isn't actually needed, as long as there's a way to easily make the solution available to anyone who can access a Windows fileshare were the file-based PDI repository is. That one was easy to fit in this prereq because I can save the script files on the fileshare, and have Powershell copy/enable the module/disable the module/remove the files on the local machine where the batch/PS script is running.
    - The batch/PS script interacts with the user, but the PDI process doesn't. I just need to run it, so if I can get /opt/data-integration/kitchen.sh to execute, I know the jobs will run.
    - SSH per se isn't needed, but I do need a way to, from Powershell, tell the Linux server to run a couple jobs (yeah, there are a few, not just one).
    - Optional: a way to copy all related jobs, transformations, templates and validation files (ktr, kjb, xlsx, xsl and xsd files) from the fileshare to the linux server. If there's a way to copy one folder and all it's content is enough, since all these files are rounded up on only one folder (and subfolders).

    So... can anyone gimme a light here?

    (edit) just tried doing it with plink and I get the same error on powershell: "java: note found"
    (edit 2) oh yeah, if I try to check java, either through plink or $SshSessions.'linux-server'.RunCommand(), I get to it...
    Code:
    PS C:\Users\my-user> $SshSessions.'linux-server'.RunCommand('/opt/jdk/jdk1.7.0_65/bin/java -version')
    
    
    
    CommandText          : /opt/jdk/jdk1.7.0_65/bin/java -version
    CommandTimeout       : -00:00:00.0010000
    ExitStatus           : 0
    OutputStream         : Renci.SshNet.Common.PipeStream
    ExtendedOutputStream : Renci.SshNet.Common.PipeStream
    Result               :
    Error                : java version "1.7.0_65"
                           Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
                           Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
    Code:
    PS C:\Users\my-user> \\fileshare\utils\putty\PLINK.EXE -ssh my-user@linux-server /opt/jdk/jdk1.7.0_65/bin/java -version
    java version "1.7.0_65"
    Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
    Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
    Last edited by joao.ciocca; 08-21-2015 at 06:24 PM.
    Join us on IRC! =)

    Twitter / Google+ / Timezone: BRT-BRST
    BI Server & PDI 5.4 / MS SQL 2012 / Learning CDE & CTools
    Windows 8 64-bit / Java 7 (jdk1.8.0_75)

    Quote Originally Posted by gutlez
    PLEASE NOTE: No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.

    I'm no expert.Take my comments at your own risk.

  2. #2
    Join Date
    Feb 2011
    Posts
    840

    Default

    Ok, I got it with plink - but I had to change one thing...

    If I run "locally", when I logged on the server on PuTTY, the path to Java HAS TO BE /opt/jdk/jdk1.7.0_65/bin/ for some reason kitchen won't find java inside the bin if it's just /opt/jdk/jdk1.7.0_65/. But when I used plink, I noticed... "/opt/data-integration/spoon.sh: 209: /opt/data-integration/spoon.sh: /opt/jdk/jdk1.7.0_65/bin/bin/java: not found"

    so, I removed the /bin/ from kitchen.sh and now it works =)
    Join us on IRC! =)

    Twitter / Google+ / Timezone: BRT-BRST
    BI Server & PDI 5.4 / MS SQL 2012 / Learning CDE & CTools
    Windows 8 64-bit / Java 7 (jdk1.8.0_75)

    Quote Originally Posted by gutlez
    PLEASE NOTE: No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.

    I'm no expert.Take my comments at your own risk.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.