A memo connected to HiveServer2 of EMR with python

Tried environment

hiveServe2 With AMI 3.3.1, it is started as soon as the cluster is ready.

$ ps -ef | grep hiveserver2
hadoop   27009   539  0 02:03 pts/9    00:00:00 grep hiveserver2
root     31866     1  0 Dec08 pts/1    00:00:00 su - hadoop -c bash -c /home/hadoop/hive/bin/hive --service hiveserver2

That's why it's running.

You can easily start and stop it because a script is prepared.

#Start-up
$ sudo /etc/init.d/hive-serverd start
#End
$ sudo /etc/init.d/hive-serverd stop

The log is in *** / mnt / var / log / hive-serve ***, so check it for the time being.

Install and connect pyhs2

The HiveServer2 client for python has pyhs2, It's easy to install with pip, so I'll give it a try.

$ sudo pip install pyhs2

It's ok, so install this one before running it.

$ sudo yum install cyrus-sasl-devel.x86_64

You should be able to enter safely with this.

But this pip is / usr / bin / python2.7 It is used here / usr / bin / python Not here. This may have been added during Hue installation.

After that, borrow sample You can connect by rewriting user and password to ** hive **.

Recommended Posts

A memo connected to HiveServer2 of EMR with python
[Python] A memo to write CSV vertically with Pandas
A collection of competitive pro techniques to solve with Python
How to develop in a virtual environment of Python [Memo]
A memo of misunderstanding when trying to load the entire self-made module with Python3
Convert memo at once with Python 2to3
Memo to ask for KPI with python
[Python] A memo that I tried to get started with asyncio
A memo with Python2.7 and Python3 on CentOS
[Python] A memo to operate ROM created by GBDK with PyBoy
I tried to create a list of prime numbers with python
A memo that allows you to change Pineapple's Python environment with pyenv
[Introduction to Python] How to sort the contents of a list efficiently with list sort
A memo corresponding to Django's runserver moss in Python 2.7.11 entered with Homebrew
A beginner of machine learning tried to predict Arima Kinen with python
Try to solve a set problem of high school math with Python
[AtCoder] Solve A problem of ABC101 ~ 169 with Python
How to read a CSV file with Python 2/3
Send a message to LINE with Python (LINE Notify)
Try to draw a life curve with python
I want to make a game with Python
Try to make a "cryptanalysis" cipher with Python
Solve A ~ D of yuki coder 247 with python
How to specify attributes with Mock of python
Decide to assign a laboratory with Python (fiction)
A memo when creating a python environment with miniconda
Steps to create a Twitter bot with python
Try to make a dihedral group with Python
I want to write to a file with Python
A layman wants to get started with Python
I tried to make a simple mail sending application with tkinter of Python
How to get a list of files in the same directory with python
[Introduction to Python] How to get the index of data with a for statement
How to convert / restore a string with [] in python
Memo to create your own Box with Pepper's Python
A memo of how to use AIST supercomputer ABCI
[Python] How to draw a line graph with Matplotlib
Recommendation of building a portable Python environment with conda
A memo to visually understand the axis of pandas.Panel
Try to make a command standby tool with python
Python Ver. To introduce WebPay with a little code.
I tried to draw a route map with Python
Change IP settings to ACL of conoha with python
[Chapter 5] Introduction to Python with 100 knocks of language processing
How to write a list / dictionary type of Python3
Introduction to Mathematics Starting with Python Study Memo Vol.1
I want to work with a robot in python.
From buying a computer to running a program with python
[Chapter 3] Introduction to Python with 100 knocks of language processing
I tried to automatically generate a password with Python3
Python + selenium to GW a lot of e-mail addresses
[Chapter 2] Introduction to Python with 100 knocks of language processing
A program to write Lattice Hinge with Rhinoceros with Python
A memo that I touched the Datastore with python
A memo about building a Django (Python) application with Docker
[Python] How to create a 2D histogram with Matplotlib
A python regular expression, or a memo of a match object
I want to run a quantum computer with Python
[Python] How to draw a scatter plot with Matplotlib
Memo of "Cython-Speeding up Python by fusing with C"
[Python] Road to a snake charmer (5) Play with Matplotlib