Home > other >  The Java connection SSH and execute commands about command some cannot execute
The Java connection SSH and execute commands about command some cannot execute

Time:11-26

 String ret=SSH. ExecCommand (" PWD "); 

 String ret=SSH. ExecCommand (" mkdir/spark/output "); 

Specific means I will not stick out, these two words are able to carry out
But now I want to perform on the spark - submit time cannot perform
 String CMD="spark - submit - master spark://master: 7077 - class cn mastercom. Word. JavaWordCount - executor - memory 1 g/home/hmaster/spark/JavaWordCount jar" 
+ "HDFS://192.168.64.31:8888/filtertest/aa" + "" +" HDFS://192.168.64.31:8888/filtertest/out1550 ";

 String ret=SSH. ExecCommand (CMD); 

Does not perform this sentence at this time, but if I'm in command line, enter this sentence is executed, why ah, o master, what should I do with this command

CodePudding user response:

Solution: before the command to add the source/etc/profile; My CMD is "source/etc/profile;/home/spark - 3.0.0 - bin - hadoop3.2/bin/spark - submit - class testWoreCount - master spark://10.137.5.200:7077/opt/LLM/demo/demo jar/opt/LLM/demo/SDK. The log"
  • Related