from pyhive import presto # or import hive
cursor=presto.connect(host='namenode1', port=10000, protocol='https', username='tech_user', password='passsword1').cursor()
cursor.execute('select * from base1.change_cnt limit 10')
print(cursor.fetchone())
print(cursor.fetchall())
File "C:\Software\Python36\lib\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Software\Python36\lib\site-packages\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "C:\Software\Python36\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "C:\Software\Python36\lib\site-packages\requests\adapters.py", line 506, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='namenode1', port=10000): Max retries exceeded with url: /v1/statement (Caused by SSLError(SSLError(1, '[SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:777)'),))
C:\Windows\system32>c:\software\python36\scripts\pip show sasl
Name: sasl
Version: 0.2.1
Summary: Cyrus-SASL bindings for Python
Home-page: http://github.com/toddlipcon/python-sasl
Author: Todd Lipcon
Author-email: todd@cloudera.com
License: UNKNOWN
Location: c:\software\python36\lib\site-packages
Requires: six
c:\>c:\python36\scripts\pip install c:\distr\sasl-0.2.1-cp36-cp36m-win_amd64.whl
Processing c:\distr\sasl-0.2.1-cp36-cp36m-win_amd64.whl
Requirement already satisfied: six in c:\python36\lib\site-packages (from sasl==0.2.1)
Installing collected packages: sasl
Successfully installed sasl-0.2.1
c:\>pip install c:\distr\sasl-0.2.1-cp36-cp36m-win32.whl
sasl-0.2.1-cp36-cp36m-win32.whl is not a supported wheel on this platform.
c:\>pip install c:\distr\sasl-0.2.1-cp36-cp36m-win_amd64.whl
sasl-0.2.1-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.
wb = openpyxl.load_workbook(file_path)
ws = wb.worksheets[0]
for row_data in new_row_data:
ws.append(row_data)
[hadoop@hadoop01 network-scripts]$ hdfs dfsadmin -report
17/10/17 14:06:10 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Configured Capacity: 69775908864 (64.98 GB)
Present Capacity: 65679843328 (61.17 GB)
DFS Remaining: 65679745024 (61.17 GB)
DFS Used: 98304 (96 KB)
DFS Used%: 0.00%
Under replicated blocks: 2
Blocks with corrupt replicas: 0
Missing blocks: 0
Missing blocks (with replication factor 1): 0
Pending deletion blocks: 0
-------------------------------------------------
Live datanodes (1):
Name: 192.168.0.70:50010 (hadoop01)
Hostname: hadoop01
Decommission Status : Normal
Configured Capacity: 69775908864 (64.98 GB)
DFS Used: 98304 (96 KB)
Non DFS Used: 4096065536 (3.81 GB)
DFS Remaining: 65679745024 (61.17 GB)
DFS Used%: 0.00%
DFS Remaining%: 94.13%
Configured Cache Capacity: 0 (0 B)
Cache Used: 0 (0 B)
Cache Remaining: 0 (0 B)
Cache Used%: 100.00%
Cache Remaining%: 0.00%
Xceivers: 1
Last contact: Tue Oct 17 14:06:09 MSK 2017
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
--2017-09-20 07:05:28-- https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Resolving dl.fedoraproject.org (dl.fedoraproject.org)... 209.132.181.25, 209.132.181.24, 209.132.181.23
Connecting to dl.fedoraproject.org (dl.fedoraproject.org)|209.132.181.25|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14848 (14K) [application/x-rpm]
Saving to: ‘epel-release-latest-7.noarch.rpm’
100%[=======================================================================================================================>] 14,848 79.3KB/s in 0.2s
2017-09-20 07:05:33 (79.3 KB/s) - ‘epel-release-latest-7.noarch.rpm’ saved [14848/14848]
yum localinstall epel-release-latest-7.noarch.rpm
Loaded plugins: replace, ulninfo
Examining epel-release-latest-7.noarch.rpm: epel-release-7-10.noarch
epel-release-latest-7.noarch.rpm: does not update installed package.
Nothing to do