Dockerfiles/hive/2.1.1
2018-08-06 20:35:09 +08:00
..
bootstrap.sh update hive 2018-08-06 19:07:59 +08:00
Dockerfile update hive 2018-08-06 20:35:09 +08:00
hive-site.xml update hive 2018-08-06 20:16:44 +08:00
init_hive.sh add hive 2017-09-02 14:44:57 +08:00
mysql-connector-java-5.1.44-bin.jar add hive 2017-09-02 14:44:57 +08:00
README.md update hive 2018-08-06 20:35:09 +08:00

Run Aapache Hive with Docker

Prequirements

Assume you already have one Hadoop cluster whose master node host is hadoop-master;

Assume you already have a Mysql server whose host is mysql;

You can specify them in conf/hive-site.xml;

Start Hive Node

docker service create \
	--name hive \
	--hostname hive \
	--network swarm-net \
	--replicas 1 \
	--detach=true \
	--mount type=bind,source=/etc/localtime,target=/etc/localtime \
	newnius/hive:2.1.1

Init && Test

Init HIVE for the first time

Create HIVE dir in HDFS

$HADOOP_HOME/bin/hdfs dfs -mkdir /tmp
$HADOOP_HOME/bin/hdfs dfs -mkdir -p /user/hive/warehouse
$HADOOP_HOME/bin/hdfs dfs -chmod g+w /tmp
$HADOOP_HOME/bin/hdfs dfs -chmod g+w /user/hive/warehouse

Init MetaStore

schematool --dbType mysql --initSchema

Validate Installation

Run hive to start the hive shell

If the following command is executed successfully, then the installation is fine.

CREATE TABLE pokes (foo INT, bar STRING);