Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.bash eol=lf
6 changes: 6 additions & 0 deletions 01_postgres/down.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

docker-compose down
10 changes: 10 additions & 0 deletions 01_postgres/up.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

>&2 echo "Starting PostgreSQL..."
docker compose up --detach

>&2 echo "Connecting to the CLI as postgres..."
docker exec -it 7dbs_postgres_db psql -U postgres -W --dbname=7dbs
6 changes: 6 additions & 0 deletions 02_hbase/cluster_down.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

docker-compose -f docker-images/docker-compose-distributed-local.yml down
8 changes: 8 additions & 0 deletions 02_hbase/cluster_setup.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

docker volume create --name=hadoop_namenode
docker volume create --name=hadoop_datanode
docker volume create --name=hadoop_historyserver
8 changes: 8 additions & 0 deletions 02_hbase/cluster_teardown.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

docker volume rm hadoop_namenode
docker volume rm hadoop_datanode
docker volume rm hadoop_historyserver
12 changes: 12 additions & 0 deletions 02_hbase/cluster_up.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

>&2 echo "Starting HBase (local cluster)..."
docker-compose -f docker-images/docker-compose-distributed-local.yml up --detach

# Connect to HBase shell
>&2 echo "To connect to the shell: /opt/hbase-1.2.6/bin/hbase shell"
>&2 echo "To access scripts: /tmp/scripts/"
docker exec -it hbase-master /bin/bash
12 changes: 12 additions & 0 deletions 02_hbase/local_down.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

docker-compose -f docker-images/docker-compose-standalone.yml down

docker volume rm docker-hbase_hadoop_namenode
docker volume rm docker-hbase_hadoop_datanode
docker volume rm docker-hbase_hadoop_historyserver
docker volume rm docker-hbase_hbase_data
docker volume rm docker-hbase_hbase_zookeeper_data
10 changes: 10 additions & 0 deletions 02_hbase/local_up.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

>&2 echo "Starting HBase (local standalone)..."
docker-compose -f docker-images/docker-compose-standalone.yml up --detach

# Connect to HBase shell
docker exec -it hbase /opt/hbase-1.2.6/bin/hbase shell
6 changes: 6 additions & 0 deletions 03_mongodb/cluster_down.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

docker-compose -f cluster/mongo-cluster-docker/docker-compose.1.yml -f cluster/mongo-cluster-docker/docker-compose.2.yml -f cluster/mongo-cluster-docker/docker-compose.cnf.yml -f cluster/mongo-cluster-docker/docker-compose.shard.yml -f cluster/docker-compose.gui.yml down
11 changes: 11 additions & 0 deletions 03_mongodb/cluster_up.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

docker-compose -f cluster/mongo-cluster-docker/docker-compose.1.yml -f cluster/mongo-cluster-docker/docker-compose.2.yml -f cluster/mongo-cluster-docker/docker-compose.cnf.yml -f cluster/mongo-cluster-docker/docker-compose.shard.yml -f cluster/docker-compose.gui.yml up --detach

# No authentication needed
>&2 echo "Connecting to the CLI..."
sleep 5
docker exec -it mongo-router mongo
6 changes: 6 additions & 0 deletions 03_mongodb/local_down.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

docker-compose down
14 changes: 14 additions & 0 deletions 03_mongodb/local_up.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

>&2 echo "Starting MongoDB..."
docker-compose up --detach

>&2 echo "Opening GUI (mongo-express)"

>&2 echo "Connecting to the CLI..."
sleep 5
>&2 echo "Username: mongo; Password: gonmo"
docker exec -it 7dbs_mongo_db mongo --username mongo --password gonmo
10 changes: 10 additions & 0 deletions 04_couchdb/cluster/cluster_down.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

docker compose down

rm -rf couch1data
rm -rf couch2data
rm -rf couch3data
14 changes: 14 additions & 0 deletions 04_couchdb/cluster/cluster_up.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

mkdir -p couch1data
mkdir -p couch2data
mkdir -p couch3data

docker build --file couch-cookie/Dockerfile --tag couch_cluster:latest couch-cookie
docker compose up -d

sleep 15
./setup_clustering.sh
6 changes: 6 additions & 0 deletions 04_couchdb/cluster/couch-cookie/build.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

docker build --tag couch_cluster:latest .
8 changes: 8 additions & 0 deletions 04_couchdb/connect_couchdb.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

#docker exec -it 7dbs_couch_db bash

docker compose --file docker-compose-linux.yml exec couch bash
7 changes: 7 additions & 0 deletions 04_couchdb/connect_curl.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

# docker run -it --entrypoint sh --network 04_couchdb_default 04_couchdb_firstrun
docker compose --file docker-compose-linux.yml run --entrypoint sh firstrun
27 changes: 27 additions & 0 deletions 04_couchdb/docker-compose-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: '3.1'

services:
couch:
container_name: 7dbs_couch_db
hostname: 7dbs_couch_db
image: couchdb:2.3.1
ports:
- 8084:5984
restart: always
volumes:
- ./scripts:/tmp
environment:
COUCHDB_USER: couchdb
COUCHDB_PASSWORD: bouchdc
firstrun:
container_name: 7dbs_couch_firstrun
build:
context: couch-firstrun
dockerfile: Dockerfile
depends_on:
- couch
restart: "no"
environment:
COUCHDB_USER: couchdb
COUCHDB_PASSWORD: bouchdc
NODENAME: couch-single
6 changes: 6 additions & 0 deletions 04_couchdb/local_down.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

docker compose --file docker-compose-linux.yml down
9 changes: 9 additions & 0 deletions 04_couchdb/local_up.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

>&2 echo "Starting CouchDB..."
docker compose --file docker-compose-linux.yml up --detach

>&2 echo "Opening GUI (Fauxton) at 'http://localhost:8084/_utils/#login'"
2 changes: 2 additions & 0 deletions 05_neo4j/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
data/
logs/
16 changes: 16 additions & 0 deletions 05_neo4j/docker-compose-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3.1'

services:
neo:
container_name: 7dbs_neo4j_db
hostname: 7dbs_neo4j_db
image: neo4j:3.5.8
ports:
- 8085:7474
- 7687:7687
restart: always
volumes:
- ./data:/data
- ./logs:/logs
environment:
NEO4J_AUTH: neo4j/geo4a
12 changes: 12 additions & 0 deletions 05_neo4j/local_clean.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

# Because the files created inside the container may have have a different
# user id than the user outside the container, the user outside the container
# cannot delete the files in data and logs without elevated privileges.
# Instead, we again run the container, and delete from within the container
# with the same user id that created them.
docker compose --file docker-compose-linux.yml run --entrypoint rm neo -rf /data/* /logs/*
rm -rf data logs
6 changes: 6 additions & 0 deletions 05_neo4j/local_down.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

docker compose --file docker-compose-linux.yml down
11 changes: 11 additions & 0 deletions 05_neo4j/local_up.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

>&2 echo "Starting Neo4j..."
mkdir -p "data"
mkdir -p "logs"
docker compose --file docker-compose-linux.yml up --detach

>&2 echo "Opening GUI at 'http://localhost:8085'"
9 changes: 9 additions & 0 deletions 06_dynamodb/down.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

docker stop 7dbs_dynamo_cli
docker rm 7dbs_dynamo_cli
docker compose down
docker network rm dynamo_net
25 changes: 25 additions & 0 deletions 06_dynamodb/up.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

>&2 echo "Starting DynamoDB (local)..."
docker network create -d bridge --subnet 173.106.0.0/24 dynamo_net

docker build -t aws-cli:1.16.173 ./aws_cli
docker compose up --detach

>&2 echo "Opening dynamo-admin at 'http://localhost:8086'"

>&2 echo "Connecting to the CLI..."
>&2 echo "All Dynamo commands need the following appended: --endpoint-url http://db:8000"
docker run \
-it \
--name 7dbs_dynamo_cli \
--network dynamo_net \
-e "AWS_ACCESS_KEY_ID=dummy" \
-e "AWS_SECRET_ACCESS_KEY=dummy" \
-e "AWS_DEFAULT_REGION=eu-west-1" \
-e "AWS_DEFAULT_OUTPUT=json" \
aws-cli:1.16.173 \
sh
8 changes: 8 additions & 0 deletions 07_redis/cluster/down.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

docker compose -f docker-compose-cluster.yml down
docker compose down
docker network rm redis_net
16 changes: 16 additions & 0 deletions 07_redis/cluster/up.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

>&2 echo "Starting Redis Cluster..."
docker network create -d bridge --subnet 173.17.0.0/24 redis_net
docker compose up --detach

>&2 echo "Attempting to Cluster Redis instances..."
docker compose -f docker-compose-cluster.yml up

>&2 echo "Opening rebrow (for visual representation) at 'http://localhost:8097'"

>&2 echo "Connecting to the CLI..."
# docker exec -it 7dbs_redis_db redis-cli
6 changes: 6 additions & 0 deletions 07_redis/down.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

docker compose down
13 changes: 13 additions & 0 deletions 07_redis/up.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "${SCRIPT_DIR}"

>&2 echo "Starting Redis..."
docker compose up --detach

>&2 echo "Opening rebrow (for visual representation) at 'http://localhost:8087'"

>&2 echo "Connecting to the CLI..."

docker compose exec db redis-cli