我創建了一個連接到Phoenix HBase的python腳本來分析一些數據。我想在我運行的Ubuntu服務器上的crontab上設置這個腳本。Ubuntu(或Windows)上的python和phoenixdb。如何?
該腳本完全能夠在我的Windows 10機器上運行。但是當我嘗試在Ubuntu上使用phoenixdb連接器時,RunTime上出現錯誤。
>>> 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上運行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版本 - 我開發腳本的那個版本)。
我真的失去了尋找解決辦法..