![尝试安装 datastax opscenter - 无法加载应用程序:无法导入名称 _parse](https://linux22.com/image/619868/%E5%B0%9D%E8%AF%95%E5%AE%89%E8%A3%85%20datastax%20opscenter%20-%20%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%EF%BC%9A%E6%97%A0%E6%B3%95%E5%AF%BC%E5%85%A5%E5%90%8D%E7%A7%B0%20_parse.png)
我不熟悉 python,也许有人可以解释一下这里发生了什么?
ec2-user@prod-opscenter-01:~ % java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
ec2-user@prod-opscenter-01:~ % python -V
Python 2.6.8
ec2-user@prod-opscenter-01:~ % openssl version
OpenSSL 1.0.1e-fips 11 Feb 2013
现在错误
ec2-user@prod-opscenter-01:~ % sudo /etc/init.d/opscenterd start
Starting Cassandra cluster manager opscenterd
Starting opscenterdUnhandled Error
Traceback (most recent call last):
File "/usr/lib64/python2.6/site-packages/twisted/application/app.py", line 652, in run
runApp(config)
File "/usr/lib64/python2.6/site-packages/twisted/scripts/twistd.py", line 23, in runApp
_SomeApplicationRunner(config).run()
File "/usr/lib64/python2.6/site-packages/twisted/application/app.py", line 386, in run
self.application = self.createOrGetApplication()
File "/usr/lib64/python2.6/site-packages/twisted/application/app.py", line 451, in createOrGetApplication
application = getApplication(self.config, passphrase)
--- <exception caught here> ---
File "/usr/lib64/python2.6/site-packages/twisted/application/app.py", line 462, in getApplication
application = service.loadApplication(filename, style, passphrase)
File "/usr/lib64/python2.6/site-packages/twisted/application/service.py", line 405, in loadApplication
application = sob.loadValueFromFile(filename, 'application', passphrase)
File "/usr/lib64/python2.6/site-packages/twisted/persisted/sob.py", line 210, in loadValueFromFile
exec fileObj in d, d
File "bin/start_opscenter.py", line 1, in <module>
from opscenterd import opscenterd_tap
File "/usr/lib/python2.6/site-packages/opscenterd/opscenterd_tap.py", line 37, in <module>
File "/usr/lib/python2.6/site-packages/opscenterd/OpsCenterdService.py", line 13, in <module>
File "/usr/lib/python2.6/site-packages/opscenterd/ClusterServices.py", line 22, in <module>
File "/usr/lib/python2.6/site-packages/opscenterd/WebServer.py", line 40, in <module>
File "/usr/lib/python2.6/site-packages/opscenterd/Agents.py", line 18, in <module>
exceptions.ImportError: cannot import name _parse
Failed to load application: cannot import name _parse
也许我应该看看监控 Cassandra 的开源替代品?
多谢
答案1
导致错误的行是from twisted.web.client import Agent, _parse
。OpsCenter 将 twisted 版本与其发行版捆绑在一起,以确保正确的兼容性。听起来您在正在使用的系统上安装了不兼容的 twisted 版本。
编辑:Amazon Linux AMI 存在一个已知问题。在 /user/share/opscenter/bin/opscenter 中,在 export PYTHONPATH=... 之前添加以下行:PY_DISTRO="./lib/py-redhat/${PY_VER}/shared/${PY_ARCH}:./lib/py-redhat/${PY_VER}/6/${PY_ARCH}"
我们必须研究如何在 OpsCenter 内部更好地处理这个问题,但与此同时,删除第三方安装的 twisted,虽然不太优雅,但肯定能让你启动并运行。
确定是否安装了扭曲或安装了在哪里: python -c "import twisted; print twisted"