Execute hadoop command inside a runbook

How do I execute a hadoop command inside an automation runbook.  I want to be able to unzip files from blob after the cluster has been automatically created.  I tried using a custom script action after the cluster is up but it failed. it said that
it downloaded the script but then failed to run the script.  Is there syntax i can use inside my runbook to execute a command? something like
$output = Invoke-HDICmdScript -CmdToExecute "%HADOOP_HOME%\bin\hadoop fs -touchz /solr-installation";
is the Invoke-HDICmdScript -CmdToExecute a valid command inside a runbook?
thanks
tg

You can use the Add-AzureHDInsightScriptAction cmdlet to run custom scripts during your cluster deployment inside a Runbook. For example, to install Spark, you can use the following command:
$config = Add-AzureHDInsightScriptAction -Config $config -Name "Install R" -ClusterRoleCollection HeadNode,DataNode -Uri
https://hdiconfigactions.blob.core.windows.net/rconfigactionv02/r-installer-v02.ps1
Regards.
Debarchan Sarkar - MSFT ( This posting is provided AS IS with no warranties, and confers no rights.)

Similar Messages

  • How can I execute a command inside of a VM client from the VM host?

    Hi!
    I'm working on a set of scripts to automate MOC classroom installations using MDT and PowerShell. Sofar I've been able to automate everything except for the Rearm needed within the VM Clients. Is there any command (preferably PowerShell) that I can Launch
    on the VM host with which I can execute a command within the VM Client?
    Regards,
    Gerrit Deike
    If you think your to small to make a differnce, try going to bed with a mosquito in the room...

    If you wanted the pings to run in parallel, you could have this applet configure another applet to do the pinging, then remove it on the last run.  This will require an amount of programmatic logic, though.  If you wanted to keep things a bit simpler, add another applet that runs at 22:00 that configures a watchdog pinging applet, then a third applet that runs at 22:10 that removes the pinging applet.
    When it comes to embedded quotes when you configure your nested pinging applet, you'll need to use $q to stand for the embedded quotes.  You'll also need to configure:
    event manager environment q "

  • Execute DOS command inside java

    I have a java program that reads each new user from an inputfile and writes that same user to an output file. The program works fine and is shown below:
    import java.io.*;
    public class FileStreamsTest {
    public static void main(String[] args) {
    try {
    File inputFile = new File("newbousrs.txt");
    File outputFile = new File("outagain.txt");
    FileInputStream fis = new FileInputStream(inputFile);
    FileOutputStream fos = new FileOutputStream(outputFile);
    int c;
    while ((c = fis.read()) != -1) {
    fos.write(c);
    fis.close();
    fos.close();
    } catch (FileNotFoundException e) {
    System.err.println("FileStreamsTest: " + e);
    } catch (IOException e) {
    System.err.println("FileStreamsTest: " + e);
    What I would like to do after each write is to execute a DOS command that looks something like this: supervsr.exe -USER username -PASS password -IMPORTUSERS importfile.txt
    The DOS command above will add each user to the system I want to as the loop goes through each user record.
    How do I execute the DOS command above inside java?

    Tried what but still having a problem...here is my code:
    import java.io.*;
    public class ReadSource {
    public static void main(String[] arguments) {
    try {
    FileReader file = new FileReader("newbousrs.txt");
                                  //FileWriter letters = new FileWriter("outagain.txt");
                                  //PrintWriter pw = new PrintWriter(new FileWriter("outagain.txt"));
    BufferedReader buff = new BufferedReader(file);
                                  Runtime rt = Runtime.getRuntime();
    boolean eof = false;
    while (!eof) {
    String line = buff.readLine();
    if (line == null)
    eof = true;
    else
    System.out.println(line);
                                                 Process proc = rt.exec("\\Blowfish\\droot\\Program Files\\Business Objects\\BusinessObjects 5.0\\supervsr.exe -USER xxxxx -PASS yyyy -IMPORTUSERS \\Blowfish\\droot\\accsp\\public\\newusers\\newbousrs.txt");
                                                 //System.out.println(line.substring(4, 10));
                                                 //System.out.println(line.substring(3,line.indexOf(',',3)));
    buff.close();
    } catch (IOException e) {
    System.out.println("Error -- " + e.toString());
    There error I get is this:
    C:\jakarta-tomcat-4.0.3\webapps\webdav\WEB-INF\classes\accsp>java ReadSource
    NU,Public,Steve Mcnealy,Steve Mcnealy,U,N,N,Y,N,N,PC,F,Y,N,N
    Error -- java.io.IOException: CreateProcess: \Blowfish\droot\Program Files\Busin
    ess Objects\BusinessObjects 5.0\supervsr.exe -USER accsp -PASS fish -IMPORTUSERS
    \Blowfish\droot\accsp\public\newusers\newbousrs.txt error=3

  • Execute DDL Commands inside a transactionScope

    Hi,
    I know that in Oracle all DDL commands include an implicit COMMIT so when you use one of them inside a transactionScope an exception is thrown due to this internal COMMIT. I’m receiving following exception ORA-02089: COMMIT is not allowed in a subordinate session. Is there any way to avoid this limitation?
    Thanks in advance,
    Francesc

    Hi,
    There's no way to get DDL to not autocommit.
    What you could do though is use a stored procedure to do the ddl, and declare the procedure with PRAGMA AUTONOMOUS_TRANSACTION.
    I'm not sure what the advisability of that is since anything that that occurs in the procedure wont be rolled back as part of the transaction, but it works anyway.
    Cheers,
    Greg
    create or replace procedure ExecOutsideTxn(strsql in varchar2) as
    pragma autonomous_transaction;
    begin
    execute immediate strsql;
    end;
    using System;
    using Oracle.DataAccess.Client;
    using System.Transactions;
    using System.Data;
    class Program
    static void Main(string[] args)
    using (TransactionScope ts = new TransactionScope(TransactionScopeOption.RequiresNew))
    using (OracleConnection con = new OracleConnection())
    con.ConnectionString = "user id=scott;password=tiger;data source=orcl";
    con.Open();
    using (OracleCommand cmd = new OracleCommand())
    cmd.CommandText = "begin ExecOutsideTxn('create table foo (col1 varchar2(10))');end;";
    cmd.Connection = con;
    cmd.ExecuteNonQuery();
    // do some other stuff
    ts.Complete();
    }

  • Name error when executing WLST commands inside a jython class

    I am writing some reusable jython classes to be used to retrieve the health of a weblogic domain using WLST.
    But when I use simple WLST commands like connect() within a method connect() and the higherlevel jython script creates a object of WeblogicHealth() and calls connect(), I get NameError pointing to line with connect(). for some reason the namespace within my higher level script doesnt seem to recognize WLST commands.
    AM I doing something plain wrong?
    My class is as follows
    class WeblogicHealth:
    def init( resourceName ):
    def connect(userid,password,adminUrl)
    connect(userid,password,adminUrl)
    test_connect.py
    wlhealthObj = WeblogicHealth('server1')
    wlhealthObj.connect('user',password''url')
    I am running test_connect.py using command
    java weblogic.WLST test_connect.py
    and I get the nameError.
    PLease help

    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/config_scripting/using_WLST.html#wp1094333

  • Executing a command in host machine

    Currently i am doing a project in heterogeneous volume manager, where i need to connect to the host machine and execute some commands inside a java program. Can anyone tell me how to do so.. Are there any api?

    Currently i am doing a project in heterogeneous volume manager, where i need to connect to the host machine and execute some commands inside a java program. Can anyone tell me how to do so.. Are there any api?

  • Use SMA to run commands inside VM created from WAP

    Hello,
    I didnt find any SMA specific forum, so I post here.
    Im new to SMA and have a question that I cant find the answer to.
    We are about to deploy a new Hyper-V/SC/WAP enviroment.
    We use virtual networks and I have problem to connect and execute powershell on the virtual machines.
    I want to do some cutomizations on the VM after they are deployed (Windows Server 2012R2) from a Gallery item in WAP.
    In VM Clouds in Service Management Portal I have activated an Automation with Object = MicrosoftCompute VMRole and Action = Create.
    In my Runbook I check the status on the creation of the VM and when the status is complete I want to execute some powershell on the new server.
    So far so good, but here is my problem, I cant connect to the new VM.
    I have tried:
    $ComputerName = $ResourceObject.ComputerName
    InlineScript {
    Get-Service | Out-File “c:\test.txt”
    } -PSComputerName $ComputerName
    I have tired to add -PSCredential after -PSComputername aswell.
    The Runbook will enter a Suspended state with the following exception:
    Connecting to remote server Fredrik-Test failed with the following error message : WinRM cannot process the request. The following error occured while using Kerberos authentication: Cannot find the computer Fredrik-Test.
    It looks like SMA have no clue how to access the new VM.
    I went to the VMM server and ran the following script:
    $adminpasswd = ConvertTo-SecureString “xxxxx” -AsPlainText -Force
    $adminCredentials = New-Object System.Management.Automation.PSCredential (“administrator”, $adminpasswd)
    $VM = Get-SCVirtualMachine | Where-Object {$_.Name -eq ‘Computer013′}
    Invoke-Command -Computername $VM.ComputerName -ScriptBlock {Get-Service | Out-File “c:\test.txt”} -credential $adminCredentials
    And there I got same error:
    [Computer013] Connecting to remote server Computer013 failed with the following error message : The WinRM client cannot process the request because the server name canno
    t be resolved. For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (Computer013:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : ComputerNotFound,PSSessionStateBroken
    How do I run commands inside the VM that is created from WAP in a Tenant cloud and use virtual network ?
    Regards
    Fredrik Ljus

    I get same error.
    Because I use Network Virtualization it looks like SMA or VMM cant find the VM.
    But how does it work if you for example make a gallery item that will install SQL.
    In that case the server will be installed from the original image with only the OS and then the SQL server will be installed after.
    How does the VMM/SPF communicate with the VM to install the SQL server? Bacause when installing the SQL server it mounts a VHD with the media and trigger the install localy on the VM.
    So, somehow it must be possible to communicate with the VM without using NAT and go through the Gateway server?

  • How to configure host copy command inside EM Console

    hi,
    I want to copy a file from one server to my production server. i found that through host copy command its is possiable in command prompt.but when i configure host copy command inside em console it is not working. i am getting following error
    ORA-06550: line ORA-06550: line 3, column 6: PLS-00103: Encountered the symbol "COPY" when expecting one of the following: := . ( @ % ; , column :
    Any solution for this
    Edited by: mithun on Jun 16, 2011 2:36 AM

    mithun wrote:
    hi,
    I want to copy a file from one server to my production server. i found that through host copy command its is possiable in command prompt.but when i configure host copy command inside em console it is not working. i am getting following error
    ORA-06550: line ORA-06550: line 3, column 6: PLS-00103: Encountered the symbol "COPY" when expecting one of the following: := . ( @ % ; , column :
    Any solution for this
    Edited by: mithun on Jun 16, 2011 2:36 AMThis makes no sense whatsoever.
    Now, as for your original question, there is not "host copy" command. Not in sqlpus, not in em.
    What you are doing in sqlplus is the sqlplus command "host". That is a sqlplus command, documented in the SQLPlus Reference. The sqlplus command "host" takes an argument of an os command (in your case, the OS command is "copy") and creates a sub-process to ask the os to execute that command.
    I can't even imagine what you are referring to when you say "when i configure host copy command inside em console". Can you explain in more detail?

  • How to run an executable from command-line

    I'm learning how to use the Terminal and I got stuck in a silly thing (I suppose it is). How can I run an executable file from command-line in Terminal?
    For example: I have a file named "Hello" in the folder /sample. If I use the ls command (ls sample), I can see the file Hello. Then I move to the directory (cd /sample) and try to run the file Hello (typing "Hello") but I got "command not found" message.
    If I drag the Hello file from Finder to Terminal and hit Return, it runs perfectly. And if I type the full path to the file (even if I'm already inside its directory), it also runs.
    So, my doubt is if there is any command to run an executable from command-line.
    Thanks

    KJK555 wrote:
    Hi VK:
    Can you enlighten me on why it's neccessary to do the "./" thingy in OS X when in unix/linux
    I never had to resort to doing that?
    Kj
    I took the trouble of reading *man bash* and it explains the issue. to add the current directory to PATH you need to add an empty path to PATH like this
    PATH=$PATH::
    you can add it to ~/.bash_profile so that it's executed automatically when you start bash. I suspect the linux system you are talking about had this set up by default or had it added to PATH in /etc/profile which defines PATH globally.

  • Executing unix statements inside java

    How do you execute unix statements inside a java program? I need to execute a unix executable shell_prog.ksh from inside a java program.

    By the way, executing the "ls" command from within Java will not do anything unless you capture the output stream of the process running the "ls" command and display it:
    try
    Process p = Runtime.getRuntime.exec("ls");
    BufferedReader read = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line = null;
    while( (line = read.readLine()) != null)
    System.out.println("OUT>>>" + line);
    catch(IOException ioe)
    ioe.printStackTrace(System.err);
    System.exit(1);
    }

  • How to execute  make  Command?

      Run in the terminal inside the  make command,prompt:"-bash:make:command not found"  My system version is Mac OS X 10.7.3 Xcode Version is 4.3.
      How to execute  make  Command?
                                    thanks!!

    I switch to / usr / bin directory also did not find the make  only to find a makeinfo. Google to find relevant information, if installed Xcode will be able to run make, but now does not work.
    But still thank you very

  • CAN USE COPY COMMAND INSIDE PROCEDURE BODY

    Hi all
    can we use COPY command inside procedure body like this
    CREATE OR REPLACE procedure USER2.PRO1
    Begin
    execute immediate'copy from hr/hr@ERP to USER21/PASS@DB1 append user2.per_images using select * from hr.per_images';
    commit;
    end;
    YOU ADVICE PLEASE

    My advice is to check the manual.
    SQL*Plus COPY command
    http://download.oracle.com/docs/cd/B28359_01/server.111/b31189/ch12016.htm#i2675035
    SQL manual index
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/index.htm
    PL/SQL manual index
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/index.htm
    CTRL-F on the last two for COPY and it appears not.

  • Executing compound commands

    Hi,
    I have a setup project in MSVS2005 that installs my application. At the beginning it creates new tablespace, temporary tablespace, then - user. Then, it should grant some privileges to the newly created user.
    All the command texts are stored in embedded resources (text files).
    The following is the contents of file storing commandGrantPrivilegesToUser.CommandText.
    <file_begin>
    GRANT CREATE SESSION TO $USER_NAME$
    GRANT SELECT ANY TABLE TO $USER_NAME$
    GRANT UNLIMITED TABLESPACE TO $USER_NAME$
    <file_end>
    When executed, the command throws
    ORA-00933: SQL command not properly ended
    I am not sure if I can call a command that in fact compounds of several commands like above. If so, then how should I separate these commands.
    Best regards
    Mans

    Hi,
    To execute multiple statements at once, you'd need to enclose them in an anonymous block.
    To execute DDL inside a procedure, you'd need to execute it via Execute Immediate.
    To execute multiple DDL at once, you'd need to use execute immediate inside an anonymous block.
    Here's an example, hope it helps.
    Cheers,
    Greg
    begin execute immediate 'create user foo identified by bar'; execute immediate 'grant connect, resource to foo'; execute immediate 'grant create synonym to foo'; end;

  • Executing shell commands from Java.

    I want to execute shell commands in Java using the Runtime.exec( String ) method.
    The method works fine under Linux OS, but under Windows '98 the method didn't work at all!
    For example the following call: Runtime.exec( "dir" ) throws an exception showing that the command was not completed. If I replace dir with ls under Linux all is good. What is the problem with the Microsoft Windows '98 ? Is there any solution at my problem ?!
    thx in advance!

    hey JSarmis,
    You can help me... "ls" doesn't work for me on linux.. using Runtime.exec, some commands work, others don't... you may hold the key to what i need? How did u get "ls" to work?

  • How to Execute shell commands in OSB

    Team,
    My Requirement:
    I have two sftp servers name ServerA and ServerB. Need to copy files from ServerA and place it on ServerB and change the file permissions to 777 after placing the files.
    The user i am connecting to ServerB has the access to override file permissions.
    Steps
    1. With help of FTP adapter in OSB I am reading files from ServerA and writing on to ServerB  -- Completed and is working.
    2. How to override file permissions after placing the file ????? -- Yet to implement.
    Please suggest me how can i accomodate 2nd step.
    Thanks,
    Suman V.

    If by "execute shell commands" you mean actually
    running a shell process (as opposed to just forking
    and executing specified programs) then I'd advise
    against it. The last thing you want is for the
    clients to be running arbitrary commands on the
    server. You don't want to make it possible for the
    client to run "rm -fr /" on your server.Right.
    I was assuming (perhaps with more optimism than is really warranted) that the OP was going to be in complete control of which commands were executed--that there'd be a small, fixed set in response to certain user actions.

Maybe you are looking for

  • How to i get my old contacts back into my iphone

    when i synced my iphone it erased sll my old contacts how doi i get them back

  • Re: problems creating spatial index !!!!

    hi! Guys , I am running Oracle 9.0.1.1.1 on windows 2000 professional. I am creating a spatial index on a table column. When i try to create it from sqlplus command prompt .. it errors out END OF FILE ON COMMUNICATION CHANNEL .. It was suggested to b

  • Instrumentation/Automation Engineer needed for company based in Fort Lauderdale, FL

    The Instrumentation Automation Enginner will work with the electrical motor control, variable frequency drives(VFD's), sensors, Programmable Logic Controllers (PLC's), robotics, temperature, pressure, level, and flow devices, PID loops, human machine

  • How to display StorageTek configuration ?

    On Sun StorageTek 3510 it is easy to display all configuration with below command: sccli> show configuration Is there something "simillar" that can print out configuration for StorageTek 6140 ? I can be anything: txt, html, xml. Something I can past

  • Firefox 8 doesn't start in Fedora 12

    Downloaded firefox-8.0.tar.bz2 from getfirefox.com, unpacked, but Firefox 8.0 doesn't start: [root@seb4 firefox]# ./firefox XPCOMGlueLoad error for file /opt/firefox/libxpcom.so: libxul.so: cannot open shared object file: No such file or directory Co