Skip to content

Instantly share code, notes, and snippets.

@sean-smith
Last active July 12, 2019 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sean-smith/e1cd3a59d634e8b4975844eeeecd4caa to your computer and use it in GitHub Desktop.
Save sean-smith/e1cd3a59d634e8b4975844eeeecd4caa to your computer and use it in GitHub Desktop.

Seperate Submit Node

Setup keys on the Submit Host

$ ssh centos@3.209.41.48
$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC747i1LltXnYkTTdXw4/qjuSxZS+zgg/kYgTrwdyejgTQPyjKfN0/2HudIdt83C2ZeTKqW1DU16HShKwPFCY8KUHtSgLaw7q4QV1grPMCAX7lZhIja0+pEsrt/30ME5ps51EqSmN4sAk1Jl9FaOi8YVZkuV++8gBwTKe2PKLFQ709HVP4yzJdx2epiJsENszqdTMkcjX4dr11X4C+lZsOxt7kRlH8GZ2CHAG3UGsgFf5sArClhqXMFwGiSCDIpIpL70EsY5u2Dpaj9Tb9lge4RSHzdjn6Ro1++4hBdHSj5FhrdC5cmemts3MMmS752hfU8oHWGdg3ZeMRJEq4ICIJb centos@ip-10-6-0-241.ec2.internal 

Copy that key to the master node of the cluster:

pcluster ssh [cluster]
vim ~/.ssh/authorized_keys
# add key to the bottom

Then setup aliases on the master node, changing the ip and username based on the output of pcluster ssh [cluster] -d:

echo "
# link submit node to master
alias qhost='ssh -i ~/.ssh/id_rsa ec2-user@3.210.138.67 qhost'
alias qrsh='ssh -i ~/.ssh/id_rsa ec2-user@3.210.138.67 qrsh'
alias qstat='ssh -i ~/.ssh/id_rsa ec2-user@3.210.138.67 qstat'
" >> ~/.bashrc
source ~/.bashrc

Warning this won't work for qsub unless the file you're submitting is also on the master instance. You'd need to setup a shared drive and then qsub, for example if /home was shared, then qsub $(pwd)/submit_script.sh from the home directory would work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment