Hive를 이용할 수 있는 방법은 많다. 기본 hive shell 에 들어가도 되고, JDBC driver 를 이용해서 SQL Client 도구들을 이용할 수도 있다. (Workbench, Datagrip 등)
- MySQL Workbench 와는 다른 것
실습에서 사용하는 hive server 버전은 Hive 3.1.3-amzn-1
이다.
실습에서는 EMR Primary node에서 hive beeline shell을 이용한다.
EMR primary node 에 접속해서 hive 명령어를 치면 hive shell로 접속할 수 있다.
hive shell 은 old version 이므로 권장하지 않는다.
새로운 버전의 hive shell 이다. EMR Primary node 에서 다음 명령어로 접속할 수 있다.
beeline -u jdbc:hive2://localhost:10000/default -n hive
-n
으로 username을 준다.-p
옵션으로 준다.-n
hdfs 유저로 접근하면 hive 로 모든경로에 read/write 가 가능하다.포트가 10000 이므로 port forwarding 을 한다면 local에서도 접속할 수 있다.
beeline -u jdbc:hive2://localhost:10000/default -n hadoop@ec2-xxx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com -d org.apache.hive.jdbc.HiveDriver
workbench 는 무료 도구이다. EMR을 workbench 로 이용하기 가이드