Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@peterroelants
Created March 12, 2021 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterroelants/f3ceb4d972c2f819c37d742b3a8602f3 to your computer and use it in GitHub Desktop.
Save peterroelants/f3ceb4d972c2f819c37d742b3a8602f3 to your computer and use it in GitHub Desktop.
Alluxio with FUSE container setup based on Alluxio Documentation
# Alluxio Docker Deployment
# Based on "Using User-Defined Network" configuration from:
# https://docs.alluxio.io/os/user/stable/en/deploy/Running-Alluxio-On-Docker.html
version: '3.8'
networks:
alluxio-network:
name: alluxio-network
driver: bridge
volumes:
alluxio-volume:
driver: local
# sudo rm -rf /tmp/alluxio_fuse_mnt && mkdir -p /tmp/alluxio_fuse_mnt && chmod -R a+rwx /tmp/alluxio_fuse_mnt && docker-compose --file ./alluxio_pre_build/fuse_experiments/alluxio.fuse.compose.yml up
services:
alluxio-master:
image: alluxio/alluxio:2.5.0
container_name: alluxio-master
volumes:
- alluxio-volume:/opt/alluxio/underFSStorage
environment:
ALLUXIO_JAVA_OPTS: >-
-Dalluxio.master.hostname=alluxio-master
-Dalluxio.master.mount.table.root.ufs=/opt/alluxio/underFSStorage
networks:
- alluxio-network
ports:
# Master web UI port
- "19999:19999"
# Master RPC port
- "19998:19998"
command: master
# Use Master REST API to check if up
# https://docs.alluxio.io/os/restdoc/stable/master/index.html
healthcheck:
test: wget -O - http://alluxio-master:19999/api/v1/master/info &>/dev/null || exit 1
interval: 5s
timeout: 5s
retries: 30
start_period: 15s
restart: unless-stopped
alluxio-worker:
image: alluxio/alluxio:2.5.0
container_name: alluxio-worker
# Increase shared memory
shm_size: '1gb'
volumes:
- alluxio-volume:/opt/alluxio/underFSStorage
environment:
ALLUXIO_JAVA_OPTS: >-
-Dalluxio.worker.ramdisk.size=1G
-Dalluxio.master.hostname=alluxio-master
-Dalluxio.worker.hostname=alluxio-worker
networks:
- alluxio-network
ports:
# Worker RPC port
- "29999:29999"
# Worker web UI port
- "30000:30000"
command: worker
# Use Worker REST API to check if up
# https://docs.alluxio.io/os/restdoc/stable/worker/index.html
healthcheck:
test: wget -O - http://alluxio-worker:30000/api/v1/worker/info &>/dev/null || exit 1
interval: 5s
timeout: 5s
retries: 30
start_period: 5s
depends_on:
alluxio-master:
condition: service_healthy
restart: unless-stopped
alluxio-fuse:
image: alluxio/alluxio-fuse:2.5.0
container_name: alluxio-fuse
# https://github.com/compose-spec/compose-spec/blob/master/spec.md#cap_add
# https://man7.org/linux/man-pages/man7/capabilities.7.html
cap_add:
- SYS_ADMIN
security_opt:
- apparmor:unconfined
devices:
- /dev/fuse:/dev/fuse
volumes:
- /tmp/alluxio_fuse_mnt:/mnt:rshared
environment:
MOUNT_POINT: /mnt/alluxio-fuse
ALLUXIO_JAVA_OPTS: >-
-Dalluxio.master.hostname=alluxio-master
-Djava.library.path=/path/to/dir
networks:
- alluxio-network
command: fuse
healthcheck:
test: mount | grep $${MOUNT_POINT} &>/dev/null || exit 1
interval: 5s
timeout: 1s
retries: 6
start_period: 5s
depends_on:
alluxio-master:
condition: service_healthy
alluxio-worker:
condition: service_healthy
restart: unless-stopped
fuse-test:
image: debian:buster-slim
container_name: fuse-test
volumes:
- /tmp/alluxio_fuse_mnt:/mnt:rshared
# Needs to be the same uid:gid as the alluxio user in the alluxio containers
user: "1000:1000"
command:
- /bin/bash
- -c
- |
sleep 5
whoami
ls -ld /mnt/
df /mnt/
ls -ld /mnt/alluxio-fuse
df /mnt/alluxio-fuse
sleep 1
echo "test $$(id -u) $$(id -g)" > /mnt/alluxio-fuse/test.txt
while true; do ls -l /mnt/alluxio-fuse; sleep 5; done
depends_on:
alluxio-fuse:
condition: service_healthy
restart: "no"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment