mirror of
https://github.com/newnius/Dockerfiles.git
synced 2025-06-08 00:51:55 +00:00
update hive
This commit is contained in:
parent
bb88d0280a
commit
6b73c78687
@ -16,8 +16,8 @@ ENV HIVE_HOME /usr/local/hive
|
|||||||
|
|
||||||
ENV PATH $PATH:$HIVE_HOME/bin
|
ENV PATH $PATH:$HIVE_HOME/bin
|
||||||
|
|
||||||
ADD mysql-connector-java-5.1.44-bin.jar $HIVE_HOME/lib
|
#ADD mysql-connector-java-5.1.44-bin.jar $HIVE_HOME/lib
|
||||||
#RUN wget -O $HIVE_HOME/lib/ http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.44/mysql-connector-java-5.1.44.jar
|
RUN wget -O $HIVE_HOME/lib/ http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.44/mysql-connector-java-5.1.44.jar
|
||||||
|
|
||||||
ADD hive-site.xml $HIVE_HOME/conf
|
ADD hive-site.xml $HIVE_HOME/conf
|
||||||
|
|
||||||
|
@ -1,64 +1,50 @@
|
|||||||
Run Aapache Hive with Docker
|
Run Aapache Hive with Docker
|
||||||
|
|
||||||
## Create a hadoop cluster with Hive supported in swarm mode
|
## Prequirements
|
||||||
|
|
||||||
`--hostname` needs 1.13 or higher
|
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 \
|
docker service create \
|
||||||
--name hadoop-master \
|
--name hive \
|
||||||
--network swarm-net \
|
--hostname hive \
|
||||||
--hostname hadoop-master \
|
--network swarm-net \
|
||||||
--replicas 1 \
|
--replicas 1 \
|
||||||
--endpoint-mode dnsrr \
|
--detach=true \
|
||||||
newnius/hive:2.1.1
|
--mount type=bind,source=/etc/localtime,target=/etc/localtime \
|
||||||
```
|
newnius/hive:2.1.1
|
||||||
|
|
||||||
```
|
|
||||||
docker service create \
|
|
||||||
--name hadoop-slave1 \
|
|
||||||
--network swarm-net \
|
|
||||||
--hostname hadoop-slave1 \
|
|
||||||
--replicas 1 \
|
|
||||||
--endpoint-mode dnsrr \
|
|
||||||
newnius/hadoop:2.7.4
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
docker service create \
|
|
||||||
--name hadoop-slave2 \
|
|
||||||
--network swarm-net \
|
|
||||||
--hostname hadoop-slave2 \
|
|
||||||
--replicas 1 \
|
|
||||||
--endpoint-mode dnsrr \
|
|
||||||
newnius/hadoop:2.7.4
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
docker service create \
|
|
||||||
--name hadoop-slave3 \
|
|
||||||
--network swarm-net \
|
|
||||||
--hostname hadoop-slave3 \
|
|
||||||
--replicas 1 \
|
|
||||||
--endpoint-mode dnsrr \
|
|
||||||
newnius/hadoop:2.7.4
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Init && Test
|
## Init && Test
|
||||||
|
Init HIVE for the first time
|
||||||
|
|
||||||
#### Start Hadoop
|
#### Create HIVE dir in HDFS
|
||||||
Read `newnius/hadoop` to learn how to init hadoop
|
|
||||||
|
|
||||||
#### Mysql
|
|
||||||
```bash
|
```bash
|
||||||
docker service create \
|
$HADOOP_HOME/bin/hdfs dfs -mkdir /tmp
|
||||||
--name mysql \
|
$HADOOP_HOME/bin/hdfs dfs -mkdir -p /user/hive/warehouse
|
||||||
--network swarm-net \
|
$HADOOP_HOME/bin/hdfs dfs -chmod g+w /tmp
|
||||||
-e MYSQL_ROOT_PWDDWORD=123456 \
|
$HADOOP_HOME/bin/hdfs dfs -chmod g+w /user/hive/warehouse
|
||||||
mysql:5.7
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### init hive
|
#### Init MetaStore
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bash /etc/init_hive.sh
|
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.
|
||||||
|
|
||||||
|
```hive
|
||||||
|
CREATE TABLE pokes (foo INT, bar STRING);
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user