LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 02-23-2013, 07:11 AM   #1
jayeshsharma52
Member
 
Registered: Jul 2012
Posts: 54

Rep: Reputation: Disabled
Problem forming clustur of laptops via router. (MPI)


I am trying to form a cluster of two laptops connected through router, I have assigned static ips to both the laptops.
-I have generated key using "ssh-keygen -t rsa"
-copied "**_rsa.pub to "authorized keys"
-compiled mpi_hello.c with mpicc
-but when i give "mpiexec -n 8 -f /home/mpiuse/machinefile ./mpi_hello" command it gives me error saying---
"ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
Host key verification failed"
I followed steps given in this link.
Please suggest me how to move ahead.
Thanks
 
Old 02-23-2013, 07:54 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Thake a look at this article: http://www.linuxjournal.com/article/6602 (11 SSH Tricks), might prove interesting.

What you probably want to do to generate keys is execute ssh_keygen and, when prompted for the passphrase, simply hit the enter key. Do this separately on each machine.

Copy the id_rsa.pub on machine "A" to a file in /.ssh nemed "A" (really, use the actual system name). Do the same thing, individually, on the other system(s), copying the id_rsa.pub file to the name of that machine in the ~/.ssh directory.

Now you're ready to -- on machine A -- get the file(s) from the other machine(s). Use scp to do that; you copy the "B" file (which is the public key for "B") to ~/.ssh, then append that file to ~/.ssh/authorized_keys (you can append a file easily with cat filename >> authorized_keys). Repeat that for any additional machines.

Then get on machine "B" and do the above, getting the public key file from "A."

Once that's complete, you'll be able to ssh, scp, sftp, etc. between the machines without a password, relying on the public-private keys your generated.

Hope this helps some.
 
Old 02-23-2013, 08:55 AM   #3
jayeshsharma52
Member
 
Registered: Jul 2012
Posts: 54

Original Poster
Rep: Reputation: Disabled
Steps followed by me.

I have followed exactly same steps on bothe machines(node1 and node0)
-steps followed.
-ssh-keygen -t rsa
-cd .ssh
-cat id_rsa.pub >> authorized_keys
-mpicc mpi_hello.c -o mpi_hell
-mpiexec -n 8 -f /home/mpiuse/machinefile ./mpi_hello
---------------------------------------------------------------
my "machinefile" looks like:
---------------------------
node1:2 #node1 is remote machine
node0:2 #node0 is master machine
-----------------------
 
Old 02-23-2013, 10:10 AM   #4
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
You're not coping the public key file on the machine it is generated on into authorized_keys are you? If you are, that's the wrong place to put it -- it goes on the other machines you want to connect to without a password (and the public key file form those machines goes in this machine's authorized_keys file.

Here's a an example. Let's say that I have two machines, fubar and snafu and I want them to connect without a password in both directions.

If you've goofed up your .ssh directories, you can simply rm -rf .ssh and start again.

On fubar
Code:
log in as user_name
ssh-keygen
<enter key twice when prompted for a password>
cd .ssh
cp id_rsa.pub fubar
On sanfu
Code:
log in as user name
ssh-keygen
<enter key twice when prompted for a passphrase>
cd .ssh
cp id_rsa.pub snafu
scp fubar:/home/user_name/.ssh/fubar .
cat fubar >> authorized_keys
On fubar
Code:
log in as user_name
cd .ssh
scp snafu:/home/user_name.ssh/snafu .
cat snafu >> authorized_keys
That's how to do that; you're allowing an external machine to log in in this machine without a password by having its public key on this machine in authorized_keys.

Hope this helps some.
 
Old 02-24-2013, 07:15 AM   #5
jayeshsharma52
Member
 
Registered: Jul 2012
Posts: 54

Original Poster
Rep: Reputation: Disabled
I am very thankful for your suggestions as your advice does help me a lot ,and now I am able to connect to other machine directly without password.
But now I am facing some other problem.
As I want to run application on two machines so when I tries -"mpiexec -n 8 -f /home/mpiuse/machinefile ./mpi_hello" terminal simply hangs waiting.
And trying some brute force I figured out that when I remove commented line which is in "vim /etc/hosts" :
#127.1.1.0 jayesh (my name is "jayesh")(on removing comment)
The command "mpiexec -n 8 -f /home/mpiuse/machinefile ./mpi_hello" runs 4 processes and gives error for :unable to run other 4 process
(only 4 processes are running because of define node0:2 means 2 process on node0 and other two on node1- node1:2).
If possible please help providing a right track.
Thanks for showing interest in my case.
 
Old 02-24-2013, 10:19 AM   #6
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
I'm not real sure about this, but the manual page for mpiexec state:
Quote:
If you are simply looking for how to run an MPI application, you probably want to
use a command line of the following form:

% mpirun [ -np X ] [ --hostfile <filename> ] <program>

This will run X copies of <program> in your current run-time environment (if run-
ning under a supported resource manager, Open MPI's mpirun will usually automati-
cally use the corresponding resource manager process starter, as opposed to, for
example, rsh or ssh, which require the use of a hostfile, or will default to run-
ning all X copies on the localhost), scheduling (by default) in a round-robin fash-
ion by CPU slot. See the rest of this page for more details.
Which looks to me like you would be running "all X copies on the localhost;" i.e., not a remote host? Again, not sure about that (don't know about mpiexec), but it seems like that might be the case and that you more likely want to use ssh to execute a command on a remote host.

Hope this helps some.
 
Old 02-24-2013, 10:32 AM   #7
jayeshsharma52
Member
 
Registered: Jul 2012
Posts: 54

Original Poster
Rep: Reputation: Disabled
Yeah, for local host this command is working perfectcly but when I am trying to merge it with ssh its giving some above dictated errors.
Thanks
 
Old 03-19-2014, 02:38 AM   #8
shivalig
LQ Newbie
 
Registered: Mar 2014
Posts: 1

Rep: Reputation: Disabled
Thanks a lot solution worked for me
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MPI programs freeze when accessing MPI shared file on Scientific Linux 6 Pizzicato Linux - Software 0 08-29-2012 07:41 AM
MPI vs LAM/MPI vs OpenMPI vs MPICH2 manojg Linux - General 0 11-28-2010 12:37 PM
lamboot problem in LAM/MPI Abhishek Agarwal Linux - General 2 11-07-2006 02:40 AM
lamboot problem in LAM/MPI Abhishek Agarwal Linux - Newbie 1 11-06-2006 08:03 AM
Problem with MPI in Redhat 9 longredhat Programming 0 04-20-2005 01:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 11:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration