Skip to main content
 首页 » 编程设计

python之Mesos之Zookeeper 错误;连接被拒绝

2024年01月24日50zhoujg

我已在虚拟机上设置了 Apache Mesos 0.21.2。安装是通过下载源代码、编译并应用 make install 来执行的。

在另一台虚拟机上,我复制了构建目录,以便将其用作从属系统。

我想从一个小的“hello world”框架开始,如 http://jamesporter.me/2014/11/15/hello-mesos.html 所示。

但是,当我使用以下命令执行 python 框架时 python hello_mesos.py

我得到以下日志:

I1227 19:16:02.790803  1678 sched.cpp:137] Version: 0.21.1 
2015-12-27 19:16:02,790:1678(0x7f6b1e3de700):ZOO_INFO@log_env@712: Client       
environment:zookeeper.version=zookeeper C client 3.4.5 
... 
2015-12-27  
19:17:09,526:1678(0x7f6b1bf7e700):ZOO_ERROR@handle_socket_error_msg@1697:  
Socket [127.0.0.1:2181] zk retcode=-4, errno=111(Connection refused): server    
refused to accept the client 

触发此错误的原因是什么?还有其他方法可以获取更多信息吗?

预先感谢您的任何提示和 致以诚挚的问候

请您参考如下方法:

我建议您使用最新的 Mesos 版本,0.21.2 已经很旧了,因为 0.26.0 已经过时了。还有可用的预编译包。

关于您的实际问题,似乎是

  • ZooKeeper 未在您尝试执行框架的主机上启动
  • 如果您尝试从其他主机访问 ZK,则需要设置实际 IP