Jepsen:SSH问题 [英] Jepsen : SSH issue

查看:100
本文介绍了Jepsen:SSH问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行Jepsen( https://github.com/jepsen-io/jepsen ).我已经创建了6个虚拟机(在Windows 10 pc上),并用n1,n2,.... n6替换了主机名.所有虚拟机的用户名和密码都相同.

I am trying to run the Jepsen (https://github.com/jepsen-io/jepsen) on Ubuntu 16.04. I have created 6 virtual machines (on my windows 10 pc) and replaced the host name by n1, n2, .... n6. The user name and password is same for all VMs.

现在,我可以从任何虚拟机直接SSH到任何其他虚拟机. (例如,从n6起,我可以仅执行该命令"ssh n1",并且它可以毫无问题地工作).我正在尝试从节点6(主机名n6)运行节点jepsen工具,以便它可以在节点n1,n2,n3,n4和n5中创建数据库.

Now, from any VM, I can directly ssh to any other VM. ( For example, from n6, I can just execute this command "ssh n1" and it works without any problem). I am trying to run the node jepsen tool from node 6 ( hostname n6 ) so that it can create the db in node n1,n2,n3,n4 and n5.

到目前为止,我尚未对jepsen代码进行任何更改.我已经使用"lein install"编译了它.命令,现在尝试运行它.

So far I have not made any changes in the jepsen code. I have compiled it using "lein install" command and now trying to run it.

为了简单地运行测试,我遵循了jepsen网页上提供的说明("cd aerospike";"lein test"),但这给了我以下错误:

To simply run the test, I followed the instruction provided in the jepsen's webpage ( "cd aerospike"; "lein test" ) But it is giving me the following error:

user@Ubuntu6:~/Desktop/jepsen_cassandra/aerospike$ lein test

lein test aerospike.core-test
jepsen.generator$concat$reify__7285@577dac16>

lein test :only aerospike.core-test/counter

ERROR in (counter) (Session.java:781)
Uncaught exception, not in assertion.
expected: nil
actual: com.jcraft.jsch.JSchException: reject HostKey: n1 at com.jcraft.jsch.Session.checkHost (Session.java:781)
com.jcraft.jsch.Session.connect (Session.java:342)
com.jcraft.jsch.Session.connect (Session.java:183)
clj_ssh.ssh$eval6796$fn__6803.invoke (ssh.clj:118)
clj_ssh.ssh.protocols$eval6722$fn__6745$G__6713__6754.invoke (protocols.clj:4)
clj_ssh.ssh$connect.invoke (ssh.clj:401)
jepsen.control$session.invoke (control.clj:197)
clojure.lang.AFn.applyToHelper (AFn.java:154)
clojure.lang.AFn.applyTo (AFn.java:144)
clojure.core$apply.invoke (core.clj:624)
clojure.core$with_bindings_STAR_.doInvoke (core.clj:1862)
clojure.lang.RestFn.applyTo (RestFn.java:142)
clojure.core$apply.invoke (core.clj:628)
clojure.core$bound_fn_STAR_$fn__4140.doInvoke (core.clj:1884)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invoke (core.clj:624)
jepsen.core$fcatch$wrapper__8355.doInvoke (core.clj:55)
clojure.lang.RestFn.invoke (RestFn.java:408)
clojure.core$pmap$fn__6328$fn__6329.invoke (core.clj:6466)
clojure.core$binding_conveyor_fn$fn__4145.invoke (core.clj:1910)
clojure.lang.AFn.call (AFn.java:18)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:748)
jepsen.generator$concat$reify__7285@254210b1>

lein test :only aerospike.core-test/cas-register

ERROR in (cas-register) (Session.java:781)
Uncaught exception, not in assertion.
expected: nil
actual: com.jcraft.jsch.JSchException: reject HostKey: n1
at com.jcraft.jsch.Session.checkHost (Session.java:781)
com.jcraft.jsch.Session.connect (Session.java:342)
com.jcraft.jsch.Session.connect (Session.java:183)
clj_ssh.ssh$eval6796$fn__6803.invoke (ssh.clj:118)
clj_ssh.ssh.protocols$eval6722$fn__6745$G__6713__6754.invoke (protocols.clj:4)
clj_ssh.ssh$connect.invoke (ssh.clj:401)
jepsen.control$session.invoke (control.clj:197)
clojure.lang.AFn.applyToHelper (AFn.java:154)
clojure.lang.AFn.applyTo (AFn.java:144)
clojure.core$apply.invoke (core.clj:624)
clojure.core$with_bindings_STAR_.doInvoke (core.clj:1862)
clojure.lang.RestFn.applyTo (RestFn.java:142)
clojure.core$apply.invoke (core.clj:628)
clojure.core$bound_fn_STAR_$fn__4140.doInvoke (core.clj:1884)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invoke (core.clj:624)
jepsen.core$fcatch$wrapper__8355.doInvoke (core.clj:55)
clojure.lang.RestFn.invoke (RestFn.java:408)
clojure.core$pmap$fn__6328$fn__6329.invoke (core.clj:6466)
clojure.core$binding_conveyor_fn$fn__4145.invoke (core.clj:1910)
clojure.lang.AFn.call (AFn.java:18)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:748)

Ran 2 tests containing 2 assertions.
0 failures, 2 errors.
Tests failed.

首先,我尝试按原样运行代码.但是后来我在(

First I tried to run the code as it is. But later I have added the username and password of the 5 VMs ( that is required to ssh ) in Line 21 and 22 of ( https://github.com/jepsen-io/jepsen/blob/master/jepsen/src/jepsen/control.clj ). But it did not solve the problem.

对于解决此问题的任何解决方案/指南,我将深表感谢.

I will highly appreciate any solution/guideline to solve this problem.

推荐答案

此行

actual: com.jcraft.jsch.JSchException: reject HostKey: n1 at com.jcraft.jsch.Session.checkHost

表示启动ssh连接的系统不愿意信任其连接到的计算机的身份.因此,密码/密钥不允许您进入不是问题,相反,启动连接的系统不确定所连接系统的身份.

indicates that the system initiating the ssh connection is unwilling to trust the identity of the computer it's connecting to. So it's not a problem with passwords/keys not allowing you in, rather it's the opposite, the system starting the connection is not sure of the identity of the system it's connecting to.

最常见的原因是,您过去以相同的IP或主机名连接到系统,此系统已被该系统替换. SSH保证,如果不同的计算机响应相同的名称,它将触发警报并且不连接,而不冒中间人攻击的风险.当真正更换系统时,这会导致误报.

The most common cause is that you have connected to a system in the past at the same IP or hostname which has since been replaced with this system. SSH guarantees that if a different computer responds to the same name, it will set off the alarms and not connect rather than risk a man-in-the-middle attack. This results in false positives when a system really has been replaced.

尝试从该系统向目标主机sshing,并确保它可以正常工作. 如果不是,请尝试从~/.ssh/known_hosts中删除该系统的IP. 还应考虑~/.ssh/config文件中的任何内容是否会影响此主机,可能是通过要求它具有例如特定的主机密钥来实现的

Try sshing from this system to the target host and make sure it work. if not try removing that system's IP from ~/.ssh/known_hosts if it's there. also consider if anything in your ~/.ssh/config file would be affecting this host, perhaps by requiring it to have a specific host key for instance

因为这似乎不是主机密钥冲突,所以接下来要检查的是主机正在使用哪种主机密钥. Jsch是ssh的自己实现,它支持与openSSH不同的一组密钥.您可以通过运行确定系统的主机密钥类型

since it doesn't seem to be a host key conflict the next thing to check is what kind of host key the hosts are using. Jsch is it's own implementation of ssh that supports a different set of keys than openSSH. you can determine the system's host key type by running

ssh -vvv hostname

...
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256

然后使用google for jsch和该主机密钥算法,看看上面是否有任何未解决的问题.

then google for jsch and that host key algorithm and see if there are any open issues on it.

这篇关于Jepsen:SSH问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆