Open source Java implementation for Raft consensus protocol.

Archive

    Docker Testing

    0001 Jan 1

    The Docker orchestration is comprised of the following:

    1. A Docker image which has the necessary software to run the LogService
    2. A docker-compose.yml file which can launch the necessary containers for a full-fledged LogService “cluster”
    3. Scripts to build the Docker image and launch a client environment to interact with a running cluster via Compose.

    Building the Docker image

    $ mvn clean package assembly:single -DskipTests
    $ cd ratis-logservice && ./build-docker.sh
    

    The above will create a Docker image tagged as ratis-logservice:latest.

    Launching a cluster via Compose

    $ docker-compose up -d
    

    The Compose orchestration will launch three MetadataServer containers and three Worker containers, all on the same Docker network. The -d option detaches the container logs from your current shell.

    Connecting a client

    $ ./client-env.sh
    $ ./bin/shell <...>
    $ ./bin/load-test <...>
    

    The client-env.sh script will launch a Docker container which is on the same network as our cluster running in Compose.

    Debugging the cluster

    Use docker logs to inspect the output from a specific container. You must pass the name of the container (obtained via docker-compose ps or docker ps) to docker logs.

    You can also “attach” to a container via docker exec to inspect the environment in which the process is running. Again, using the name of a container obtained as described above, use docker exec -it <name> /bin/sh to attach to the container.

    Vagrant Testing

    0001 Jan 1

    Please refer to the documentation for instructions to use the Vagrant automation.

    Starting from the directory dev-support/vagrant/:

    • To build all Vagrant boxes, invoke ./run_all_tests.sh build
    • To remove any generated data, invoke ./run_all_tests.sh clean
    • To run the tests, invoke vagrant resume ratis-servers && vagrant ssh ratis-servers