最初のJenkinsスレーブをセットアップしました。ビルドを実行しましたが、SSHキーで問題が発生しました。マスターJenkinsサーバーはユーザー「jenkins」で実行されています。パスワードなしでマスターからスレーブにSSHで接続できるようにSSHキーを設定しました。
例:マスターから:
jenkins@master:~$ ssh slave
Last login: Tue Apr 17 10:30:22 2012 from masterjenkins.com
$ whoami
jenkins
つまり、スレーブノードも「jenkins」ユーザーの下で実行されていることがわかります。(公開sshキーをjenkins @ slaveからリモートgitサーバーにコピーしました)。また、スレーブから手動でgit cloneを発行することはできますが、マスターからビルドを開始すると、次のようなメッセージが表示されます。
ERROR: Error cloning remote repo 'origin' : Could not clone git@host:abc
hudson.plugins.git.GitException: Could not clone git@host:abc
Caused by: hudson.plugins.git.GitException: Error performing command: git clone --progress -o origin git@host:abc /var/lib/jenkins/workspace/abc_build
Command "git clone --progress -o origin git@host:abc /var/lib/jenkins/workspace/abc_build" returned status code 128: Initialized empty Git repository in /var/lib/jenkins/workspace/abc_build/.git/
Host key verification failed.
fatal: The remote end hung up unexpectedly
Caused by: hudson.plugins.git.GitException: Command "git clone --progress -o origin git@host:abc /var/lib/jenkins/workspace/abc_build" returned status code 128: Initialized empty Git repository in /var/lib/jenkins/workspace/abc_build/.git/
Host key verification failed.
fatal: The remote end hung up unexpectedly
Trying next repository
ERROR: Could not clone repository
FATAL: Could not clone
そのため、SSHキーが正しく設定されていないことを示唆しています。どこにコピーする必要があるキーを教えてもらえますか?
どうもありがとう、 ns