Create a gist now

Instantly share code, notes, and snippets.

@mneedham /docker.sh
Last active Nov 13, 2016

function config {
mkdir -p /tmp/ce/$1/conf
cat > /tmp/ce/$1/conf/neo4j.conf << EOF
unsupported.dbms.edition=enterprise
dbms.mode=CORE
dbms.security.auth_enabled=false
dbms.memory.heap.initial_size=512m
dbms.memory.heap.max_size=512m
dbms.memory.pagecache.size=100M
dbms.tx_log.rotation.retention_policy=false
dbms.connector.bolt.type=BOLT
dbms.connector.bolt.enabled=true
dbms.connector.bolt.listen_address=0.0.0.0:7687
dbms.connector.http.type=HTTP
dbms.connector.http.enabled=true
dbms.connector.http.listen_address=0.0.0.0:7474
dbms.connectors.default_listen_address=0.0.0.0
dbms.connectors.default_advertised_address=${1}
causal_clustering.initial_discovery_members=instance0:5000,instance1:5000,instance2:5000
causal_clustering.leader_election_timeout=2s
EOF
}
function run {
HOST=$1
INSTANCE=instance$HOST
config $INSTANCE
docker run --name=$INSTANCE --detach \
--publish=$[7474+$HOST]:7474 \
--publish=$[7687+$HOST]:7687 \
--net=cluster \
--hostname=$INSTANCE \
--volume /tmp/ce/$INSTANCE/conf:/conf \
--volume /tmp/ce/$INSTANCE/data:/data \
neo4j/neo4j-experimental:3.1.0-M13-beta3-enterprise
}
docker network create --driver=bridge cluster
run 0
run 1
run 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment