Based tairangroup/hadoop:latest
Start MySQL :
docker run --name dmp_mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql
Start Hive:
docker run --name hive -h hive -P -e KEEP=true --link dmp_mysql:mysql -d gudaoxuri/hive
Operation:
Hive Home:/opt/hive/
example:
> cat>test_person.txt<<EOF
tom 20
jack 24
nestor 29
EOF
> hdfs dfs -mkdir /tmp/hivetest/
> hdfs dfs -put ./test_person.txt /tmp/hivetest/
> hive
CREATE EXTERNAL TABLE test_person(name STRING,age INT)ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' LOCATION '/tmp/hivetest';
select * from test_person;
> beeline -u jdbc:hive2://localhost:10000
select * from test_person;