python 和 Ubuntu(或 Windows)上的 phoenixdb。如何?

python and phoenixdb on Ubuntu (or Windows). How to?

我创建了一个 python 脚本连接到 Phoenix HBase 来分析一些数据。我想在我拥有 运行ning.

的 ubuntu 服务器上的 crontab 上设置此脚本

该脚本完全能够 运行 在我的 Windows 10 机器上。但是当我尝试在 Ubuntu 上使用 phoenixdb 连接器时,我在运行时遇到错误。

>>> import phoenixdb
>>> url = '<some-url>'
>>> conn = phoenixdb.connect(url, autocommit=True)
Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.5/site-packages/phoenixdb/avatica.py", line 156, in connect
self.connection.connect()
  File "/usr/lib/python3.5/http/client.py", line 849, in connect
(self.host,self.port), self.timeout, self.source_address)
  File "/usr/lib/python3.5/socket.py", line 711, in create_connection
raise err
  File "/usr/lib/python3.5/socket.py", line 702, in create_connection
sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/.local/lib/python3.5/site-packages/phoenixdb/__init__.py", line 63, in connect
client.connect()
  File "/home/ubuntu/.local/lib/python3.5/site-packages/phoenixdb/avatica.py", line 158, in connect
    raise errors.InterfaceError('Unable to connect to the specified service', e)
phoenixdb.errors.InterfaceError: ('Unable to connect to the specified service', TimeoutError(110, 'Connection timed out'), None, None)

我希望这里有人知道解决这个问题的方法?

我在 Windows 上 运行ning Python 3.6,在 Ubuntu 上 Python 3.5.2,但我怀疑这就是问题所在。

编辑: 我现在已经启动了一个 Windows 2012 服务器,并尝试在这里设置我的脚本,这似乎不仅仅是 Ubuntu 的问题。我在 Windows.

上收到完全相同的错误
>>> import phoenixdb
>>> url = '<some-url>'
>>> conn = phoenixdb.connect(url, autocommit=True)
Traceback (most recent call last):
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\phoenixdb\avatica.py", line 156, in connect
self.connection.connect()
  File "C:\Users\Administrator\Anaconda3\lib\http\client.py", line 936, in connect
(self.host,self.port), self.timeout, self.source_address)
  File "C:\Users\Administrator\Anaconda3\lib\socket.py", line 722, in create_connection raise err
  File "C:\Users\Administrator\Anaconda3\lib\socket.py", line 713, in create_connection
sock.connect(sa)
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\phoenixdb\__init__.py", line 63, in connect
client.connect()
  File "C:\Users\Administrator\Anaconda3\lib\site-packages\phoenixdb\avatica.py", line 158, in connect
raise errors.InterfaceError('Unable to connect to the specified service', e)

phoenixdb.errors.InterfaceError: ('Unable to connect to the specified service',
TimeoutError(10060, 'A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond', None, 10060, None), None, None)

我最近对我开发脚本的 PC 进行了格式化。他们正在使用这个 phoenixdb 连接器,我没有遇到类似的问题。

我也尝试在 Windows 机器上安装 Python 3.6(类似于我在普通 PC 上安装的 python 版本——我开发脚本的那个上)。

我真的迷失了寻找解决方案..

终于找到问题了。它与我设置脚本的机器无关。它与 Ubuntu 和 Windows 服务器的 AWS 机器上的安全设置有关。