Hi Bart,

Max from ArangoDB here. We are putting the finishing touches on the 3.0 
release basically as we speak. Good cluster setup documentation is 
unfortunately one of the things we are still missing, but we will 
definitely have this in place for the release.

Am Mittwoch, 25. Mai 2016 22:49:17 UTC+2 schrieb Bart DS:
>
> Hi Willi,
>
> Thanks for this very detailed explanation.
> If I understand correctly, I can set up an ArangoDB 3.0 cluster without 
> any orchestration framework (such as Mesos) ? 
>
Yes, the startup process has been simplified a lot for 3.0. You basically 
have to fire up a bunch of Docker containers (all with the same image) with 
certain command line options. Everything else organises itself within the 
ArangoDB cluster. We will publish a blog post shortly after the release to 
explain how this is done.

> When using asynchronous replication there will be no automatic failover or 
> rebalancing (yet), but when using synchronous replication I will have 
> automatic failover and rebalancing out of the box?
>
Yes, all of this is done within the ArangoDB cluster thanks to our own 
implementation of the Raft consensus protocol. The only thing it cannot do 
on its own is restart containers or launch new ones. And automatic failover 
for the asynchronous replication within the ArangoDB cluster will only land 
with 3.1.

>
> So if I have e.g. 5 servers in the cluster and one server goes down, one 
> (or more?) of the other 4 servers will take over the tasks of the failing 
> server and all reads/writes will still succeed?
> Is that correct?
>
Exactly so. And due to synchronous replication you will not lose committed 
and confirmed data. 

>
> Also, If I run 3.0 on another orchestration framework, will I be able to 
> dynamically add/remove servers to/from the cluster already? Or isn't that 
> possible yet?out 
>
You can simply start new Docker containers to add more coordinators or 
DBServers. You can simply kill coordinators without losing anything.
You can ask the ArangoDB cluster to clean out a DBserver in a controlled 
fashion such that its data is relocated to other servers automatically.
Once this has completed, you can simply kill the DBServer by stopping its 
Docker container.

>
> Can you point me to any documentation on how to set up such a cluster with 
> ArangoDB 3.0?
>
Unfortunately, this is not yet written. I do have a bash script which 
launches a cluster locally just using docker containers. I attach the 
script such that you can see how things will work. This uses the 3.0.0b3 
which we are about to publish. Note that in this not all of the above 
mentioned features work yet.

Cheers,
  Max.

>
> Bart
>

-- 
You received this message because you are subscribed to the Google Groups 
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
#!/bin/bash
if [ -z "$XTERM" ] ; then
    XTERM=x-terminal-emulator
fi
if [ -z "$XTERMOPTIONS" ] ; then
    XTERMOPTIONS="--geometry=80x43"
fi

NRDBSERVERS=$1
if [ "$NRDBSERVERS" == "" ] ; then
    NRDBSERVERS=2
fi
echo Number of DBServers: $NRDBSERVERS
NRCOORDINATORS=$2
if [ "$NRCOORDINATORS" == "" ] ; then
    NRCOORDINATORS=1
fi
echo Number of Coordinators: $NRCOORDINATORS

if [ ! -z "$3" ] ; then
    if [ "$3" == "C" ] ; then
        COORDINATORCONSOLE=1
        echo Starting one coordinator in terminal with --console
    fi
fi

SECONDARIES="$4"

echo Starting agency...
docker run -d --net=host -e ARANGO_NO_AUTH=1 --name=agency \
  arangodb/arangodb-preview:3.0.0b1 \
  --agency.endpoint tcp://0.0.0.0:4001 \
  --agency.id 0 \
  --agency.size 1 \
  --agency.wait-for-sync false \
  --agency.supervision false \
  --agency.supervision-frequency 5 \
  --server.endpoint tcp://0.0.0.0:4001 \
  --server.statistics false \
  --server.threads 16
sleep 1

start() {
    if [ "$1" == "dbserver" ]; then
      ROLE="PRIMARY"
    elif [ "$1" == "coordinator" ]; then
      ROLE="COORDINATOR"
    fi
    TYPE=$1
    PORT=$2
    echo Starting $TYPE on port $PORT
    docker run -d --net=host -e ARANGO_NO_AUTH=1 --name="$TYPE_$PORT" \
      arangodb/arangodb-preview:3.0.0b1 \
                --cluster.agency-endpoint tcp://127.0.0.1:4001 \
                --cluster.my-address tcp://127.0.0.1:$PORT \
                --server.endpoint tcp://127.0.0.1:$PORT \
                --cluster.my-local-info $TYPE:127.0.0.1:$PORT \
                --cluster.my-role $ROLE \
                --log.level trace \
                --server.statistics false
}

startTerminal() {
    if [ "$1" == "dbserver" ]; then
      ROLE="PRIMARY"
    elif [ "$1" == "coordinator" ]; then
      ROLE="COORDINATOR"
    fi
    TYPE=$1
    PORT=$2
    echo Starting $TYPE on port $PORT
    $XTERM $XTERMOPTIONS -e docker run -it --net=host -e ARANGO_NO_AUTH=1 \
      --name="$TYPE_$PORT" \
      arangodb/arangodb-preview:3.0.0b1 \
                --cluster.agency-endpoint tcp://127.0.0.1:4001 \
                --cluster.my-address tcp://127.0.0.1:$PORT \
                --server.endpoint tcp://127.0.0.1:$PORT \
                --cluster.my-local-info $TYPE:127.0.0.1:$PORT \
                --cluster.my-role $ROLE \
                --server.statistics false \
                --console &
}

PORTTOPDB=`expr 8629 + $NRDBSERVERS - 1`
for p in `seq 8629 $PORTTOPDB` ; do
    start dbserver $p
done
PORTTOPCO=`expr 8530 + $NRCOORDINATORS - 1`
for p in `seq 8530 $PORTTOPCO` ; do
    if [ $p == "8530" -a ! -z "$COORDINATORCONSOLE" ] ; then
        startTerminal coordinator $p
    else
        start coordinator $p
    fi
done

echo Waiting for cluster to come up...

testServer() {
    PORT=$1
    while true ; do
        curl -s -f -X GET "http://127.0.0.1:$PORT/_api/version"; > /dev/null 2>&1
        if [ "$?" != "0" ] ; then
            echo Server on port $PORT does not answer yet.
        else
            echo Server on port $PORT is ready for business.
            break
        fi
        sleep 1
    done
}

for p in `seq 8629 $PORTTOPDB` ; do
    testServer $p
done
for p in `seq 8530 $PORTTOPCO` ; do
    testServer $p
done

echo Done, your cluster is ready at
for p in `seq 8530 $PORTTOPCO` ; do
    echo "   build/bin/arangosh --server.endpoint tcp://127.0.0.1:$p"
done

Reply via email to