Use
ssh deploy@hera 'kill -9 `ps -ef | grep MapReduceNode | grep -v "grep" | awk -F " " '"'"'{print $2}'"'"' | head -n 1`'
Explanation:
ssh deploy@hera 'kill -9 `ps -ef | grep MapReduceNode | grep -v "grep" | awk -F " " '"'"'{print $2}'"'"' | head -n 1`'
> 1 <>2<> 3 <>4<> 5 <
1) First string with beginning of command: 'kill -9 `ps -ef | grep MapReduceNode | grep -v "grep" | awk -F " " '
2) Second string with only a single ' char: "'"
3) Third string with the print command: '{print $2}'
4) Fourth string with another single quote: "'"
5) Fifth string with rest of command: ' | head -n 1`'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…