PLEASE READ Andrey Guide FIRST!!!
- Run
ssh-keygen -t rsa
- Enter filename for key(eg. )
- Leave password emtpy
- Run
scp <USER>.pub <USER>@<EXTERNAL_IP_OF_FIRST_INSANCE>:/home/<USER>/.ssh
- Add it to
authorized_keys
. To do this runcat .ssh/<USER>.pub >> .ssh/authorized_keys
To do this try to SSH into machine ssh -i <USER> <USER>@<EXTERNAL_IP_OF_FIRST_INSANCE>
.
You should be greated with welcome message.
- Create snapshot based on the instance-1
- Create instance-2 based on the snapshot.
- Run
ssh -i <USER> <USER>@<EXTERNAL_IP_OF_SECOND_INSTANCE>
- You should see welcome message.
We need this to be able to run mpirun
on the instance-1.
- Run
scp <USER> <USER>@<EXTERNAL_IP_OF_FIRST_INSANCE>:/home/<USER>/.ssh
- Rename key to
id_rsa
. Runmv .ssh/<USER> .ssh/id_rsa
. - To verify that everything works run
ssh <INTERNAL_IP_OF_SECOND_INSTANCE>
. - You should see welcome message.
We need to provide IP addresses to MPI.
- Create
hostfile
on instance-1. Runtouch hostfile
. - Run
echo <INTERNAL_IP_OF_THE_INSTANCE> >> hostfile
for each machine in the cluster.
Now you can run your program on the cluster.
mpirun -n <NUMBER_OF_PROCESSES> --hostfile hostfile ./<APPLICATION>