Install and Configure Cassandra

The {ProductShortName} services require a running Cassandra instance.

  1. Run the Cassandra container and configure the Cassandra data location. By default the Cassandra container will create a volume under /opt/apache-cassandra/data. This container directory will automatically be mapped to a unique local directory which you can view using docker inspect <container-id>. You can use the -v option to map the Cassandra data volume to a specific host directory.

    Important
    CASSANDRA_START_RPC must be set to true. If this option is set to false the middleware manager services cannot connect to Cassandra.
    Note
    The Z option is necessary on Red Hat Enterprise Linux/Fedora based systems to correctly set the SELinux permissions.
    docker run --name mwmanager-cassandra -d -e CASSANDRA_START_RPC=true -v /var/mydatastore:/opt/apache-cassandra/data:Z registry.access.redhat.com/jboss-mm-7-tech-preview/middleware-manager-datastore:latest
  2. Verify that the server is running.

    docker ps
    Result
    CONTAINER ID   IMAGE                                                                         COMMAND                  CREATED          STATUS          PORTS                                         NAMES
    34a75ba45be8   registry.access.redhat.com/jboss-mm-7-tech-preview/middleware-manager-datastore:latest   "/docker-entrypoint.s"   44 seconds ago   Up 44 seconds   7000-7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp   mwmanager-cassandra
  3. View the node information.

    docker exec -it <container_id> /opt/apache-cassandra/bin/nodetool info

Running Cassandra with a Non-default User

You can run the Cassandra container with an arbitrary user ID, however, that user must have permissions to write to the Cassandra data volume.

Note
The Z option is necessary on Red Hat Enterprise Linux/Fedora based systems to correctly set the SELinux permissions.
chown myuser:myuser /var/mydatastore
docker run --name mwmanager-cassandra -d -e CASSANDRA_START_RPC=true --user $(id -u myuser) -v /var/mydatastore:/opt/apache-cassandra/data:Z registry.access.redhat.com/jboss-mm-7-tech-preview/middleware-manager-datastore:latest