Skip to content

Instantly share code, notes, and snippets.

@a4amaan
Last active November 19, 2020 10:50
Show Gist options
  • Save a4amaan/6828761d228e3e9d3c8be87daa5bfadb to your computer and use it in GitHub Desktop.
Save a4amaan/6828761d228e3e9d3c8be87daa5bfadb to your computer and use it in GitHub Desktop.
Setup Alluxio Presto Hive
=============================== Setup alluxio With Proxy ===============================
Get IP Address by ifconfig and replace below ip address:
docker volume create ufs
docker network create alluxio_network
docker run -d --rm -p 19999:19999 -p 19998:19998 -p 39999:39999 --net=alluxio_network --name=alluxio-master -v /data/master:/opt/alluxio/logs -v ufs:/opt/alluxio/underFSStorage -e ALLUXIO_JAVA_OPTS="-Dalluxio.master.hostname=alluxio-master -Dalluxio.master.mount.table.root.ufs=/opt/alluxio/underFSStorage -Dalluxio.user.file.delete.unchecked=true -Dalluxio.user.file.writetype.default=CACHE_THROUGH -Dalluxio.user.file.ufs.tier.enabled=true -Dalluxio.security.authorization.permission.umask=000" alluxio/alluxio master
docker run -d --rm -p 29999:29999 -p 29998:29998 -p 30000:30000 --net=alluxio_network --name=alluxio-worker-1 -v /data/worker:/opt/alluxio/logs -v ufs:/opt/alluxio/underFSStorage --shm-size=16G -e ALLUXIO_JAVA_OPTS="-Dalluxio.worker.memory.size=16G -Dalluxio.master.hostname=alluxio-master -Dalluxio.worker.hostname=192.168.23.210 -Dalluxio.user.file.delete.unchecked=true -Dalluxio.user.file.writetype.default=CACHE_THROUGH -Dalluxio.user.file.ufs.tier.enabled=true -Dalluxio.security.authorization.permission.umask=000" alluxio/alluxio worker
Login As Root to Start Proxy:
docker exec -it --user root alluxio-master /bin/bash
cd bin
./alluxio-start.sh proxy
=============================== Setup Hive Metastore ===============================
Get release the port if being used
sudo fuser -k 3306/tcp
docker build -t hive-image -f hive/Dockerfile .
docker run -d --shm-size 1G --net=alluxio_network -p 9083:9083 -p 3306:3306 --name=hive-00 hive-image
docker logs hive-00
docker exec -it hive-00 mysql -uroot -p'ygEK[AH3g4tsub0v0vyNLoqytApk'
OcAc$icz3shuSCos9AsygPUN73B
5. docker logs hive-00 2>&1 | grep GENERATED //this gets random password set for root, which is used in below step 6.
6. docker exec -it mysql1 mysql -uroot -p'{password_obtained_from_above_command_4.}'
6.1. ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';
6.2. CREATE database metastore;
6.3. CREATE USER 'hiveuser'@'%' IDENTIFIED BY 'hivepassword';
6.4. GRANT ALL PRIVILEGES ON metastore . * TO 'hiveuser'@'%';
USE metastore;
6.5. SOURCE /opt/apache-hive-2.1.0-bin/scripts/metastore/upgrade/mysql/hive-schema-0.14.0.mysql.sql;
SET Directory Permissions By Using Bash Terminal inside Docker:
chmod -R 777 /user/hive/warehouse
SART HIVE SHELL:
docker exec -u datamaster -it hive-00 hive
=============================== Setup Presto ===============================
docker build -t presto-coordinator-image -f presto-coordinator/Dockerfile .
docker run -d --shm-size 3G -u datamaster -p 8080:8080 --net=alluxio_network --name=presto-coordinator presto-coordinator-image
docker build -t presto-worker-image -f presto-worker/Dockerfile .
docker run -d -u datamaster --shm-size 3G -p 8081:8081 --net=alluxio_network --name=presto-worker-00 presto-worker-image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment